develooper Front page | perl.beginners | Postings from May 2007

syscall getpwnam and changing authetication on system

Thread Next
From:
Martin Barth
Date:
May 18, 2007 09:06
Subject:
syscall getpwnam and changing authetication on system
Message ID:
20070518180623.624b7ca5@nietzsche
I am changing the authetication typ, from local to remote ldap on a pc.
I want to get the new userid of a user, therefore i have following code.

system ("/etc/init.d/nscd stop");
system ("/etc/init.d/winbind restart");
print "**********" . getpwnam("christian") ."\n";


## code that changes from local to remote ldap
AuthSrv::set_pdc("192.168.7.68","bbads.local","administrator","****","****","*****","*****");
AuthSrv::mod_nsswitch();

system ("/etc/init.d/nscd start");

while (1) {
	print "********** " . eval("getpwnam('christian')") ."\n"; sleep 10;
	 }


but that code just print the old uid of christian.. if I do a perl -wle 'print getpwnam("christian")' the correct (new) uid is returned.

any suggestions?

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About