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

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

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);

+       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.


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

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?


Yes, I don't think a patch v2 just for that change is needed.

Daniel De Graaf
National Security Agency

Xen-devel mailing list



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