Whamcloud - gitweb
fix check_mntent_file() to pass mode for open(O_CREAT)
authorAndreas Dilger <adilger@sun.com>
Fri, 9 Nov 2007 01:20:15 +0000 (18:20 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 2 Dec 2007 10:25:30 +0000 (05:25 -0500)
On my FC8 install, ismounted.c fails to build because open(O_CREAT) is
used without passing a mode.  The following trivial patch fixes it.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ismounted.c

index 24246e0..684e91e 100644 (file)
@@ -147,7 +147,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file,
 is_root:
 #define TEST_FILE "/.ismount-test-file"                
                *mount_flags |= EXT2_MF_ISROOT;
-               fd = open(TEST_FILE, O_RDWR|O_CREAT);
+               fd = open(TEST_FILE, O_RDWR|O_CREAT, 0600);
                if (fd < 0) {
                        if (errno == EROFS)
                                *mount_flags |= EXT2_MF_READONLY;