aboutsummaryrefslogtreecommitdiffstats
path: root/extra/nfs-utils/nfs-utils-mtab-sym.patch
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2009-04-08 09:47:02 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2009-04-08 09:47:02 +0000
commita07d3df748a32c8f87161df1679a042f2f366a87 (patch)
tree14ce7d68b36ea7828d2db644a082ce4b419e4f9d /extra/nfs-utils/nfs-utils-mtab-sym.patch
parentd437587cbbab753a400f07c1f44106f79d279cf3 (diff)
downloadaports-a07d3df748a32c8f87161df1679a042f2f366a87.tar.gz
aports-a07d3df748a32c8f87161df1679a042f2f366a87.tar.bz2
aports-a07d3df748a32c8f87161df1679a042f2f366a87.tar.xz
extra/nfs-utils: new aport
Diffstat (limited to 'extra/nfs-utils/nfs-utils-mtab-sym.patch')
-rw-r--r--extra/nfs-utils/nfs-utils-mtab-sym.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/extra/nfs-utils/nfs-utils-mtab-sym.patch b/extra/nfs-utils/nfs-utils-mtab-sym.patch
new file mode 100644
index 0000000000..1ebbd99b57
--- /dev/null
+++ b/extra/nfs-utils/nfs-utils-mtab-sym.patch
@@ -0,0 +1,38 @@
+--- utils/mount/fstab.c
++++ utils/mount/fstab.c
+@@ -57,7 +57,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;
+--- utils/mount/fstab.h
++++ 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);
+ void reset_mtab_info(void);
+--- utils/mount/mount.c
++++ utils/mount/mount.c
+@@ -230,6 +230,13 @@ create_mtab (void) {
+ int flags;
+ mntFILE *mfp;
+
++ /* 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();
+
+ mfp = nfs_setmntent (MOUNTED, "a+");
+