Next: Sieve Interface, Previous: System functions, Up: Library [Contents][Index]
Look for the user name (getpwnam
) or user ID uid
(getpwuid
) in the system password database and return the
corresponding record, if found. If not found, raise the
‘e_not_found’ exception.
The returned record consists of six fields, separated by colon sign:
uname:passwd:uid:gid:gecos:dir:shell
Field | Meaning |
---|---|
uname | user name |
passwd | user password |
uid | user ID |
gid | group ID |
gecos | real name |
dir | home directory |
shell | shell program |
For example:
getpwnam("gray") ⇒ "gray:x:1000:1000:Sergey Poznyakoff:/home/gray:/bin/bash"
Following two functions can be used to test for existence of a key in the user database:
Return ‘true’ if name (or uid) is found in the system user database.