[PC-BSD Commits] r3781 - in pcbsd: branches/7.1/system-overlay/sbin trunk/system-overlay/sbin

svn at pcbsd.org svn at pcbsd.org
Thu Apr 9 10:59:26 PDT 2009


Author: kris
Date: 2009-04-09 10:59:25 -0700 (Thu, 09 Apr 2009)
New Revision: 3781

Modified:
   pcbsd/branches/7.1/system-overlay/sbin/mount_ntfs
   pcbsd/trunk/system-overlay/sbin/mount_ntfs
Log:

Further update to previous. Improve mount_ntfs even more, to ignore all possible bad flags which may work for mount_ntfs, but not ntfs-3g and add support for -g gid= flag. 



Modified: pcbsd/branches/7.1/system-overlay/sbin/mount_ntfs
===================================================================
--- pcbsd/branches/7.1/system-overlay/sbin/mount_ntfs	2009-04-09 16:39:55 UTC (rev 3780)
+++ pcbsd/branches/7.1/system-overlay/sbin/mount_ntfs	2009-04-09 17:59:25 UTC (rev 3781)
@@ -18,7 +18,8 @@
 OPTIONS=""
 FOUNDOPT="0"
 FOUNDU="0"
-FOUNDC="0"
+FOUNDG="0"
+FOUNDBADARG="0"
 HWDEV=""
 FOUNDDEV="0"
 
@@ -30,10 +31,13 @@
     elif [ "${FOUNDU}" = "1" ]
     then
         OPTIONS="${OPTIONS} -o uid=${i}"
-    elif [ "${FOUNDC}" = "1" ]
+    elif [ "${FOUNDG}" = "1" ]
     then
-        # We have a -C flag, so ignore it and following argument
-        FOUNDC="0"
+        OPTIONS="${OPTIONS} -o gid=${i}"
+    elif [ "${FOUNDBADARG}" = "1" ]
+    then
+        # We have an invalid argument flag, so ignore it and following argument
+        FOUNDBADARG="0"
     else
 
        if [ "${FOUNDDEV}" = "1" ]
@@ -68,15 +72,15 @@
             fi
         fi
 
-        # Add the value to our mount string
-        if [ "${i}" != "-o" -a "${i}" != "-u" -a "${i}" != "-C" ]
+        # Add the value to our mount string if it isn't any invalid flag
+        if [ "${i}" != "-o" -a "${i}" != "-u" -a "${i}" != "-C" -a "${i}" != "-g" -a "${i}" != "-m" -a "${i}" != "-a" -a "${i}" != "-i" -a "${i}" -a "-W" ]
         then
           MNTSTRING="${MNTSTRING} ${i}"
         fi
 
     fi
 
-    # Check if we are on a -u flag now
+    # Check if we are on a -u user id flag now
     if [ "${i}" = "-u" ]
     then
        FOUNDU="1"
@@ -84,6 +88,14 @@
        FOUNDU="0"
     fi
 
+    # Check if we are on a -g group id flag now
+    if [ "${i}" = "-g" ]
+    then
+       FOUNDG="1"
+    else
+       FOUNDG="0"
+    fi
+
     # Check if we are on a -o option
     if [ "${i}" = "-o" ]
     then
@@ -92,19 +104,18 @@
        FOUNDOPT="0"
     fi
 
-    # Check if we are on a -C flag now
-    if [ "${i}" = "-C" ]
+    # Check if we are on some other invalid flag
+    if [ "${i}" = "-C" -o "${i}" = "-m" -o "${i}" = "-W" ]
     then
-       FOUNDC="1"
+       FOUNDBADARG="1"
     else
-       FOUNDC="0"
+       FOUNDBADARG="0"
     fi
 done
 
 # Save our final string which our FUSE helper will use
 FINALSTRING="${MNTSTRING} ${OPTIONS}"
 
-
 # Check that fuse.ko is loaded
 kldstat | grep -q fuse 2>/dev/null
 if [ "$?" != "0" ]

Modified: pcbsd/trunk/system-overlay/sbin/mount_ntfs
===================================================================
--- pcbsd/trunk/system-overlay/sbin/mount_ntfs	2009-04-09 16:39:55 UTC (rev 3780)
+++ pcbsd/trunk/system-overlay/sbin/mount_ntfs	2009-04-09 17:59:25 UTC (rev 3781)
@@ -18,7 +18,8 @@
 OPTIONS=""
 FOUNDOPT="0"
 FOUNDU="0"
-FOUNDC="0"
+FOUNDG="0"
+FOUNDBADARG="0"
 HWDEV=""
 FOUNDDEV="0"
 
@@ -30,10 +31,13 @@
     elif [ "${FOUNDU}" = "1" ]
     then
         OPTIONS="${OPTIONS} -o uid=${i}"
-    elif [ "${FOUNDC}" = "1" ]
+    elif [ "${FOUNDG}" = "1" ]
     then
-        # We have a -C flag, so ignore it and following argument
-        FOUNDC="0"
+        OPTIONS="${OPTIONS} -o gid=${i}"
+    elif [ "${FOUNDBADARG}" = "1" ]
+    then
+        # We have an invalid argument flag, so ignore it and following argument
+        FOUNDBADARG="0"
     else
 
        if [ "${FOUNDDEV}" = "1" ]
@@ -68,15 +72,15 @@
             fi
         fi
 
-        # Add the value to our mount string
-        if [ "${i}" != "-o" -a "${i}" != "-u" -a "${i}" != "-C" ]
+        # Add the value to our mount string if it isn't any invalid flag
+        if [ "${i}" != "-o" -a "${i}" != "-u" -a "${i}" != "-C" -a "${i}" != "-g" -a "${i}" != "-m" -a "${i}" != "-a" -a "${i}" != "-i" -a "${i}" -a "-W" ]
         then
           MNTSTRING="${MNTSTRING} ${i}"
         fi
 
     fi
 
-    # Check if we are on a -u flag now
+    # Check if we are on a -u user id flag now
     if [ "${i}" = "-u" ]
     then
        FOUNDU="1"
@@ -84,6 +88,14 @@
        FOUNDU="0"
     fi
 
+    # Check if we are on a -g group id flag now
+    if [ "${i}" = "-g" ]
+    then
+       FOUNDG="1"
+    else
+       FOUNDG="0"
+    fi
+
     # Check if we are on a -o option
     if [ "${i}" = "-o" ]
     then
@@ -92,19 +104,18 @@
        FOUNDOPT="0"
     fi
 
-    # Check if we are on a -C flag now
-    if [ "${i}" = "-C" ]
+    # Check if we are on some other invalid flag
+    if [ "${i}" = "-C" -o "${i}" = "-m" -o "${i}" = "-W" ]
     then
-       FOUNDC="1"
+       FOUNDBADARG="1"
     else
-       FOUNDC="0"
+       FOUNDBADARG="0"
     fi
 done
 
 # Save our final string which our FUSE helper will use
 FINALSTRING="${MNTSTRING} ${OPTIONS}"
 
-
 # Check that fuse.ko is loaded
 kldstat | grep -q fuse 2>/dev/null
 if [ "$?" != "0" ]



More information about the Commits mailing list