mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-11-25 22:38:30 -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;
|
||||
bool device_removed = false;
|
||||
bool device_changed = false;
|
||||
bool disk_media_changed = false;
|
||||
|
||||
len = recvmsg(ns, &msg, 0);
|
||||
if (len == -1) {
|
||||
|
|
@ -821,6 +822,10 @@ void hw_monitor(int argc, char **argv) {
|
|||
device_changed = true;
|
||||
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 (device_removed || device_changed) {
|
||||
|
|
@ -861,6 +866,11 @@ void hw_monitor(int argc, char **argv) {
|
|||
goto next_str;
|
||||
}
|
||||
|
||||
if (device_changed && !disk_media_changed) {
|
||||
free(rem_devname_line);
|
||||
goto next_str;
|
||||
}
|
||||
|
||||
if (paranoid_mode) {
|
||||
/* Something was removed, we don't care what, shut down now */
|
||||
kill_system();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue