473,549 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 19 '05 #1
1 3445
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/
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

57
4183
by: John Howard | last post by:
I've sent several messages over the last year asking about python - Who teaches python? Is python losing steam? etc. I have noticed, eg, the declinng number of books at my local borders. The last time I visited a borders (last week), there was 1 (sic) book about python on the shelve compared to dozens on perl & java! On my last inquiry about...
0
3500
by: Jason Williard | last post by:
I am trying to create a script to install spam filters on a per user basis. The script will have a web UI where the user should be able to login and enable or disable the filters. My original script, which was a command-line perl script, used User::pwent getpwnam() to get the user's encrypted password from the shadow file and compare it with...
11
3736
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class (ClassB* b; b->func(); ) the base-class function is called instead of the new function in the derived class. All other similar functions (virtual in...
117
7111
by: Peter Olcott | last post by:
www.halting-problem.com
18
6145
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the strcat (mystract). Program below. However this appears not to have fixed the problem and I don't know why it shouldn't ? Any further help as to...
6
1873
by: yezi | last post by:
Hi : I code a program by c called "inter". I have another program called "end" Can I code in "end " to use the syscall ( "inter") ? If Yes , which kind of command format should I write? thanks for any comments.
28
2552
by: Sam Joseph | last post by:
Hello, I need to mount a loopback file system. I'm using SYS_mount, but it always fails with ENOTDIR. Am I doing something silly? Here's the offending line: if(syscall(SYS_mount, "/home/sam/mnt/", "/home/sam/myfile.img", "-o loop" )) perror("Mount failure/ ");
1
1285
by: jm.carp | last post by:
I'm writing a tcp client that grabs data from a server at 32hz. But the connection drops exactly one minute after it's opened. I can get data from the server fine for the first 60s, and then the connection goes dead. What's going on?
8
1858
by: zl2k | last post by:
hi, there Here is a simplified piece of code of my program, it compiles and runs fine. However, valgrind shows it has uninitialized problem. What I am doing wrong? #ifndef DATA2_H #define DATA2_H class Data2{ public:
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.