Re: [PATCH] jfsutils: pass mode bits when calling open with O_CREAT

Dave Kleikamp <[email protected]> Thu, 23 Aug 2007 23:22:49 -0500
Newsgroups gmane.comp.file-systems.jfs.patches
Message-ID <[email protected]>
Thanks, Josh. I already jumped the gun and committed a similar patch to
cvs.  Thanks for bringing it to my attention.

Shaggy

On Thu, 2007-08-23 at 21:57 -0500, Josh Boyer wrote:
> Recent glibc builds will fail to compile jfsutils when -DFORTIFY_SOURCE
> is passed in CFLAGS due to open being called with O_CREAT and no mode
> parameter.  This was seen in Fedora rawhide recently.  The patch below
> fixes it.
> 
> Signed-off-by: Josh Boyer <[email protected]>
> 
> Index: jfsutils-1.1.11/libfs/fssubs.c
> ===================================================================
> --- jfsutils-1.1.11.orig/libfs/fssubs.c
> +++ jfsutils-1.1.11/libfs/fssubs.c
> @@ -59,7 +59,7 @@ int Is_Root_Mounted_RO()
> 
>  #define TEST_FILE "/.ismount-test-file"
> 
> -       fd = open(TEST_FILE, O_RDWR | O_CREAT);
> +       fd = open(TEST_FILE, O_RDWR | O_CREAT, 0644);
> 
>         if (fd < 0) {
>                 if (errno == EROFS)

-- 
David Kleikamp
IBM Linux Technology Center


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/