OSDN Git Service

Made to ignore the -s ("sloppy") mount option
authorJean-Pierre André <jpandre@users.noreply.github.com>
Thu, 22 Jan 2015 07:42:43 +0000 (08:42 +0100)
committerJean-Pierre André <jpandre@users.noreply.github.com>
Thu, 22 Jan 2015 07:42:43 +0000 (08:42 +0100)
autofs passes the sloppy option to mount(8) for all file systems to mean
that mount should not choke on invalid options such as those meant for
remote mounting on another operating system through nfs or cifs.
Following a recent change, mount(8) passes the -s option on to any file
system, even to local ones (which are not expected to get foreign options),
so ntfs-3g now has to ignore -s.

src/ntfs-3g_common.c

index ed6b01a..38ccd74 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * ntfs-3g_common.c - Common definitions for ntfs-3g and lowntfs-3g.
  *
- * Copyright (c) 2010-2012 Jean-Pierre Andre
+ * Copyright (c) 2010-2015 Jean-Pierre Andre
  * Copyright (c) 2010      Erik Larsson
  *
  * This program/include file is free software; you can redistribute it and/or
@@ -555,7 +555,7 @@ int ntfs_parse_options(struct ntfs_options *popts, void (*usage)(void),
 {
        int c;
 
-       static const char *sopt = "-o:hnvV";
+       static const char *sopt = "-o:hnsvV";
        static const struct option lopt[] = {
                { "options",     required_argument,     NULL, 'o' },
                { "help",        no_argument,           NULL, 'h' },
@@ -609,6 +609,11 @@ int ntfs_parse_options(struct ntfs_options *popts, void (*usage)(void),
                         * no effect - automount passes it, meaning 'no-mtab'
                         */
                        break;
+               case 's':
+                       /*
+                        * no effect - automount passes it, meaning sloppy
+                        */
+                       break;
                case 'v':
                        /*
                         * We must handle the 'verbose' option even if