linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Umount fails for NFS mounts with "users" or "user" options
@ 2021-05-08  3:00 Jonathan Woithe
  0 siblings, 0 replies; only message in thread
From: Jonathan Woithe @ 2021-05-08  3:00 UTC (permalink / raw)
  To: linux-nfs

Hi all

When /etc/mtab is a symlink to /proc/mounts, users are still able to mount
NFS volumes listed in /etc/fstab with the "user" or "users" option. 
However, attempting to unmount the same volume fails:

  umount.nfs: You are not permitted to unmount <mount-point>

The /etc/fstab entry is

  nfssvr:/home/export  /home/export  nfs  users,noauto,hard,bg,intr

The kernel doesn't track the "user" or "users" options so they don't appear
in /proc/mounts, and thus in /etc/mtab when the latter is a link to the
former.  However, when /etc/mtab is an ordinary file nfs.mount adds the
"user" or "users" option to the entry (fix_opts_string() in
utils/mount/mount.c) so the flag is available when /etc/mtab is consulted at
unmount time.

The util-linux mount tools must track the "user" and "users" options in
their own way since mounts which use those tools with these flags work fine.
I haven't quite determined where it does this: I thought it might be
/run/mount/utab, but that file isn't created on my system (Slackware64
/current) and yet user mounts still generally work.

What is the recommended way to unmount NFS volumes which are permitted to be
mounted by users via the "user" and "users" options?  The only way I can
think of is a very careful sudo entry.  It would be good though if nfs
unmount could work with the "user" and "users" options just like mount does.

Regards
  jonathan

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-08  3:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  3:00 Umount fails for NFS mounts with "users" or "user" options Jonathan Woithe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).