Resending after subscribing to related lists... On Fri, Jun 20, 2008 at 11:56 AM, Mike Gerdts <[EMAIL PROTECTED]> wrote: > On Fri, Jun 20, 2008 at 9:59 AM, Alan Coopersmith > <[EMAIL PROTECTED]> wrote: >> Oscar del Rio wrote: >>> The problem seems to be with the new feature of "man" to deduce the MANPATH >>> from >>> the PATH, so for example /usr/openwin/bin in PATH gives /usr/openwin/man in >>> MANPATH (last dir removed and "man" added) >>> >>> But then /usr/bin/X11 becomes /usr/bin/man which is the man program itself >>> and >>> not a directory. I guess "man" is then trying to open itself as a >>> directory and >>> failing. > > What is really happening is that /usr/bin/X11 as a PATH element > doesn't fit the standard layout of: > > $prefix/bin > $prefix/sbin > $prefix/man > > man is chopping the last directory component of the PATH element off, > then appending man (also tries share/man). That is "/usr/bin/X11" > becomes "/usr/bin/man". That logic works great for (e.g.) > "/usr/local/bin" which becomes "/usr/local/man". man does verify the > existence of /usr/bin/man - but fails to verify that it is a > directory. See path_to_manpath() in man.c for details. > > The code that then tries to determine the man section list from the > directories /usr/bin/man/* fails when it tries to > opendir(/usr/bin/man) and returns without building the section list. > The crash is happening as duplicate man directories and sections are > removed because it assumes the section list is non-null. An empty > section list would be OK, but a NULL section list blows up. > > There are two obvious ways to address this: > > 1) Use realpath() on each path directory prior to turning it into a > man directory. This will break the functionality of allowing > $prefix/bin -> $prefix/$arch/bin with a shared $prefix/man (no > $prefix/arch/man). > 2) Use the a special pathmap > (http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/man/src/man.c#204) > entry to map /usr/bin/X11 to /usr/X11/share/man. > > I'm leaning toward fixing it with #2. As I was looking into this I > came across the following that I will address at the same time. > > - path_to_manpath() should not allow a directory to be added to > manpath if no sections are found. > - When checking for the existence of man and share/man directories, be > sure they are directories > > I've sent mail to request-sponsor to get someone to help me with the > putback of the fix. I expect that I will have a fix ready for code > review by Monday. > > Thanks for reporting the bug and sorry for creating it! > > Mike > > -- > Mike Gerdts > http://mgerdts.blogspot.com/ >
-- Mike Gerdts http://mgerdts.blogspot.com/ _______________________________________________ opensolaris-discuss mailing list [email protected]
