mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-31 07:51:08 +03:00
[PATCH] correct detection of hotplug.d/ udevsend loop
If udevsend is called from the commandline the env may be too big to fit in our buffer and we tag the message.
This commit is contained in:
parent
3908058c10
commit
d3c3763530
@ -148,10 +148,6 @@ int main(int argc, char *argv[], char *envp[])
|
|||||||
|
|
||||||
key = envp[i];
|
key = envp[i];
|
||||||
keylen = strlen(key);
|
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 */
|
/* prevent loops in the scripts we execute */
|
||||||
if (strncmp(key, "UDEVD_EVENT=", 12) == 0) {
|
if (strncmp(key, "UDEVD_EVENT=", 12) == 0) {
|
||||||
@ -159,6 +155,11 @@ int main(int argc, char *argv[], char *envp[])
|
|||||||
goto 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 */
|
/* remember the SUBSYSTEM */
|
||||||
if (strncmp(key, "SUBSYSTEM=", 10) == 0)
|
if (strncmp(key, "SUBSYSTEM=", 10) == 0)
|
||||||
subsystem = &key[10];
|
subsystem = &key[10];
|
||||||
|
Loading…
Reference in New Issue
Block a user