1.2.9. pylibc
This module provides a wrapped interface for Linux’s libc. Most of this
functionality is duplicated in Python’s own grp
and pwd
modules. This implementation however, using ctypes
to directly
interface with libc is necessary to avoid dead-lock issues when authenticating
non-local users such as would be found in an environment using an LDAP server.
1.2.9.1. Functions
- getgrnam(name, encoding='utf-8')[source]
Get the structure containing the fields from the specified entry in the group database. See getgrnam(3) for more information.
- getgrouplist(user, group=AUTOMATIC, encoding='utf-8')[source]
Get the groups that the specified user belongs to. If group is not specified, it will be looked up from the password record for user. See getgrouplist(3) for more information.
- getpwnam(name, encoding='utf-8')[source]
Get the structure containing the fields from the specified entry in the passwrd database. See getpwnam(3) for more information.
- getpwuid(uid)[source]
Get the structure containing the fields from the specified entry in the passwrd database. See getpwuid(3) for more information.