This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems with "man" command under cygwin


Dmitry,

The "unsafe" diagnostic means that one of man's internal attempts to 
execute an external program refused to do so because the name of the 
command contained one or more of these "unsafe" characters:

  Semicolon
  Space
  Single quote
  Double quote
  Backslash


This test is imposed by the simplified built-in sprintf function 
(my_xsprintf(char *format, ...) in .../src/util.c) when the %S 
formatting directive is used. If the %S argument fails the safe 
characters test, my_xsprintf returns "unsafe". This is the ultimate 
source of your diagnostic. Since there are many (26, in fact) places 
where %S is used to create a command string, there are many 
opportunities for this to happen. %S is used both for command names and 
for file names. (Man does not attempt to apply quoting to the commands 
it constructs internally, so it has to be pretty restrictive in 
constructing those command strings.)

Have you installed Cygwin or set up any of the environment variables 
used by man (any that contain file or directory names) such that they 
contain a forbidden character?

Perhaps this is enough for you to locate the source of your problem.

Oh... Since you cannot run man, here's the section on its use of 
environment variables:

-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
MANPATH
  If  MANPATH is set, man uses it as the path to search for manual
  page files.  It overrides the configuration file and  the  auto-
  matic  search  path,  but  is  overridden  by  the -M invocation
  option.  See SEARCH PATH FOR MANUAL PAGES.

MANPL
  If MANPL is set, its value is used as the display  page  length.
  Otherwise, the entire man page will occupy one (long) page.

MANROFFSEQ
  If  MANROFFSEQ is set, its value is used to determine the set of
  preprocessors run before running nroff or  troff.   By  default,
  pages are passed through the tbl preprocessor before nroff.

MANSECT
  If  MANSECT  is set, its value is used to determine which manual
  sections to search.

MANWIDTH
  If MANWIDTH is set, its value is  used  as  the  width  manpages
  should  be displayed.  Otherwise the pages may be displayed over
  the whole width of your screen.

MANPAGER
  If MANPAGER is set, its value is used as the name of the program
  to  use to display the man page.  If not, then PAGER is used. If
  that has no value either, /usr/bin/less -isrR is used.

LANG
  If LANG is set, its value defines the name of  the  subdirectory
  where  man first looks for man pages. Thus, the command `LANG=dk
  man 1 foo' will cause man to  look  for  the  foo  man  page  in
  .../dk/man1/foo.1,  and  if  it cannot find such a file, then in
  .../man1/foo.1, where ... is a directory on the search path.

NLSPATH, LC_MESSAGES, LANG
  The environment variables NLSPATH and LC_MESSAGES (or LANG  when
  the  latter  does not exist) play a role in locating the message
  catalog.  (But the English messages are  compiled  in,  and  for
  English no catalog is required.)  Note that programs like col(1)
  called by man also use e.g. LC_CTYPE.

PATH
  PATH helps determine the search path for manual page files.  See
  SEARCH PATH FOR MANUAL PAGES.

SYSTEM
  SYSTEM is used to get the default alternate system name (for use
  with the -m option).
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-

Good luck.

Randall Schulz


At 20:38 2003-05-16, dmitry levandovsky wrote:
>Hi,
>
>I have installed the latest cygwin packages a couple of days ago, but 
>have the following strange result when I try to use the "man" command:
>
>$man man
>unsafe: not found
>Error executing formatting or display command.
>System command unsafe exited with status 32512.
>No manual entry for man
>
>I get the same result no matter what man page I request. I am running 
>Windows XP and I have istalled sh, groff, and less using the latest 
>cygwin setup program.
>
>Now, man used to work on my PC just fine, until I tried installing the 
>ghostscript package, then it started to have this problem with man. I 
>tried uninstalling ghostscript, then the "man" package, and even all of 
>cygwin, and then installing it back. Still I get the same problem. Does 
>that mean something got messed up in my registry? I could edit the 
>registry if I knew what to look for.
>
>Could someone help please?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]