www-client/w3m: remove
[sgilles-overlay.git] / net-fs / nfs-utils / files / nfs-utils-1.1.4-mtab-sym.patch
blobc9e60afc74d2b8c7d152c91372075a7a196981cc
1 ripped from Debian
3 --- nfs-utils-1.1.4/utils/mount/fstab.c
4 +++ nfs-utils-1.1.4/utils/mount/fstab.c
5 @@ -57,7 +57,7 @@ mtab_does_not_exist(void) {
6 return var_mtab_does_not_exist;
9 -static int
10 +int
11 mtab_is_a_symlink(void) {
12 get_mtab_info();
13 return var_mtab_is_a_symlink;
14 --- nfs-utils-1.1.4/utils/mount/fstab.h
15 +++ nfs-utils-1.1.4/utils/mount/fstab.h
16 @@ -7,6 +7,7 @@
17 #define _PATH_FSTAB "/etc/fstab"
18 #endif
20 +int mtab_is_a_symlink(void);
21 int mtab_is_writable(void);
22 int mtab_does_not_exist(void);
23 void reset_mtab_info(void);
24 --- nfs-utils-1.1.4/utils/mount/mount.c
25 +++ nfs-utils-1.1.4/utils/mount/mount.c
26 @@ -230,6 +230,13 @@ create_mtab (void) {
27 int flags;
28 mntFILE *mfp;
30 + /* Avoid writing if the mtab is a symlink to /proc/mounts, since
31 + that would create a file /proc/mounts in case the proc filesystem
32 + is not mounted, and the fchmod below would also fail. */
33 + if (mtab_is_a_symlink()) {
34 + return EX_SUCCESS;
35 + }
37 lock_mtab();
39 mfp = nfs_setmntent (MOUNTED, "a+");