The
ulog_login()
and
ulog_login_pseudo()
functions register a login session on a TTY.
The
ulog_login()
function adds an entry for TTY
line
and username
user.
The
ulog_login_pseudo()
function uses file descriptor to a pseudo-terminal master device
fd
to determine the TTY name, while using the username belonging to the
real user ID of the calling process.
The optional
host
argument denotes a remote hostname, in case the login session is
provided by a network service.
The
ulog_logout()
and
ulog_logout_pseudo()
functions mark the previously registered login session as being
terminated.
Because the
line
and
user
arguments of
ulog_login()
and
ulog_logout()
cannot be trusted, these functions require administrative privileges.
The
ulog_login_pseudo()
and
ulog_logout_pseudo()
functions spawn a privileged process to perform the actual logging.