Linux : create a user if not exists

Christian Heimes lists at cheimes.de
Tue Aug 16 16:14:33 CEST 2011


Am 16.08.2011 10:04, schrieb Chris Rebert:
> You can replace the /etc/passwd parsing with a call to pwd.getpwnam():
> http://docs.python.org/library/pwd.html#pwd.getpwnam

You should replace it. /etc/passwd is not the only source for users.
/etc/nsswitch.conf may list more user and group sources like nis/yp,
LDAP and so on.

Christian




More information about the Python-list mailing list