public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy White <jwhite@codeweavers.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: isofs unhide option:  troubles with Wine
Date: Tue, 18 Jun 2002 21:36:25 -0500	[thread overview]
Message-ID: <3D0FEE29.7030509@codeweavers.com> (raw)
In-Reply-To: 1023150198.23878.93.camel@irongate.swansea.linux.org.uk

[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]

Sorry for the long delay; had to take the kids to Disney World <grin>.

I'm attaching two patches, both against 2.5.20.  Please be gentle,
I'm a kernel newbie.

Patch #1:  bugfix.patch
    Fixes a bug in the parsing of options for the isofs driver.
    Behavior was on an unrecognized option to simply return success.
     A mount -o blatnik,<useful-option>,<useful-option>  
          would silently lose all the useful options.

    This should be applied, imho, regardless.



Patch #2:  reversehide.patch
    I've eliminated the 'unhide' option and made that behavior
        the default (show files with the hidden bit on).
    I've added a 'hide' option which hides files marked with the hidden bit.
    I've also preserved the behavior which hid 'associated' files by 
default,
        and added a 'showassoc' mount option, which will cause the
        driver to show files marked with the associated bit.
        (The prior behavior was that unhide would show both
          hidden and associated files)

    Issues:
        1.  I have no CDs with associated files on them, and thus
             this change is completely untested.  Looks good to me <g>.
        2. Arguably, this same change should be made to the udf
            driver, but I do not have a DVD writer, nor a DVD with
            either hidden or associated files, so I would be unable
            to test any such patch made.  I'm willing to submit a
            patch that compiles, if that would be of value.

Thanks,

Jeremy

Alan Cox wrote:

>On Mon, 2002-06-03 at 18:05, Jeremy White wrote:
>  
>
>>>possible rather than impossible. Question is - why was hide the default
>>>and what was that decision based upon ?
>>>      
>>>
>>I agree with Alan - this is the key question.  
>>
>>I would further argue that silence in response to this question
>>suggests that there was no carefully considered reason;
>>presumably a good hacker just followed the spec, without considering how
>>these CDs are actually used.
>>
>>It further suggests to me that I should prep a patch.
>>    
>>
>
>Go for it. I'll give it a test in the -ac tree happily. If nobody
>screams it can then go upstream.
>  
>



[-- Attachment #2: bugfix.patch --]
[-- Type: text/plain, Size: 211 bytes --]

--- orig/fs/isofs/inode.c	Sun Jun  2 20:44:53 2002
+++ linux-2.5.20/fs/isofs/inode.c	Tue Jun 18 21:12:29 2002
@@ -460,7 +460,7 @@
 		    break;
 		  }
 		}
-		else return 1;
+		else return 0;
 	}
 	return 1;
 }

