anyone seen this prob? root can't read manpages?
I ran into this some time ago, and thought it was solved, but am having probs looking up manpages while running as root: Ishtar:/Media/Library> cd Ishtar:law> sudo man ls No manual entry for ls Ishtar:law> man ls |wc # really is there! 241 925 7864 Ishtar:law> sudo man -w ls No manual entry for ls Ishtar:law> man -w ls /usr/share/man/man1/ls.1.gz Ishtar:law> llg /usr/share/man/man1/ls.1.gz -rwxrwsr-x 1 man man 3112 Mar 2 2015 /usr/share/man/man1/ls.1.gz* Ishtar:law> llg -d /usr/share/man/man1/ drwxrwsr-x 3 man man 139264 May 3 09:04 /usr/share/man/man1/ Ishtar:law> llg -d /usr/share/man/ drwxrwsr-x 32 man man 4096 Apr 17 03:22 /usr/share/man/ ('llg' shows user+group which I normally have suppressed)
On 2021-05-04 21:53:09 L A Walsh wrote:
|I ran into this some time ago, and thought it |was solved, but am having probs looking up manpages |while running as root: | |Ishtar:/Media/Library> cd |Ishtar:law> sudo man ls |No manual entry for ls |Ishtar:law> man ls |wc # really is there! | 241 925 7864 |Ishtar:law> sudo man -w ls |No manual entry for ls |Ishtar:law> man -w ls |/usr/share/man/man1/ls.1.gz |Ishtar:law> llg /usr/share/man/man1/ls.1.gz |-rwxrwsr-x 1 man man 3112 Mar 2 2015 /usr/share/man/man1/ls.1.gz* |Ishtar:law> llg -d /usr/share/man/man1/ |drwxrwsr-x 3 man man 139264 May 3 09:04 /usr/share/man/man1/ |Ishtar:law> llg -d /usr/share/man/ |drwxrwsr-x 32 man man 4096 Apr 17 03:22 /usr/share/man/ | |('llg' shows user+group which I normally have suppressed)
That's strange; when I do that, sudo asks me for a password: | $ sudo man ls | [sudo] password for root: | Man: find all matching manual pages (set MAN_POSIXLY_CORRECT to avoid this) | * ls (1) | ls (1p) | Man: What manual page do you want? | Man: 1 | @23:37:57,leslie@pinto rc=0 are you sure that the real sudo and man commands are being invoked? | $ which sudo man | /usr/bin/sudo | /usr/bin/man | @23:41:59,leslie@pinto rc=0 So try | $ /usr/bin/sudo /usr/bin/man ls and see what happens? Leslie -- openSUSE Leap 15.2 x86_64
On 2021/05/04 21:43, J Leslie Turriff wrote:
That's strange; when I do that, sudo asks me for a password:
--- Do you have sudo configured to allow you to elevate to root without a password? My sudo/man are the real ones. I ran into this while running as root and remember having this problem many years ago, but forget the exact solution. ... But to answer your question:
whence sudo man sudo is /usr/bin/sudo sudo is /bin/sudo man is /usr/bin/man /usr/bin/sudo /usr/bin/man ls No manual entry for ls /bin/sudo /usr/bin/man ls No manual entry for ls sudo Bash nesting @ 2 # whoami root # man What manual page do you want? # man ls No manual entry for ls
| $ sudo man ls | [sudo] password for root: | Man: find all matching manual pages (set MAN_POSIXLY_CORRECT to avoid this) | * ls (1) | ls (1p) | Man: What manual page do you want? | Man: 1 | @23:37:57,leslie@pinto rc=0
are you sure that the real sudo and man commands are being invoked? | $ which sudo man | /usr/bin/sudo | /usr/bin/man | @23:41:59,leslie@pinto rc=0
So try | $ /usr/bin/sudo /usr/bin/man ls and see what happens?
Leslie -- openSUSE Leap 15.2 x86_64
On 2021/05/04 21:43, J Leslie Turriff wrote:
That's strange; when I do that, sudo asks me for a password:
--- Do you have sudo configured to allow you to elevate to root without a password?
My sudo/man are the real ones. I ran into this while running as root and remember having this problem many years ago, but forget the exact solution. ... But to answer your question:
whence sudo man sudo is /usr/bin/sudo sudo is /bin/sudo man is /usr/bin/man /usr/bin/sudo /usr/bin/man ls No manual entry for ls /bin/sudo /usr/bin/man ls No manual entry for ls sudo Bash nesting @ 2 # whoami root # man What manual page do you want? # man ls No manual entry for ls What I do in these cases is to run the misbehaving command ("man" in
On 05.05.21 11:03, L A Walsh wrote: this case) under "strace": # strace -fo man.out man ls then search "man.out" for open calls (beware: they are called openat() nowadays) and see where the command goes wrong. Maybe also run the command under "strace" as a non-provileged user and compare. Josef -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
Not entire sure how it got this way, but following along execution between user & root cases after filtering out instance-memory addrs: strace man ls \ |& sed -r 's/(0x[0-9a-f]+)/0xXXXX/g' \ >/tmp/man-$USER.txt I found "other" had no-access to /usr/share & /usr/local/share. Setting o+rx on those dirs solved the problem. *sigh*... no idea how it got that way...but off to track another prob... *double sigh* Yeah...good idea! ;-) On 2021/05/05 02:15, Josef Moellers wrote:
run the command under "strace"... & run the command under "strace" as a non-provileged user and compare.
On 05/05/2021 22.13, L A Walsh wrote:
Not entire sure how it got this way, but following along execution between user & root cases after filtering out instance-memory addrs:
strace man ls \ |& sed -r 's/(0x[0-9a-f]+)/0xXXXX/g' \ >/tmp/man-$USER.txt
I found "other" had no-access to /usr/share & /usr/local/share. Setting o+rx on those dirs solved the problem.
*sigh*...
Ow. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
L A Walsh wrote:
I ran into this some time ago, and thought it was solved, but am having probs looking up manpages while running as root:
Ishtar:/Media/Library> cd Ishtar:law> sudo man ls No manual entry for ls
FWIW, on Leap 15.2, that works for me.
Ishtar:law> man -w ls /usr/share/man/man1/ls.1.gz
Same here.
Ishtar:law> llg /usr/share/man/man1/ls.1.gz -rwxrwsr-x 1 man man 3112 Mar 2 2015 /usr/share/man/man1/ls.1.gz*
Different permissions & ownership here - per@office68:~> l /usr/share/man/man1/ls.1.gz -rw-r--r-- 1 root root 3190 May 16 2020 /usr/share/man/man1/ls.1.gz -- Per Jessen, Zürich (10.5°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland.
On 2021/05/05 11:18:43 +0200, Per Jessen wrote:
L A Walsh wrote:
I ran into this some time ago, and thought it was solved, but am having probs looking up manpages while running as root:
Ishtar:/Media/Library> cd Ishtar:law> sudo man ls No manual entry for ls
FWIW, on Leap 15.2, that works for me.
Ishtar:law> man -w ls /usr/share/man/man1/ls.1.gz
Same here.
Ishtar:law> llg /usr/share/man/man1/ls.1.gz -rwxrwsr-x 1 man man 3112 Mar 2 2015 /usr/share/man/man1/ls.1.gz*
Different permissions & ownership here -
per@office68:~> l /usr/share/man/man1/ls.1.gz -rw-r--r-- 1 root root 3190 May 16 2020 /usr/share/man/man1/ls.1.gz
This is what I see also ... for installed /suse/werner> rpm -qf /usr/share/man/man1/ls.1.gz coreutils-8.29-lp152.4.7.x86_64 /suse/werner> rpm -qf /usr/bin/man man-2.7.6-lp152.6.6.x86_64 on my Leap 15.2 ... and AFAIK we never had used man:man for the ownership nor broken permissions like execution and setgid man of any manual page ... The mandb program below /usr/bin is a wrapper which, for root only, switch over to man:man and executes /usr/lib/man-db/mandb to generate the hash data bases below /var/cache/man/. Those DBs are used for e.g. -k and -f option of man. This ownership switch avoids that any broken MANPATH leads to leakage of sensitive data into the hash DBs. The man program for its self should not use this wrapper anymore with Leap 15.2. Werner -- "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr
On 05/05/2021 04.53, L A Walsh wrote:
I ran into this some time ago, and thought it was solved, but am having probs looking up manpages while running as root:
Ishtar:/Media/Library> cd Ishtar:law> sudo man ls No manual entry for ls Ishtar:law> man ls |wc # really is there! 241 925 7864 Ishtar:law> sudo man -w ls No manual entry for ls Ishtar:law> man -w ls /usr/share/man/man1/ls.1.gz Ishtar:law> llg /usr/share/man/man1/ls.1.gz -rwxrwsr-x 1 man man 3112 Mar 2 2015 /usr/share/man/man1/ls.1.gz* Ishtar:law> llg -d /usr/share/man/man1/ drwxrwsr-x 3 man man 139264 May 3 09:04 /usr/share/man/man1/ Ishtar:law> llg -d /usr/share/man/ drwxrwsr-x 32 man man 4096 Apr 17 03:22 /usr/share/man/
('llg' shows user+group which I normally have suppressed)
I suspect this has to do with paths where man searches, but I did not know they could be different per user. So, the environment for root under sudo is missing something. Try also doing "su" and "su -". Telcontar:~ # set | grep MAN GNUSTEP_LOCAL_DOC_MAN=/usr/local/share/man GNUSTEP_NETWORK_DOC_MAN=/usr/local/share/man GNUSTEP_SYSTEM_DOC_MAN=/usr/share/man GNUSTEP_USER_DIR_DOC_MAN=GNUstep/Library/Documentation/man MANPATH=/usr/share/man:/usr/local/man:/usr/local/share/man:/opt/kde3/share/man:/usr/man WINDOWMANAGER=/usr/bin/startxfce4 if test -n "$GIT_TESTING_PORCELAIN_COMMAND_LIST"; then __gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST"; if test -n "$GIT_TESTING_ALL_COMMAND_LIST"; then __gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(__git --list-cmds=alias,list-guide) gitk"; if test -n "$COMMAND_NOT_FOUND_AUTO"; then Telcontar:~ # Ok, so you have to look at "MANPATH" sudo echo $MANPATH -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
L A Walsh wrote:
I ran into this some time ago, and thought it was solved, but am having probs looking up manpages while running as root:
Ishtar:/Media/Library> cd Ishtar:law> sudo man ls No manual entry for ls
Does work properly here on a TW installation. sudo config is the original one, as I don't use it.. What does 'sudo echo $MANPATH' tell?
On 5/5/21 4:53 AM, L A Walsh wrote:
Ishtar:law> sudo man ls No manual entry for ls
As others wrote, sudo may drop environment variables like MANPATH. If that's the case, then you could either change the sudo configuration, or pass the environment variable into the process run by the other (root) user; a portable way is: $ sudo env VAR="$VAR" program args... so in this case maybe: $ sudo env MANPATH="$MANPATH" man ls Have a nice day, Berny
participants (9)
-
Andrei Borzenkov
-
Bernhard Voelker
-
Carlos E. R.
-
Dr. Werner Fink
-
J Leslie Turriff
-
Josef Moellers
-
L A Walsh
-
Per Jessen
-
Peter Suetterlin