ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pear-general
pear-general
[PEAR] File_Passwd and shadow passwords
by Aaron Gould other posts by this author
May 11 2005 8:18AM messages near this date
[PEAR] [ANNOUNCEMENT] Crypt_RSA-1.0.0 (stable) Released. | [PEAR] Re: File_Passwd and shadow passwords
Can anyone tell me if File_Passwd can work with shadow password files?

The following snippet of code is allowing alterations to the /etc/passwd 
file, and an "x" is inserted into the password field (which is 
expected). Shadow remains untouched...

    include_once('File/Passwd.php');

    $passwd = &File_Passwd::factory('Unix');
    $passwd-> setFile('/etc/passwd');
    $passwd-> useMap(true);
    $passwd-> load();
    $extra = array('pass'=> 'testpass', 'home'=>'/home/testuser',
                   'gecos'=> 'Added by script...', 'shell'=>'/bin/bash');
    $passwd-> addUser('testuser', 'testpass', $extra);
    $passwd-> save();

I've been through the docs, and all I can see is that a PEAR_Error is 
thrown when a shadow password configuration is detected.  Does this 
simply mean it doesn't have that capability?  Google is rather dry on 
relevant information too.

Thanks,
-- 
Aaron Gould
Programmer/Systems Administrator
PARTS CANADA

-- 
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Aaron Gould
Michael Wallner

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved