Linux emulation

Jeroen Ruigrok/asmodai asmodai at wxs.nl
Wed Aug 6 23:44:03 PDT 2003


-On [20030806 23:32], Matthew Dillon (dillon at xxxxxxxxxxxxxxxxxxxx) wrote:
>    Try ktrace'ing etc.. running 'man' as root.  I am not sure but I think
>    ktrace will work on an suid program run as root.

Yeah, but it would negate any issues a normal user has due to elevated
privileges.

>    If that fails then give the 'man' user a shell, su - man, chmod the 
>    binary so it is no longer suid, and ktrace it from the man account that
>    way.  (and be sure to cleanup the above mess after you track the problem
>    down :-)

OK, thanks, that at least drove me closer to finding some stuff out:

doing manual pages as user man just works as expected.
Doing manual pages as root already makes a mistake, the resulting .1.gz
file, for example, gets chowned to root.  On a FreeBSD-STABLE box it's
chowned to user man.

Mmm, found out more.

My primary user is a member of group wheel and gets the warning.  My
other user, not a member of wheel couldn't even write the temporary file
to cat1/.  (I created the other user to test something as I was writing
this email.)

But as I was writing and checking the information all of a sudden my
primary user started to also refuse to write to the specified directory.

man -d was giving:

will try to write /usr/share/man/cat1/ls.1.gz if needed
status from is_newer() = -2
using default preprocessor sequence
found tbl(1) directive
Couldn't open /usr/share/man/cat1/ls.1.gz.tmpw5ghxj for writing.
using default preprocessor sequence
found tbl(1) directive
Couldn't open /usr/share/man/cat1/ls.1.gz.tmpb1NDwX for writing.
using default preprocessor sequence
found tbl(1) directive

I just rebuild man and reinstalled it, after having removed my test
user, and 'lo and behold:

[8:32] [asmodai at purgatory] (25) {1} $ man ls
Formatting page, please wait...
Hmm!  Can't seem to rename /usr/share/man/cat1/ls.1.gz.tmpyocpiN to
/usr/share/man/cat1/ls.1.gz, check permissions on man dir!
rename: Permission denied

It's back.

Readding the test user, running a man of a command and it also gets the
permissions warning this time.  And indeed, man -d shows:

will try to write /usr/share/man/cat1/ls.1.gz if needed
status from is_newer() = -2
using default preprocessor sequence
found tbl(1) directive
mode of /usr/share/man/cat1/ls.1.gz.tmpGSD9F1 is now 644
Formatting page, please wait...
trying command: (cd /usr/share/man ; /usr/bin/zcat
/usr/share/man/man1/ls.1.gz | /usr/bin/tbl | /usr/bin/groff -S -Wall
-mtty-char -man -Tascii | /usr/bin/col | /usr/bin/gzip -c)
No output, debug mode.
using default preprocessor sequence
found tbl(1) directive
Couldn't open /usr/share/man/cat1/ls.1.gz.tmpWlbRcX for writing.
using default preprocessor sequence
found tbl(1) directive

Only one writing warning.

I have no idea what is causing this.  I'd be inclined to say there's
something wrong in the kernel, but that wouldn't explain the behaviour
when I put the binary on the FreeBSD box.

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai
PGP fingerprint: 2D92 980E 45FE 2C28 9DB7  9D88 97E6 839B 2EAC 625B
http://www.tendra.org/   | http://www.in-nomine.org/~asmodai/diary/
The human race is challenged more than ever before to demonstrate our
mastery -- not over nature but of ourselves...





More information about the Kernel mailing list