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

Re: [Xen-devel] [PATCH] xenstore: create pidfile in init-xenstore-domain



On Wed, 2013-04-24 at 14:45 +0100, Daniel De Graaf wrote:
> On 04/24/2013 09:36 AM, Ian Campbell wrote:
> > On Wed, 2013-04-24 at 14:05 +0100, Daniel De Graaf wrote:
> >> On 04/24/2013 07:24 AM, Ian Campbell wrote:
> >>> On Mon, 2013-04-22 at 18:06 +0100, Daniel De Graaf wrote:
> >>>
> >>>> @@ -90,5 +91,12 @@ int main(int argc, char** argv)
> >>>>          xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
> >>>>          xs_daemon_close(xsh);
> >>>>
> >>>> +        fd = creat("/var/run/xenstored.pid", 0666);
> >>>
> >>> This is world writeable which doesn't seem like a good idea.
> >>>
> >>> Most of the pidfiles on my system seem to use 0644.
> >>>
> >>> Ian.
> >>>
> >>
> >> The mode specified here is ANDed with your ~umask, which is usually
> >> something like 0022. If you prefer an explicit 0644, that's easy to
> >> change.
> >
> > I've no idea what umask typically looks like when running an initscript
> > from /sbin/init though. But on Debian:
> > $ grep umask /etc/init.d/rc*
> > /etc/init.d/rc:umask 022
> >
> > OK, I think I'm sold on 0666, thanks!
> >
> >> I also noticed that the file contents are missing a trailing
> >> newline after submission.
> >
> > Shall I just add \n as I commit?
> >
> > Ian.
> 
> Yes, I don't think a patch v2 just for that change is needed.

I tried to apply but:
        init-xenstore-domain.c: In function 'main':
        init-xenstore-domain.c:97:8: error: ignoring return value of 'write', 
declared with attribute warn_unused_result [-Werror=unused-result]
        cc1: all warnings being treated as errors
        make[3]: *** [init-xenstore-domain.o] Error 1
        make[3]: *** Waiting for unfinished jobs....

Guess my gcc is more picky than yours :-/

Ian.


> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.