X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpatches%2F03-handle-mtab-symlink.patch;fp=debian%2Fpatches%2F03-handle-mtab-symlink.patch;h=28211a56138cd2beb71c9d32b90dee072c4fed97;hb=17ef4d25b6b54769e2909c0d37469cb60c338027;hp=0000000000000000000000000000000000000000;hpb=c6712b71e259e01fbc46f8d64ab9b2b914c8f934;p=nfs-utils.git diff --git a/debian/patches/03-handle-mtab-symlink.patch b/debian/patches/03-handle-mtab-symlink.patch new file mode 100644 index 0000000..28211a5 --- /dev/null +++ b/debian/patches/03-handle-mtab-symlink.patch @@ -0,0 +1,43 @@ +Index: nfs-utils-1.1.2/utils/mount/fstab.c +=================================================================== +--- nfs-utils-1.1.2.orig/utils/mount/fstab.c ++++ nfs-utils-1.1.2/utils/mount/fstab.c +@@ -52,7 +52,7 @@ mtab_does_not_exist(void) { + return var_mtab_does_not_exist; + } + +-static int ++int + mtab_is_a_symlink(void) { + get_mtab_info(); + return var_mtab_is_a_symlink; +Index: nfs-utils-1.1.2/utils/mount/fstab.h +=================================================================== +--- nfs-utils-1.1.2.orig/utils/mount/fstab.h ++++ nfs-utils-1.1.2/utils/mount/fstab.h +@@ -7,6 +7,7 @@ + #define _PATH_FSTAB "/etc/fstab" + #endif + ++int mtab_is_a_symlink(void); + int mtab_is_writable(void); + int mtab_does_not_exist(void); + +Index: nfs-utils-1.1.2/utils/mount/mount.c +=================================================================== +--- nfs-utils-1.1.2.orig/utils/mount/mount.c ++++ nfs-utils-1.1.2/utils/mount/mount.c +@@ -257,6 +257,13 @@ static int add_mtab(char *spec, char *mo + 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+");