]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mountpoint_get(): Skip rootfs mounts with Linux.
authorTimo Sirainen <tss@iki.fi>
Mon, 9 Aug 2010 16:35:08 +0000 (17:35 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 9 Aug 2010 16:35:08 +0000 (17:35 +0100)
Fixes fs quota for such systems. Patch by Patrick McLean.

src/lib/mountpoint.c

index f0ddeb6e8733de1adc8b3d9e97fc3307e9c0ae9d..16614faeb4c435a0760011b131f7ac9ae3156ad5 100644 (file)
 #  define MNTTYPE_NFS "nfs"
 #endif
 
+/* Linux sometimes has mtab entry for "rootfs" as well as the real root
+   entry. Skip the rootfs. */
+#ifndef MNTTYPE_ROOTFS
+#  define MNTTYPE_ROOTFS "rootfs"
+#endif
 
 int mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r)
 {
@@ -191,7 +196,8 @@ int mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r)
        }
        while ((ent = getmntent(f)) != NULL) {
                if (strcmp(ent->mnt_type, MNTTYPE_SWAP) == 0 ||
-                   strcmp(ent->mnt_type, MNTTYPE_IGNORE) == 0)
+                   strcmp(ent->mnt_type, MNTTYPE_IGNORE) == 0 ||
+                   strcmp(ent->mnt_type, MNTTYPE_ROOTFS) == 0)
                        continue;
 
                if (stat(ent->mnt_dir, &st2) == 0 &&