From: Jonathan Woithe <jwoithe@just42.net>
To: linux-nfs@vger.kernel.org
Subject: Umount fails for NFS mounts with "users" or "user" options
Date: Sat, 8 May 2021 12:30:34 +0930 [thread overview]
Message-ID: <20210508030034.GA30593@marvin.atrad.com.au> (raw)
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
reply other threads:[~2021-05-08 3:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210508030034.GA30593@marvin.atrad.com.au \
--to=jwoithe@just42.net \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox