Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40322 - sys-apps/man creates /var/cache/man/cat* directories without write permission for man group
Summary: sys-apps/man creates /var/cache/man/cat* directories without write permission...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 40885 58536 58598 59400 60710 61538 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-03 15:32 UTC by Karl Fischer
Modified: 2004-08-29 08:30 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Fischer 2004-02-03 15:32:44 UTC
sys-apps/man installs /usr/bin/man with setgid man, but the man group does not have permission to write to /var/cache/man/cat*.

This caused problems for me when root somehow created an empty file in /var/cache/man/cat1:
-r--rw-r--    1 root     man             0 Feb  3 18:00 nl.1.bz2

I don't know how this empty file got there, maybe this is another bug?
Anyway man tries to do the right thing and actually correct this empty file, and it works okay if man is run as root. But if man is run non-root, it spews out this mess:

$ man nl
rm: remove write-protected regular empty file `/var/cache/man/cat1/nl.1.bz2'? y
rm: cannot remove `/var/cache/man/cat1/nl.1.bz2': Permission denied
Formatting page, please wait...
sh: line 1: /var/cache/man/cat1/nl.1.bz2: Permission denied
Error executing formatting or display command.
System command (cd /usr/share/man && (echo ".pl 1100i"; /bin/gunzip -c '/usr/share/man/man1/nl.1.gz'; echo; echo ".pl \n(nlu+10") | /usr/bin/gtbl | /usr/bin/nroff -Tlatin1 -c -mandoc | /bin/bzip2 > /var/cache/man/cat1/nl.1.bz2) exited with status 1.
rm: remove write-protected regular empty file `/var/cache/man/cat1/nl.1.bz2'? y
rm: cannot remove `/var/cache/man/cat1/nl.1.bz2': Permission denied
 
bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Success
        Input file = /var/cache/man/cat1/nl.1.bz2, output file = (stdout)
 
It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.
 
You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

Reproducible: Always
Steps to Reproduce:
1. As root:  touch /var/cache/man/cat1/nl.1.bz2; chgrp man /var/cache/man/cat1/nl.1.bz2
2. As user:  man nl


Actual Results:  
See error above. Also note that new files are only added to /var/cache/man/cat*
when running man as root. When running as a user, no cache files are written
because man doesn't have permission. This doesn't make sense--I think the
intention is that users should be able to write cache files since /usr/bin/man
is setgid man?

Expected Results:  
The following permission changes fix the problem:

chgrp man /var/cache/man/cat*
chmod g+w /var/cache/man/cat*

Portage 2.0.49-r21 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r9,
2.4.25_pre6-gss)=================================================================
System uname: 2.4.25_pre6-gss i686 Intel(R) Xeon(TM) CPU 2.80GHz
Gentoo Base System version 1.4.3.10
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium3 -mcpu=pentium4 -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /var/cvsroot /var/qmail/control /var/www"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium3 -mcpu=pentium4 -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://gentoo.noved.org
http://adelie.polymtl.ca/ ftp://mirror.iawnet.sandia.gov/pub/gentoo/
ftp://ftp.ussg.iu.edu/pub/linux/gentoo/
ftp://www.ibiblio.org/pub/Linux/distributions/gentoo/"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi apache2 arts avi berkdb bidi canna cjk crypt cscope cups curl
doc emacs emacs-w3 encode esd evms2 fam fastcgi fbcon firebird foomaticdb
freetds freewnn gdbm ggi gif gnome gpm gtk gtk2 guile imap imlib informix innodb
java jpeg junit kde kerberos krb4 lcms ldap leim libg++ libwww mad maildir mbox
mcal mikmod mmx motif mpeg mpi mule mysql ncurses nls oav oci8 odbc oggvorbis
opengl oss pam pdflib perl plotutils png postgres ppds prelude python qt
quicktime readline ruby samba sasl sdl slang slp snmp socks5 spell sqlite sse
ssl svga tcltk tcpd tetex tiff truetype unicode usb wmf x86 xface xml2 xmms xv
zeo zlib"
Comment 1 Peter Gantner (a.k.a. nephros) 2004-02-07 11:10:38 UTC
second this (me too!).

installed versions here:
sys-apps/man-1.5m
app-arch/bzip2-1.0.2-r3
sys-apps/baselayout-1.8.6.12-r3

replying mainly to be cc'd; I'd be happy ho help tracing this;

