mountlist: recognize autofs-mounted remote file systems, too
authorKamil Dudka <kdudka@redhat.com>
Fri, 19 Feb 2016 09:41:49 +0000 (10:41 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 20 Feb 2016 01:51:44 +0000 (17:51 -0800)
Originally reported at: https://bugzilla.redhat.com/1309247
* lib/mountlist.c (ME_REMOTE): Return true if a file system is named
"-hosts" because it is used by autofs to mount remote file systems.

ChangeLog
lib/mountlist.c

index 6cadc2dda00869d52fba20fa47157b40b8655651..7e06adf12ac72f4e1ce72d9372b361a530780a7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-19  Kamil Dudka  <kdudka@redhat.com>
+
+       mountlist: recognize autofs-mounted remote file systems, too
+       Originally reported at: https://bugzilla.redhat.com/1309247
+       * lib/mountlist.c (ME_REMOTE): Return true if a file system is named
+       "-hosts" because it is used by autofs to mount remote file systems.
+
 2016-02-19  Paul Eggert  <eggert@cs.ucla.edu>
 
        signbit: port to C++ with GCC 6
index 829b31d0d864e17c4adf3058ab9bd91ce5a2f3d1..bb4e4ee210978cd0dbfe6c50f49dae943634fe7d 100644 (file)
@@ -217,13 +217,15 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
 
 #ifndef ME_REMOTE
 /* A file system is "remote" if its Fs_name contains a ':'
-   or if (it is of type (smbfs or cifs) and its Fs_name starts with '//').  */
+   or if (it is of type (smbfs or cifs) and its Fs_name starts with '//')
+   or Fs_name is equal to "-hosts" (used by autofs to mount remote fs).  */
 # define ME_REMOTE(Fs_name, Fs_type)            \
     (strchr (Fs_name, ':') != NULL              \
      || ((Fs_name)[0] == '/'                    \
          && (Fs_name)[1] == '/'                 \
          && (strcmp (Fs_type, "smbfs") == 0     \
-             || strcmp (Fs_type, "cifs") == 0)))
+             || strcmp (Fs_type, "cifs") == 0)) \
+     || (strcmp("-hosts", Fs_name) == 0))
 #endif
 
 #if MOUNTED_GETMNTINFO