From owner-freebsd-arch Mon Dec 17 5: 9:21 2001 Delivered-To: freebsd-arch@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 3ABA237B41D; Mon, 17 Dec 2001 05:09:07 -0800 (PST) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id fBHD90091884; Mon, 17 Dec 2001 15:09:00 +0200 (EET) (envelope-from ru) Date: Mon, 17 Dec 2001 15:09:00 +0200 From: Ruslan Ermilov To: Greg Lehey Cc: Garance A Drosihn , Peter Wemm , Nik Clayton , Warner Losh , ache@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: Changing 'man' to check alternate destination for 'cat' pages Message-ID: <20011217150900.E83850@sunbay.com> References: <20011212001610.9AEA739EA@overcee.netplex.com.au> <20011214112255.L3448@monorchid.lemis.com> <20011214101857.C35094@sunbay.com> <20011215110505.H85108@monorchid.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011215110505.H85108@monorchid.lemis.com> User-Agent: Mutt/1.3.23i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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