X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fmount.c;fp=utils%2Fmount%2Fmount.c;h=cc078eba336db7f47ad7bae1a5e9f6826ec0a973;hp=eea00afe2679f28e3e4f10ea11c0553f5f51f712;hb=aa1ff2ec590192c168c888a60f5c918143890570;hpb=4cbe8e72c103202ca01275ed6b128c8610a5a5bd diff --git a/utils/mount/mount.c b/utils/mount/mount.c index eea00af..cc078eb 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -203,6 +203,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+");