key = envp[i];
keylen = strlen(key);
- if (bufpos + keylen >= HOTPLUG_BUFFER_SIZE-1) {
- dbg("environment buffer too small, probably not called by the kernel");
- continue;
- }
/* prevent loops in the scripts we execute */
- if (strncmp(key, "MANAGED_EVENT=", 14) == 0) {
+ if (strncmp(key, "UDEVD_EVENT=", 12) == 0) {
dbg("seems that the event source is not the kernel, just exit");
goto exit;
}
+ if (bufpos + keylen >= HOTPLUG_BUFFER_SIZE-1) {
+ dbg("environment buffer too small, probably not called by the kernel");
+ continue;
+ }
+
/* remember the SUBSYSTEM */
if (strncmp(key, "SUBSYSTEM=", 10) == 0)
subsystem = &key[10];