mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-11-26 00:18:24 -05:00
Merge branch 'arraybolt3/emerg-shutdown' into arraybolt3/trixie
This commit is contained in:
commit
7aa38245de
1 changed files with 10 additions and 0 deletions
|
|
@ -793,6 +793,7 @@ void hw_monitor(int argc, char **argv) {
|
||||||
char *tmpbuf = NULL;
|
char *tmpbuf = NULL;
|
||||||
bool device_removed = false;
|
bool device_removed = false;
|
||||||
bool device_changed = false;
|
bool device_changed = false;
|
||||||
|
bool disk_media_changed = false;
|
||||||
|
|
||||||
len = recvmsg(ns, &msg, 0);
|
len = recvmsg(ns, &msg, 0);
|
||||||
if (len == -1) {
|
if (len == -1) {
|
||||||
|
|
@ -821,6 +822,10 @@ void hw_monitor(int argc, char **argv) {
|
||||||
device_changed = true;
|
device_changed = true;
|
||||||
goto next_str;
|
goto next_str;
|
||||||
}
|
}
|
||||||
|
if (strcmp(tmpbuf, "DISK_MEDIA_CHANGE=1") == 0) {
|
||||||
|
disk_media_changed = true;
|
||||||
|
goto next_str;
|
||||||
|
}
|
||||||
|
|
||||||
if (strncmp(tmpbuf, "DEVNAME=", strlen("DEVNAME=")) == 0) {
|
if (strncmp(tmpbuf, "DEVNAME=", strlen("DEVNAME=")) == 0) {
|
||||||
if (device_removed || device_changed) {
|
if (device_removed || device_changed) {
|
||||||
|
|
@ -861,6 +866,11 @@ void hw_monitor(int argc, char **argv) {
|
||||||
goto next_str;
|
goto next_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device_changed && !disk_media_changed) {
|
||||||
|
free(rem_devname_line);
|
||||||
|
goto next_str;
|
||||||
|
}
|
||||||
|
|
||||||
if (paranoid_mode) {
|
if (paranoid_mode) {
|
||||||
/* Something was removed, we don't care what, shut down now */
|
/* Something was removed, we don't care what, shut down now */
|
||||||
kill_system();
|
kill_system();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue