Native API¶
For native integration of pyfingerd, the project provides interfaces for reading system information in order to expose it through the server.
Note that the relevant native interface for the host system (or the dummy
interface if none are relevant) is accessible through
pyfingerd.native.FingerNativeInterface
.
- class pyfingerd.posix.FingerPOSIXInterface¶
Finger interface for POSIX-compliant systems.
Only accessible on such systems; imports from other systems will result in an
ImportError
.- search_users(query: Optional[str], active: Optional[bool]) Sequence[pyfingerd.core.FingerUser] ¶
Look for users on POSIX-compliant systems.
The method for gathering users and sessions on such systems is the following:
Get the users in
/etc/passwd
, and check which ones not to make appear through the presence of.nofinger
in their home directory.Get the last login times for all users to display them by default, through the lastlog database if available.
Get the sessions in the utmp / utmpx database, and make them correspond to the related user.
For each session, get the idle time by gathering the mtime of the device.