Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2001 15:09:00 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Greg Lehey <grog@FreeBSD.org>
Cc:        Garance A Drosihn <drosih@rpi.edu>, Peter Wemm <peter@wemm.org>, Nik Clayton <nik@FreeBSD.org>, Warner Losh <imp@harmony.village.org>, ache@FreeBSD.org, freebsd-arch@FreeBSD.org
Subject:   Re: Changing 'man' to check alternate destination for 'cat' pages
Message-ID:  <20011217150900.E83850@sunbay.com>
In-Reply-To: <20011215110505.H85108@monorchid.lemis.com>
References:  <20011212001610.9AEA739EA@overcee.netplex.com.au> <p0510100bb83ddfa9e683@[128.113.24.47]> <20011214112255.L3448@monorchid.lemis.com> <20011214101857.C35094@sunbay.com> <20011215110505.H85108@monorchid.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Dec 15, 2001 at 11:05:05AM +1030, Greg Lehey wrote:
> On Friday, 14 December 2001 at 10:18:58 +0200, Ruslan Ermilov wrote:
> > On Fri, Dec 14, 2001 at 11:22:55AM +1030, Greg Lehey wrote:
> >> On Thursday, 13 December 2001 at  0:01:03 -0500, Garance A Drosihn wrote:
> >> Under these circumstances it's interesting to know which man pages you
> >> have, and where they are.  It also had a 'query' option:
> >>
> >>   $ man -q ls
> >>   -r--r--r--  1     root    wheel         5361 Sat Sep 30 17:13:47 2000 /usr/share/man/man1/ls.1.gz? n
> >>   -rw-r--r--  1     root    wheel         3062 Thu Aug 18 21:45:13 1994 /usr/share/man/4.4BSD/cat1/ls.1.gz? n
> >>   -r--r--r--  1      bin      bin         9435 Tue Jan 21 00:17:30 1997 /usr/share/man/BSDI/man1/ls.1? n
> >>   -rw-r--r--  1     root    wheel         2271 Fri Aug 25 23:54:06 2000 /usr/share/man/linux/man1/ls.1.gz? n
> >>   -rw-r--r--  1     root    wheel         4903 Fri Dec 10 09:30:51 1999 /usr/share/man/linux/man1/ls.1? n
> >>   -rw-r--r--  1      bin      sys         3354 Fri Jun 27 10:05:42 1975 /usr/share/man/V6/man1/ls.1?
> >>
> > What are you looking for is already available as:
> >
> > $ MANPATH=/home/ru/mann:/usr/share/man man -a -w ls
> > /home/ru/mann/man1/ls.1
> > /usr/share/man/cat1/ls.1.gz (source: /usr/share/man/man1/ls.1.gz)
> 
> Not quite.  That corresponds to my man -l command: it just lists them,
> it doesn't give you the choice to select them or not.  See the '? n' at
> the end of most lines; you can also answer 'y' or 'q'.
> 
You said "it's interesting to know which man pages you have, and where
they are".  The -a -w answers this question.  Implementing a 'query'
option should be trivial.

> >> As regards the cat files, it seems to me that an obvious solution
> >> would be to add a CATMAN environment variable which would specify the
> >> location of the catman pages, and default to /usr/share/man/cat.
> >
> > Just having a CATMAN envariable is not enough, this would break many
> > things.
> 
> Yes, I was leaving that as an exercise for the implementor :-)
> 
Hmm, on a second thought, using just one CATMAN variable might be
enough, if treated a little different.  If CATMAN is set to /var/man,
man(1) will look for and create catpages in the /var/man/%manpath%
directory.  So, for /usr/share/man/man1/cat.1, the catman will be
searched for as /var/man/usr/share/man/man1/cat.1.  If this is
sufficient, I can implement this very quickly.

> > The "cat" feature of man(1) is insecure, and is probably going to be
> > nuked after a release of 4.5.
> 
> I think this is a pity.  What's the rationale?
> 
man(1) is currently set-UID "man", to create the catpages under
/usr/share/man/cat?, which are owned by "man".  There's the
race exists, where user-supplied MANPATH (or -M path) can be
used to overwrite /usr/share/man/cat? files.  See bin/32791 for
a full story.

> > Having catpages:
> >
> > - is optional
> > - can be configured at ``make world'' time
> 
> Agreed.
> 
> > - in different place can be achieved by using symlinks to cat?.
> 
> Yes, but I'd consider this a workaround.
> 
Agreed.


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011217150900.E83850>