Problem with getpwnam() syscall

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas Keller

    Problem with getpwnam() syscall

    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("tommy d"),"\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:0m6PRAVW kfIZg: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
  • Joe Smith

    #2
    Re: Problem with getpwnam() syscall

    Thomas Keller wrote:
    [color=blue]
    > Final PERL-related question: How can I retrieve these
    > error codes and what do they mean?[/color]

    perldoc -f getpwnam; man getpwnam; man getpwent

    --
    I love my TiVo - http://www.inwap.com/u/joe/tivo/

    Comment

    Working...