Inaccurate error message:'mount: only root can do that'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Even when mount is not installed as root, setuid bit is still set.
ls -n tools_i486/bin/mount
-rwsr-xr-x 1 1000 1000 56232 sep 28 23:35 tools_i486/bin/mount

When later, trying to use that mount as root inside a chroot

[chroot-i486] root:/$ whoami
root
[chroot-i486] root:/$ mkdir -p /dev1
[chroot-i486] root:/$ mount --move /dev /dev1
mount: only root can do that

Removing setuid bit or changing mount to be root owned let mount work.
But that's a bit troublesome when you are root to have a message 'only root
can do that'.

This happen in 1.16.1.
I haven't tested in previous version. Or more exactly, previous version has
been tested with a mount compiled and include in a tar.gz. And tar remove
setuid bit silently unless commended not to do so, so the problem did not
appear earlier.

That may appear strange not to install mount as root. But that's the
recommended way to build a toolchain a la LFS/DIY, a bit safer for the
running OS if you make a mistake compiling a key program like glibc.

I don't know what the best fix is.
Maybe remove setuid bit when not installed as root?
Or change the error message?


Gilles

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux