linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] isofs: add +w bit for non-RR discs
@ 2007-10-02 18:00 Jan Engelhardt
  2007-10-05  2:46 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2007-10-02 18:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List, linux-fsdevel


Add %S_IWUGO bit for files on ISO-9660 filesystems without RockRidge
extensions. This allows one to modify the files right after copying,
without having to do an extra recursive chmod if `cp -p` or
`rsync -p` is used.

References: http://lkml.org/lkml/2007/4/1/164
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>

---
 fs/isofs/inode.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Index: linux-2.6.23/fs/isofs/inode.c
===================================================================
--- linux-2.6.23.orig/fs/isofs/inode.c
+++ linux-2.6.23/fs/isofs/inode.c
@@ -360,12 +360,11 @@ static int parse_options(char *options, 
 	popt->check = 'u';		/* unset */
 	popt->nocompress = 0;
 	popt->blocksize = 1024;
-	popt->mode = S_IRUGO | S_IXUGO; /*
-					 * r-x for all.  The disc could
-					 * be shared with DOS machines so
-					 * virtually anything could be
-					 * a valid executable.
-					 */
+	/*
+	 * +x bit for all. The disc could be shared with DOS machine, so
+	 * virtually anything could be a valid executable.
+	 */
+	popt->mode = S_IRUGO | S_IWUSR | S_IXUGO;
 	popt->gid = 0;
 	popt->uid = 0;
 	popt->iocharset = NULL;
@@ -1235,7 +1234,7 @@ static void isofs_read_inode(struct inod
 	ei->i_file_format = isofs_file_normal;
 
 	if (de->flags[-high_sierra] & 2) {
-		inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
+		inode->i_mode = S_IRUGO | S_IWUSR | S_IXUGO | S_IFDIR;
 		inode->i_nlink = 1;	/*
 					 * Set to 1.  We know there are 2, but
 					 * the find utility tries to optimize

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

* Re: [PATCH] isofs: add +w bit for non-RR discs
  2007-10-02 18:00 [PATCH] isofs: add +w bit for non-RR discs Jan Engelhardt
@ 2007-10-05  2:46 ` Matthew Wilcox
  2007-10-05 11:59   ` Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2007-10-05  2:46 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Andrew Morton, Linux Kernel Mailing List, linux-fsdevel

On Tue, Oct 02, 2007 at 08:00:26PM +0200, Jan Engelhardt wrote:
> Add %S_IWUGO bit for files on ISO-9660 filesystems without RockRidge

Looks to me like you've added S_IWUSR, not S_IWUGO.

> -	popt->mode = S_IRUGO | S_IXUGO; /*
> +	popt->mode = S_IRUGO | S_IWUSR | S_IXUGO;
> -		inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
> +		inode->i_mode = S_IRUGO | S_IWUSR | S_IXUGO | S_IFDIR;

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

* Re: [PATCH] isofs: add +w bit for non-RR discs
  2007-10-05  2:46 ` Matthew Wilcox
@ 2007-10-05 11:59   ` Jan Engelhardt
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2007-10-05 11:59 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Andrew Morton, Linux Kernel Mailing List, linux-fsdevel


On Oct 4 2007 20:46, Matthew Wilcox wrote:
>On Tue, Oct 02, 2007 at 08:00:26PM +0200, Jan Engelhardt wrote:
>> Add %S_IWUGO bit for files on ISO-9660 filesystems without RockRidge
>
>Looks to me like you've added S_IWUSR, not S_IWUGO.

Yes, S_IWUSR it should be, and is. When a user copies such a file,
the new file will be owned by him/her, so the +w bit needs to
be S_IWUSR indeed.

>> -	popt->mode = S_IRUGO | S_IXUGO; /*
>> +	popt->mode = S_IRUGO | S_IWUSR | S_IXUGO;
>> -		inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
>> +		inode->i_mode = S_IRUGO | S_IWUSR | S_IXUGO | S_IFDIR;
>

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

end of thread, other threads:[~2007-10-05 11:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-02 18:00 [PATCH] isofs: add +w bit for non-RR discs Jan Engelhardt
2007-10-05  2:46 ` Matthew Wilcox
2007-10-05 11:59   ` Jan Engelhardt

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