tags 476577 + patch
thanks

Hi,

Attached is a patch to fix this bug. I made it check if mtab was a
symlink and not try to write it. 

(Note that update_mtab(), which is called before the check on remount,
already contains a similar check of its own.)

-- 
see shy jo
diff -u nfs-utils-1.1.2/debian/changelog nfs-utils-1.1.2/debian/changelog
--- nfs-utils-1.1.2/debian/changelog
+++ nfs-utils-1.1.2/debian/changelog
@@ -1,3 +1,10 @@
+nfs-utils (1:1.1.2-2.1) UNRELEASED; urgency=low
+
+  * Avoid writing to or fchmodding /etc/mtab if it is a symlink.
+    Closes: #476577
+
+ -- Joey Hess <[EMAIL PROTECTED]>  Thu, 17 Apr 2008 15:30:49 -0400
+
 nfs-utils (1:1.1.2-2) unstable; urgency=low
 
   * Remove ${misc:Depends} from binary variables -- it is not used, and not
only in patch2:
unchanged:
--- nfs-utils-1.1.2.orig/utils/mount/mount.c
+++ nfs-utils-1.1.2/utils/mount/mount.c
@@ -257,6 +257,13 @@
 		return EX_SUCCESS;
 	}
 
+        /* Avoid writing if the mtab is a symlink to /proc/mounts, since
+	   that would create a file /proc/mounts in case the proc filesystem
+           is not mounted, and the fchmod below would also fail. */
+	if (! mtab_is_a_symlink())
+		return EX_SUCCESS;
+	}
+
 	lock_mtab();
 
 	mtab = nfs_setmntent(MOUNTED, "a+");

Attachment: signature.asc
Description: Digital signature

Reply via email to