On Tuesday, February 01, 2011 10:19:13 Petr Uzel wrote: > --- a/misc-utils/uuidd.c > +++ b/misc-utils/uuidd.c > @@ -63,12 +63,10 @@ static void create_daemon(void) > uid_t euid; > > pid = fork(); > - if (pid == -1) { > - perror("fork"); > - exit(1); > - } else if (pid != 0) { > - exit(0); > - } > + if (pid == -1) > + die("fork"); > + else if (pid != 0) > + exit(0); > > close(0); > close(1); somewhat related, this code really should read something like: create_daemon() { uid_t euid; if (daemon(0, 0)) die("daemon"); euid = geteuid(); if (setreuid(euid, euid) < 0) die("setreuid"); } -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.