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

Re: [Xen-devel] [PATCH] Do not set execute permission on qemu-dm log file



Hi,

> You might want to grep the rest of the code
> for similar uses of os.open.

Fast search: grep -r os\\.open . | grep -v O_RDONLY | wc -l
Occurences: 32 (one of them is invalid)

For the first sight it looks not bed because most of
the opens with !O_RDONLY are for files on sysfs/proc filesystem.
However I think it should be verified (it is a piece of cake).

Additionally, I think that also C code should be checked,
however it require a bit more work.

If you are interested in that I could do that.

> The choice of 0777 as the default mode is ... surprising.

man 2 open:
"mode must be specified when O_CREAT is in the flags,
and is ignored otherwise"

I think that:

os.open(pathname, flags) is
int open(const char *pathname, int flags) and

os.open(pathname, flags, mode) is
int open(const char *pathname, int flags, mode_t mode)

fcntl.h:
extern int open (__const char *__file, int __oflag, ...)
                                      Here is reply ^^^

If flags/__oflag contains O_CREAT and two argument open
is used then invalid mode is taken from the stack
and then modified by umask.

If I am wrong please correct me.

Daniel Kiper

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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