Hi, all! I like to keep a Kali Docker container around for quick and easy access to the Kali tools without having to dual-boot or run a VM. Normally, I create this container like so:
Code:
docker run -it --name kali --privileged=true --network host kalilinux/kali-rolling
However, today I discovered that I'm getting a weird permissions error when running the man command:
Code:
root@desktop:~(kali)# man
man: error while loading shared libraries: libmandb-2.9.1.so: cannot open shared object file: Permission denied
Investigating further, I discovered that it's actually the fact that the container is running with privileged=true that's the problem, which makes absolutely no sense to me.

The problem is easily reproduced:

Works fine:
Code:
docker run -it --network host --rm kalilinux/kali-rolling
root@desktop:/# apt update && apt -y install man-db && man
<...a bunch of apt output...>
What manual page do you want?
For example, try 'man man'.
(Those last two lines are exactly what you'd expect when issuing the man command with no arguments)

Fails:
Code:
docker run -it --privileged=true --network host  --rm kalilinux/kali-rolling
root@desktop:/# apt update && apt -y install man-db && man
<...a bunch of apt output...>
man: error while loading shared libraries: libmandb-2.9.1.so: cannot open shared object file: Permission denied
I don't even remember why I ended up running my Kali container in privileged mode - something I was using didn't work without some capability, and I just sledgehammered the problem by running in privileged mode rather than using --cap-add because of course I did. I thought maybe it was some low-level networking thing like nmap or masscan, but those both seem to run fine in unprivileged mode.

Anyway, the point is, this man page makes no sense. I'm running as root, the permissions on the file and directories in question are all fine, I've tried updating all packages with apt -y dist-upgrade, yet here we are. Anyone have any ideas?