Allow the use of '--' (captive) vs. non-'--' (lufs) options.
authorshort <>
Mon, 27 Oct 2003 06:36:43 +0000 (06:36 +0000)
committershort <>
Mon, 27 Oct 2003 06:36:43 +0000 (06:36 +0000)
 - Requested by Javier Urien for uid/gid/fmask/dmask.

src/client/lufs/mount.captive.in

index a17b5eb..b01ba33 100755 (executable)
@@ -83,24 +83,27 @@ if ($fsname eq "ntfs") {
        }
 
 
-# Double-dashes are generally optional here.
-# Convert ',' to ';' to prevent its parsing by LUFS to keep its ordering
+# Keep @opt_captive ordering
 # to let the options be overridable by user (such as 'ro').
-$oo=";$oo;";
-$oo=~tr/,/;/;
-$oo=~s/;(ro|rw);/;--$1;/g;
-$oo=~s/;(?:no)?auto;/;/g;      # ignore
+my @opt_captive=();
+my @opt_lufs=();
+for (split /,/,$oo) {
+       $_="--$_" if $_ eq "ro" || $_ eq "rw";
+       push @opt_captive,$_ if  /^--/;
+       push @opt_lufs,$_    if !/^--/;
+       }
 $oo=""
                ."mntent.mnt_fsname=$image,mntent.mnt_type=captive-$fsname,"    # Double-dashes forbidden.
                ."dir_cache_entries=0,"
                ."image=$image,"
+               .join(",",@opt_lufs).","
                ."captive_options="
                                .($fsname eq "cdfs" ? "--cdrom;--ro;" : "--disk;--rw;")
                                ."--load-module=$ntoskrnl;--filesystem=$filesystem;"
                                ."--sandbox-server=$captive_sandbox_server_bin;"
                                ."--bug-pathname=$vardir/bug-%FT%T.captivebug.xml.gz;"
                                ."--syslog;"
-                               .$oo;
+                               .join(";",@opt_captive);
 
 warn "$0: '-n' not supported - ignored" if $nomtab;