Bug 34832

Summary: /usr/share/man/cat3/setkey.3.gz linked to crypt.3.gz, not cipher.3.gz
Product: Base System Reporter: Alan E <ports>
Component: binAssignee: Volker Werth <vwe>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.5-STABLE   
Hardware: Any   
OS: Any   

Description Alan E 2002-02-11 14:50:03 UTC
On a fresh 4.5-RELEASE installation, /usr/share/man/cat3/setkey.3.gz is the
same file as crypt.3.gz.

It should be hard-linked to cipher.3.gz. 

Note: It's correct in /usr/share/man/man3. Only cat3 has the error.

[blank lines inserted for readability]
[alane ~]$ ls -l /usr/share/man/{man,cat}3/{setkey,cipher,crypt}.3*

-rw-r--r--  1 man   wheel  1389 Feb 11 08:37 /usr/share/man/cat3/cipher.3.gz
-rw-r--r--  7 man   wheel  2799 Jan 28 09:35 /usr/share/man/cat3/crypt.3.gz
-rw-r--r--  7 man   wheel  2799 Jan 28 09:35 /usr/share/man/cat3/setkey.3.gz

-r--r--r--  5 root  wheel  2019 Jan 28 08:13 /usr/share/man/man3/cipher.3.gz
-r--r--r--  3 root  wheel  3402 Jan 28 08:11 /usr/share/man/man3/crypt.3.gz
-r--r--r--  5 root  wheel  2019 Jan 28 08:13 /usr/share/man/man3/setkey.3.gz
Comment 1 Crist J. Clark freebsd_committer freebsd_triage 2002-02-11 23:30:44 UTC
On Mon, Feb 11, 2002 at 09:42:35AM -0500, Alan Eldridge wrote:
[snip]

> >Description:
> 
> On a fresh 4.5-RELEASE installation, /usr/share/man/cat3/setkey.3.gz is the
> same file as crypt.3.gz.
> 
> It should be hard-linked to cipher.3.gz. 
> 
> Note: It's correct in /usr/share/man/man3. Only cat3 has the error.
> 
> [blank lines inserted for readability]
> [alane ~]$ ls -l /usr/share/man/{man,cat}3/{setkey,cipher,crypt}.3*
> 
> -rw-r--r--  1 man   wheel  1389 Feb 11 08:37 /usr/share/man/cat3/cipher.3.gz
> -rw-r--r--  7 man   wheel  2799 Jan 28 09:35 /usr/share/man/cat3/crypt.3.gz
> -rw-r--r--  7 man   wheel  2799 Jan 28 09:35 /usr/share/man/cat3/setkey.3.gz
> 
> -r--r--r--  5 root  wheel  2019 Jan 28 08:13 /usr/share/man/man3/cipher.3.gz
> -r--r--r--  3 root  wheel  3402 Jan 28 08:11 /usr/share/man/man3/crypt.3.gz
> -r--r--r--  5 root  wheel  2019 Jan 28 08:13 /usr/share/man/man3/setkey.3.gz

This is a problem with the way the catpages are distributed. Right
now, they are a separate distro. They are built for a "default"
install. In such a default install, the des_cipher(3), des_setkey(3),
encrypt(3), and setkey(3) are all linked to crypt(3). When you add the
'crypto' distribution, it correctly clobbers the manpages as you have
seen, but it does not do the catpages (since catpages are a separate
distro and other distros do not contain catpages).

The workaround for this is not as easy as it could be; catman(1)
won't see the current inconsistencies in your man and catpages,

  # cd /usr/share/man/cat3
  # rm cipher.3.gz des_cipher.3.gz des_setkey.3.gz encrypt.3.gz setkey.3.gz
  # echo /usr/bin/catman | su -m man

There may be other inconsistencies between your catpages and
manpages. I'd actually recommend that instead of the above, you
rebuild them all,

  # find /usr/share/man/cat* -type f -delete
  # echo /usr/bin/catman | su -m man

It takes a few minutes, but it is a one time cost.

As for a fix, too late for 4.5-RELEASE, obviously. Off the top of my
head, I cannot really think of an easy way to do this. We do not want
the crypto, or other distros, adding catpages unconditionally. There
is no good way to let the catman distro know which other distros were
chosen and add the appropriate catpages; that's not how the distros
work. The only reasonable possibility I can think of that fits the
current distro model is to have a separate crypto-catpages (like there
is already a separate crypto-src) sub-distro.

OTOH, IMHO, probably the best thing to do would be to do away with the
catman distro all together and have sysinstall run catman(1) after all
manpages are installed and guarantee that the two are in sync.
-- 
Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
Comment 2 Alan Eldridge 2002-02-11 23:50:07 UTC
On Mon, Feb 11, 2002 at 03:30:44PM -0800, Crist J. Clark wrote:
>On Mon, Feb 11, 2002 at 09:42:35AM -0500, Alan Eldridge wrote:
>[snip]

>This is a problem with the way the catpages are distributed. Right
>now, they are a separate distro. They are built for a "default"

>The workaround for this is not as easy as it could be; catman(1)
>won't see the current inconsistencies in your man and catpages,
>
>  # cd /usr/share/man/cat3
>  # rm cipher.3.gz des_cipher.3.gz des_setkey.3.gz encrypt.3.gz setkey.3.gz
>  # echo /usr/bin/catman | su -m man
>
>There may be other inconsistencies between your catpages and
>manpages. I'd actually recommend that instead of the above, you
>rebuild them all,
>
>  # find /usr/share/man/cat* -type f -delete
>  # echo /usr/bin/catman | su -m man
>
>It takes a few minutes, but it is a one time cost.

Ah...now is there a way to say "find all files that are dupes
of each other and (hard-or-sym) link 'em together"?

From "man catman":

BUGS
     man(1) is a setuid program.  Be careful that user `man' has write permis-
     sions to the catman directories.  Catman does not check for any `.so' in
     man page sources.  Use hard or symlinks to avoid redundant formatted man
     pages.

I presume this means that it *doesn't* use hard or symlinks on its own.

-- 
Alan Eldridge
"Dave's not here, man."
Comment 3 Crist J. Clark freebsd_committer freebsd_triage 2002-02-12 01:02:50 UTC
On Mon, Feb 11, 2002 at 04:00:02PM -0800, Alan Eldridge wrote:
[snip]

>  >  # find /usr/share/man/cat* -type f -delete
>  >  # echo /usr/bin/catman | su -m man
>  >
>  >It takes a few minutes, but it is a one time cost.
>  
>  Ah...now is there a way to say "find all files that are dupes
>  of each other and (hard-or-sym) link 'em together"?
>  
>  From "man catman":
>  
>  BUGS
>       man(1) is a setuid program.  Be careful that user `man' has write permis-
>       sions to the catman directories.  Catman does not check for any `.so' in
>       man page sources.  Use hard or symlinks to avoid redundant formatted man
>       pages.
>  
>  I presume this means that it *doesn't* use hard or symlinks on its own.

I'm a bit confused by that BUGS section too. catman(1) _does_ do links
properly. Run,

  # echo /usr/bin/catman -p -v | su -m man

To see what it will do. I _think_ the BUGS section is saying to link
or symlink your _manpages._ That's how catman(1) knows when to link
rather than reprocess.
-- 
Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
Comment 4 Volker Werth freebsd_committer freebsd_triage 2008-05-24 17:02:11 UTC
State Changed
From-To: open->closed


setkey(3) does not exist anymore - closing this 


Comment 5 Volker Werth freebsd_committer freebsd_triage 2008-05-24 17:02:11 UTC
Responsible Changed
From-To: freebsd-bugs->vwe


track