Skip to contentSkip to conversation

udev check for UID 0

PATCH In review Michael Buesch 2 participants 2 messages Feb 24, 2004 – Feb 28, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udev check for UID 0

Hi,

As udev is unable to run without UID 0 privileges, we should check for it early and print out some information to make the user aware of this.

udev.c 2004-02-24 19:36:49.000000000 +0100 renamed from udev.c.orig 2004-02-24 15:24:13.000000000 +0100 +5 -0
@@ -109,6 +109,11 @@
        int i;
        struct sigaction act;
 
+       if (geteuid() != 0) {
+               printf("udev requires root (UID 0) privileges\n");
+               goto exit;
+       }
+
        action = get_action();
        if (!action) {
                dbg("no action?");
Signature · 13 lines
Regards Michael Buesch  [ http://www.tuxsoft.de.vu ]



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 5 lines · Michael Buesch

Hi,

As udev is unable to run without UID 0 privileges, we should check for it early and print out some information to make the user aware of this.

printf means nothing to udev, as it is never called where there is a valid stdout. Better we just keep the current convention.

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel