This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


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

To: Ian.Jackson@xxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] Do not set execute permission on qemu-dm log file
From: Daniel Kiper <dkiper@xxxxxxxxxxxx>
Date: Wed, 7 Apr 2010 23:10:46 +0200
Delivery-date: Wed, 07 Apr 2010 14:11:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19387.16208.951229.418883@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20100326141437.GA16243@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <19387.16208.951229.418883@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.3.28i

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

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

<Prev in Thread] Current Thread [Next in Thread>