diff --git a/usr/src/security-misc/emerg-shutdown.c b/usr/src/security-misc/emerg-shutdown.c index cd310e8..1c89a10 100644 --- a/usr/src/security-misc/emerg-shutdown.c +++ b/usr/src/security-misc/emerg-shutdown.c @@ -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();