Problem with getpwnam() syscall

Discussion in 'Perl' started by Thomas Keller, Jan 19, 2004.

  1. Hello there!

    I have a small problem while setting up a chrooted cvs
    server which returns "No such system user" when I try
    to do some action on it (e.g. "cvs co module").
    I tracked the problem down to the getpwnam syscall
    somewhere inside the CVS code and tried to chroot
    into my server's environment myself to see whats up.

    Since I'm (not yet) very comfortable with Perl I wrote
    a very small script which does nothing else than

    #!/usr/bin/perl

    print getpwnam("tommyd"),"\n";

    Outside the chrooted environment it returns the
    proper information. Inside the chroot it does not.

    I have a small directory tree for the cvs environment
    created by following the instructions in [0],
    a /etc/passwd file exists in there, here it is:

    cvs::6000:6000::/:/sbin/nologin
    tommyd:0m6PRAVWkfIZg:6000:6000::/:/sbin/nologin

    The pl-script returns NULL when calling getpwnam, which
    means, according to perldoc, that the user does not
    exists. I read somewhere that this is only particularily
    right since there could popup other error codes.

    Final PERL-related question: How can I retrieve these
    error codes and what do they mean? Has anybody experienced
    similar problems like me with the getpwnam function?

    Thanks in advance for any answers!

    Thomas "TommyD" Keller.

    [0] http://www.unixtools.org/cvs/server-how-to.html
    Thomas Keller, Jan 19, 2004
    #1
    1. Advertising

  2. Thomas Keller

    Joe Smith Guest

    Thomas Keller wrote:

    > Final PERL-related question: How can I retrieve these
    > error codes and what do they mean?


    perldoc -f getpwnam; man getpwnam; man getpwent

    --
    I love my TiVo - http://www.inwap.com/u/joe/tivo/
    Joe Smith, Jan 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Williard

    Using getpwnam() with CGI

    Jason Williard, Apr 22, 2005, in forum: Perl
    Replies:
    0
    Views:
    2,710
    Jason Williard
    Apr 22, 2005
  2. gga
    Replies:
    1
    Views:
    289
    Daniel Berger
    Mar 8, 2005
  3. Thomas Keller

    Problem with getpwnam() syscall

    Thomas Keller, Jan 20, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    174
    Ben Morrow
    Jan 20, 2004
  4. Jason Williard

    Using getpwnam() with CGI

    Jason Williard, Apr 23, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    185
    Alan J. Flavell
    Apr 24, 2005
  5. perlUSER

    getpwnam question

    perlUSER, Nov 25, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    151
    Anno Siegel
    Nov 29, 2005
Loading...

Share This Page