Comment 2 SpanKY gentoo-dev 2004-02-08 14:27:01 UTC
*** Bug 40885 has been marked as a duplicate of this bug. ***
Comment 3 Joe Stroller 2004-02-10 11:34:38 UTC
I can reproduce also:
$ man emerge
rm: remove write-protected regular empty file `/var/cache/man/cat1/emerge.1.bz2'? n
Formatting page, please wait...
sh: line 1: /var/cache/man/cat1/emerge.1.bz2: Permission denied
Error executing formatting or display command.
System command (cd /usr/share/man && (echo ".pl 1100i"; /bin/gunzip -c '/usr/share/man/man1/emerge.1.gz'; echo; echo ".pl \n(nlu+10") | /usr/bin/gtbl | /usr/bin/nroff -Tlatin1 -c -mandoc | /bin/bzip2 > /var/cache/man/cat1/emerge.1.bz2) exited with status 1.
rm: remove write-protected regular empty file `/var/cache/man/cat1/emerge.1.bz2'? 
$

Have just re-emerged sys-apps/man-1.5l-r6 & run the script "/etc/cron.daily/makewhatis.cron" but makes no difference.
Comment 4 SpanKY gentoo-dev 2004-02-10 17:08:31 UTC
seems this only happens with new installs of man ...

fixed in cvs ... just `rm -rf /var/cache/man ; emerge man` if you're too lazy to fix the perms yourself :p
Comment 5 Brett I. Holcomb 2004-02-10 17:29:57 UTC
When it's fixed in CVS when will it show up in portage with a emerge sync?

By new man install would that be one that happens when I upgrade portage?  My system isn't new.

Thanks.
Comment 6 SpanKY gentoo-dev 2004-02-10 17:33:51 UTC
weird, it didnt happen over here on any of my boxes ...

cvs -> rsync happens every 30 minutes
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-15 11:40:47 UTC
Could always 'fix' it in pkg_postinst() ...
Comment 8 Brett I. Holcomb 2004-06-05 20:09:06 UTC
It's still broken.  I attempted a man chmod as a user and got the error.  Once I ran man chmod as root it worked.  I did the rm man from /var/cache and things worked for awhile but it's back again.  I think it either needs to be fixed or let the ebuild handle it.  We shouldn't have to fix this every time man gets updated
Comment 9 SpanKY gentoo-dev 2004-06-05 20:18:07 UTC
it shouldnt be broken after you fix it once

i havent seen it 'come back' on any of my boxes ...
Comment 10 Brett I. Holcomb 2004-06-05 20:32:32 UTC
I haven't really used man from a user account for a while but it is acting up again tonight.  I did the rm ... emerge thing and it works now.

Comment 11 Joe Stroller 2004-06-07 04:48:30 UTC
Spanky: it does seem to come back. I did an `emerge -U world` (for the first time in a month or 6 weeks) at the weekend & `man ls` failed today. As you'll see, I've posted to this bug before, and "fixed" this issue at that time. 
Comment 12 SpanKY gentoo-dev 2004-07-28 15:36:31 UTC
seems the permissions get revereted so i'll do as azarah suggested
Comment 13 SpanKY gentoo-dev 2004-07-28 15:36:34 UTC
*** Bug 58536 has been marked as a duplicate of this bug. ***
Comment 14 SpanKY gentoo-dev 2004-07-28 16:09:03 UTC
*** Bug 58598 has been marked as a duplicate of this bug. ***
Comment 15 SpanKY gentoo-dev 2004-07-28 22:12:25 UTC
added to pkg_postinst() ... please try syncing up in a bit and re-emerging man and see if the errors go away
Comment 16 Mr. Bones. (RETIRED) gentoo-dev 2004-08-04 10:36:59 UTC
*** Bug 59400 has been marked as a duplicate of this bug. ***
Comment 17 Brett I. Holcomb 2004-08-04 16:35:03 UTC
I tried it as a user on several and so far it seems to work.
Comment 18 SpanKY gentoo-dev 2004-08-17 15:12:01 UTC
*** Bug 60710 has been marked as a duplicate of this bug. ***
Comment 19 SpanKY gentoo-dev 2004-08-24 12:44:41 UTC
*** Bug 61538 has been marked as a duplicate of this bug. ***
Comment 20 L.Stohlmann 2004-08-28 07:17:01 UTC
It seems to be incorrect in the stageX tarball... i guess. Would be great if it were fixed there, I cannot test that because I do not plan to install some gentoo on a clean machine anytime soon.

After fixing ownership and directory modes in /var/cache/man it works and does not break again even after remerging man-1.5xyz
Comment 21 SpanKY gentoo-dev 2004-08-28 23:26:14 UTC
you dont really say which manpages but i doubt they'll get re-released

it's not a major issue and should be resolved in our next round of releases
Comment 22 SpanKY gentoo-dev 2004-08-29 08:30:30 UTC
err, not which manpages, but which stage files