[-- Attachment #3: reversehide.patch --]
[-- Type: text/plain, Size: 4433 bytes --]

diff -ur orig/Documentation/filesystems/isofs.txt linux-2.5.20/Documentation/filesystems/isofs.txt
--- orig/Documentation/filesystems/isofs.txt	Sun Jun  2 20:44:42 2002
+++ linux-2.5.20/Documentation/filesystems/isofs.txt	Mon Jun 17 20:58:06 2002
@@ -26,6 +26,7 @@
   mode=xxx      Sets the permissions on files to xxx
   nojoliet      Ignore Joliet extensions if they are present.
   norock        Ignore Rock Ridge extensions if they are present.
-  unhide        Show hidden files.
+  hide          Completely strip hidden files from the file system.
+  showassoc     Show files marked with the 'associated' bit
   session=x     Select number of session on multisession CD
   sbsector=xxx  Session begins from sector xxx
diff -ur orig/fs/isofs/dir.c linux-2.5.20/fs/isofs/dir.c
--- orig/fs/isofs/dir.c	Sun Jun  2 20:44:45 2002
+++ linux-2.5.20/fs/isofs/dir.c	Mon Jun 17 21:35:53 2002
@@ -194,12 +194,12 @@
 
 		/* Handle everything else.  Do name translation if there
 		   is no Rock Ridge NM field. */
-		if (sbi->s_unhide == 'n') {
-			/* Do not report hidden or associated files */
-			if (de->flags[-sbi->s_high_sierra] & 5) {
-				filp->f_pos += de_len;
-				continue;
-			}
+
+		/* Do not report hidden files if so instructed, or associated files unless instructed to do so */
+                if (  ( sbi->s_hide =='y' && (de->flags[-sbi->s_high_sierra] & 1) ) ||
+                      ( sbi->s_showassoc =='n' && (de->flags[-sbi->s_high_sierra] & 4) ) ) {
+                        filp->f_pos += de_len;
+                        continue;
 		}
 
 		map = 1;
diff -ur orig/fs/isofs/inode.c linux-2.5.20/fs/isofs/inode.c
--- orig/fs/isofs/inode.c	Sun Jun  2 20:44:53 2002
+++ linux-2.5.20/fs/isofs/inode.c	Tue Jun 18 21:14:08 2002
@@ -172,7 +172,8 @@
 	char rock;
 	char joliet;
 	char cruft;
-	char unhide;
+	char hide;
+	char showassoc;
 	char nocompress;
 	unsigned char check;
 	unsigned int blocksize;
@@ -341,7 +342,8 @@
 	popt->rock = 'y';
 	popt->joliet = 'y';
 	popt->cruft = 'n';
-	popt->unhide = 'n';
+	popt->hide = 'n';
+	popt->showassoc = 'n';
 	popt->check = 'u';		/* unset */
 	popt->nocompress = 0;
 	popt->blocksize = 1024;
@@ -367,8 +369,12 @@
 		  popt->joliet = 'n';
 		  continue;
 		}
-	        if (strncmp(this_char,"unhide",6) == 0) {
-		  popt->unhide = 'y';
+	        if (strncmp(this_char,"hide",4) == 0) {
+		  popt->hide = 'y';
+		  continue;
+		}
+	        if (strncmp(this_char,"showassoc",9) == 0) {
+		  popt->showassoc= 'y';
 		  continue;
 		}
 	        if (strncmp(this_char,"cruft",5) == 0) {
@@ -562,7 +568,8 @@
 	printk("joliet = %c\n", opt.joliet);
 	printk("check = %c\n", opt.check);
 	printk("cruft = %c\n", opt.cruft);
-	printk("unhide = %c\n", opt.unhide);
+	printk("hide = %c\n", opt.hide);
+	printk("showassoc= %c\n", opt.showassoc);
 	printk("blocksize = %d\n", opt.blocksize);
 	printk("gid = %d\n", opt.gid);
 	printk("uid = %d\n", opt.uid);
@@ -806,7 +813,8 @@
 	sbi->s_rock = (opt.rock == 'y' ? 2 : 0);
 	sbi->s_rock_offset = -1; /* initial offset, will guess until SP is found*/
 	sbi->s_cruft = opt.cruft;
-	sbi->s_unhide = opt.unhide;
+	sbi->s_hide = opt.hide;
+	sbi->s_showassoc = opt.showassoc;
 	sbi->s_uid = opt.uid;
 	sbi->s_gid = opt.gid;
 	sbi->s_utf8 = opt.utf8;
diff -ur orig/fs/isofs/namei.c linux-2.5.20/fs/isofs/namei.c
--- orig/fs/isofs/namei.c	Sun Jun  2 20:44:52 2002
+++ linux-2.5.20/fs/isofs/namei.c	Mon Jun 17 21:16:08 2002
@@ -140,12 +140,12 @@
 		}
 
 		/*
-		 * Skip hidden or associated files unless unhide is set 
+		 * Skip hidden or associated files unless hide or showassoc, respectively, is set 
 		 */
 		match = 0;
 		if (dlen > 0 &&
-		    (!(de->flags[-sbi->s_high_sierra] & 5)
-		     || sbi->s_unhide == 'y'))
+                    ( sbi->s_hide =='n' || (!(de->flags[-sbi->s_high_sierra] & 1)) ) &&
+                    ( sbi->s_showassoc =='y' || (!(de->flags[-sbi->s_high_sierra] & 4)) ) )
 		{
 			match = (isofs_cmp(dentry,dpnt,dlen) == 0);
 		}
diff -ur orig/include/linux/iso_fs_sb.h linux-2.5.20/include/linux/iso_fs_sb.h
--- orig/include/linux/iso_fs_sb.h	Sun Jun  2 20:44:50 2002
+++ linux-2.5.20/include/linux/iso_fs_sb.h	Mon Jun 17 20:57:47 2002
@@ -20,7 +20,8 @@
 	unsigned char s_cruft; /* Broken disks with high
 				  byte of length containing
 				  junk */
-	unsigned char s_unhide;
+	unsigned char s_hide;
+	unsigned char s_showassoc;
 	unsigned char s_nosuid;
 	unsigned char s_nodev;
 	unsigned char s_nocompress;

  reply	other threads:[~2002-06-19  2:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-25  4:30 isofs unhide option: troubles with Wine Jeremy White
2002-05-25 13:46 ` Olaf Dietsche
2002-05-25 13:49   ` Jeremy White
2002-05-25 14:01     ` Joseph Mathewson
2002-05-25 14:23       ` Jeremy White
2002-06-10  3:12       ` Francois Gouget
2002-06-10 11:52         ` Thunder from the hill
2002-06-10 12:38           ` Guest section DW
2002-05-25 15:50     ` Alan Cox
2002-06-03 17:05       ` Jeremy White
2002-06-03 18:06         ` Thunder from the hill
2002-06-03 18:40           ` H. Peter Anvin
2002-06-03 19:40             ` Thunder from the hill
2002-06-03 19:43               ` H. Peter Anvin
2002-06-04  0:23         ` Alan Cox
2002-06-19  2:36           ` Jeremy White [this message]
2002-05-25 14:18 ` Ruth Ivimey-Cook
2002-05-25 14:25   ` Jeremy White
2002-05-25 19:31   ` H. Peter Anvin
2002-05-25 19:40 ` Linus Torvalds
2002-05-25 20:31   ` H. Peter Anvin
2002-05-25 21:20     ` Lionel Bouton
2002-05-25 21:51       ` H. Peter Anvin
2002-05-25 21:07 ` Lionel Bouton
  -- strict thread matches above, loose matches on Subject: below --
2002-05-25 17:04 Andries.Brouwer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D0FEE29.7030509@codeweavers.com \
    --to=jwhite@codeweavers.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox