Re: [PATCH 1/7] uuidd: use daemon(3) library function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 03, 2011 at 05:01:52PM -0300, Davidlohr Bueso wrote:
> On Thu, 2011-02-03 at 15:04 +0100, Petr Uzel wrote:
> > Signed-off-by: Petr Uzel <petr.uzel@xxxxxxx>
> > ---
> >  misc-utils/uuidd.c |   19 ++-----------------
> >  1 files changed, 2 insertions(+), 17 deletions(-)
> > 
> > diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
> > index 4a230fb..c5c58ae 100644
> > --- a/misc-utils/uuidd.c
> > +++ b/misc-utils/uuidd.c
> > @@ -59,26 +59,11 @@ static void die(const char *msg)
> >  
> >  static void create_daemon(void)
> >  {
> > -	pid_t pid;
> >  	uid_t euid;
> >  
> As per standard daemonizing processes (I've not looked over the uuidd
> code to see if the program creates files though):
> 
> +        umask(0);            	

Unless I missed something, uuidd creates following files:
1) pidfile
2) socket for communication
3) clock state counter (via uuid__generate_time -> get_clock)

The creation of latter two is wrapped into 
'su=umask(0) ...  umask(su)'. 
Only the pidfile creation would be affected by some weird
umask - I don't know if this is an issue.


Petr

--
Petr Uzel
IRC: ptr_uzl @ freenode

Attachment: pgp9U8L1jQBVP.pgp
Description: PGP signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux