tags 323851 fixed-upstream
thanks

Gruesse Bernhard,

> The getpwnam.3 manpages may confuse people to believe the pw_dir entry 
> is the proper way to get the home directory of the current process,
> not reading the referenced passwd(5) stating:
> 
> The home directory field provides the name of the initial working
> directory.  Login uses this information to set the value of the HOME
> environmental variable.
> 
> The (hopefully) attached patch hopefully clarifies this.

Thanks for your report.  I rewrote the text somewhat to be as 
follows:

       The  pw_dir  field  contains  the name of the initial
       working directory of the user.   Login  programs  use
       the  value of this field to initialize the HOME envi-
       ronment variable for the login shell.  An application
       that  wants  to  determine  its user's home directory
       should inspect the value of  HOME  (rather  than  the
       value  getpwuid(getuid())->pw_dir)  since this allows
       the user to modify their notion of "the  home  direc-
       tory" during a login session.  To determine the (ini-
       tial) home directory of another user, it is necessary
       to use getpwnam("username")->pw_dir or similar.

This text will appear in man-pages-2.08.

Cheers,

Michael

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to