linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT)
@ 2007-11-09  1:20 Andreas Dilger
  2007-11-09  3:30 ` Eric Sandeen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andreas Dilger @ 2007-11-09  1:20 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4

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>

Index: e2fsprogs-1.40.2/lib/ext2fs/ismounted.c
===================================================================
--- e2fsprogs-1.40.2.orig/lib/ext2fs/ismounted.c
+++ e2fsprogs-1.40.2/lib/ext2fs/ismounted.c
@@ -147,7 +147,7 @@ static errcode_t check_mntent_file(const
 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;

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT)
  2007-11-09  1:20 [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT) Andreas Dilger
@ 2007-11-09  3:30 ` Eric Sandeen
  2007-11-09 20:22   ` Andreas Dilger
       [not found] ` <47503222.7020502@redhat.com>
  2007-12-01 12:11 ` Theodore Tso
  2 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2007-11-09  3:30 UTC (permalink / raw)
  To: Theodore Ts'o, linux-ext4

Andreas Dilger wrote:
> 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.

You can add:

Acked-by: Eric Sandeen <sandeen@redhat.com>

'cause it's an awful lot like the patch I sent for the same issue back
on 8/16  ;-)  Guess I should have followed that up with a ping.  (though
your 0600 mode is probably better than my 0644 was)

Andreas, did you also run into trouble with struct_io_manager's ->open
calls triggering this test?

I sent a patch for that,

[PATCH] rename ->open and ->close ops in struct_io_manager

too... maybe the glibc #define tricks got smarter and don't trigger that
now?

-Eric

> Signed-off-by: Andreas Dilger <adilger@dilger.ca>
> 
> Index: e2fsprogs-1.40.2/lib/ext2fs/ismounted.c
> ===================================================================
> --- e2fsprogs-1.40.2.orig/lib/ext2fs/ismounted.c
> +++ e2fsprogs-1.40.2/lib/ext2fs/ismounted.c
> @@ -147,7 +147,7 @@ static errcode_t check_mntent_file(const
>  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;
> 
> Cheers, Andreas
> --
> Andreas Dilger
> Sr. Software Engineer, Lustre Group
> Sun Microsystems of Canada, Inc.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT)
  2007-11-09  3:30 ` Eric Sandeen
@ 2007-11-09 20:22   ` Andreas Dilger
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Dilger @ 2007-11-09 20:22 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Theodore Ts'o, linux-ext4

On Nov 08, 2007  21:30 -0600, Eric Sandeen wrote:
> Andreas Dilger wrote:
> > 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.
> 
> You can add:
> 
> Acked-by: Eric Sandeen <sandeen@redhat.com>
> 
> 'cause it's an awful lot like the patch I sent for the same issue back
> on 8/16  ;-)  Guess I should have followed that up with a ping.  (though
> your 0600 mode is probably better than my 0644 was)

Oh, hmm.  I'm only testing against 1.40.2, so it is possible your fix got
in already...  Should have checked that first.

> Andreas, did you also run into trouble with struct_io_manager's ->open
> calls triggering this test?

No, didn't see any such problems with FC8-test3.

> I sent a patch for that,
> 
> [PATCH] rename ->open and ->close ops in struct_io_manager
> 
> too... maybe the glibc #define tricks got smarter and don't trigger that
> now?
> 
> -Eric
> 
> > Signed-off-by: Andreas Dilger <adilger@dilger.ca>
> > 
> > Index: e2fsprogs-1.40.2/lib/ext2fs/ismounted.c
> > ===================================================================
> > --- e2fsprogs-1.40.2.orig/lib/ext2fs/ismounted.c
> > +++ e2fsprogs-1.40.2/lib/ext2fs/ismounted.c
> > @@ -147,7 +147,7 @@ static errcode_t check_mntent_file(const
> >  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;
> > 
> > Cheers, Andreas
> > --
> > Andreas Dilger
> > Sr. Software Engineer, Lustre Group
> > Sun Microsystems of Canada, Inc.
> > 
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT)
       [not found] ` <47503222.7020502@redhat.com>
@ 2007-11-30 23:29   ` Theodore Tso
  0 siblings, 0 replies; 5+ messages in thread
From: Theodore Tso @ 2007-11-30 23:29 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4

On Fri, Nov 30, 2007 at 09:54:10AM -0600, Eric Sandeen wrote:
> Andreas Dilger wrote:
> > 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>
> 
> Ted, I don't yet see this in the tree, can we make sure this doesn't get
> lost?

I'm on vacation, but yes, no problem, this will be in the next 1.40.x
stable release (which will be going out soon thanks to a security
issue that will be going public probably next week).

            	   	   	 	     - Ted

P.S.  There will be a press release going out early next week that
will explain why I will have a lot more time to work on e2fsprogs in
the near future....

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT)
  2007-11-09  1:20 [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT) Andreas Dilger
  2007-11-09  3:30 ` Eric Sandeen
       [not found] ` <47503222.7020502@redhat.com>
@ 2007-12-01 12:11 ` Theodore Tso
  2 siblings, 0 replies; 5+ messages in thread
From: Theodore Tso @ 2007-12-01 12:11 UTC (permalink / raw)
  To: linux-ext4

On Thu, Nov 08, 2007 at 06:20:15PM -0700, Andreas Dilger wrote:
> 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>

Thanks, applied.

						- Ted

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-01 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09  1:20 [PATCH] fix check_mntent_file() to pass mode for open(O_CREAT) Andreas Dilger
2007-11-09  3:30 ` Eric Sandeen
2007-11-09 20:22   ` Andreas Dilger
     [not found] ` <47503222.7020502@redhat.com>
2007-11-30 23:29   ` Theodore Tso
2007-12-01 12:11 ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).