util-linux/libmount
Tycho Andersen 64cb2da8dc libmount: do not unnecessarily chmod utab.lock
Before ecfeae90a2 ("libmount: Ensure utab.lock mode 644"), you could do
something like:

irc:/tmp umount --version
umount from util-linux 2.27.1 (libmount 2.27.0: selinux, assert, debug)
irc:/tmp mkdir foo bar
irc:/tmp unshare -Urm
irc:/tmp mount --bind foo bar
irc:/tmp umount bar
irc:/tmp echo $?
0

However, afterwards, you get:

/tmp unshare -Urm
/tmp mount --bind foo bar
/tmp umount bar
umount: /tmp/bar: filesystem was unmounted, but failed to update userspace mount table.

Because of the chmod failing:

fchmod(3, 0644)                         = -1 EPERM (Operation not permitted)

Let's figure out whether the chmod is necessary before doing it, and only
do it if it is necessary. This won't fix cases where the system is already
broken, but at least on healthy systems umount will behave as before.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2020-04-22 12:36:43 +02:00
..
docs libmount: add support for signed verity devices 2020-01-13 12:24:55 +00:00
python Merge branch 'clang' of https://github.com/neheb/util-linux 2020-04-22 10:07:51 +02:00
src libmount: do not unnecessarily chmod utab.lock 2020-04-22 12:36:43 +02:00
COPYING docs: use SPDX license names 2018-08-16 14:47:21 +02:00
Makemodule.am build-sys: add pylibmount 2013-08-19 14:57:21 +02:00
mount.pc.in libmount: add support for verity devices via libcryptsetup 2019-12-05 10:39:21 +00:00