ULOG_LOGIN(3)
ULOG_LOGIN(3) is a page from the Library Functions Manual, bestie β and itβs all about the User Login Record Library. Login-record lore, but make it make sense π
π NAME π
ulog_login, ulog_login_pseudo, ulog_logout, ulog_logout_pseudo β manage user login records
π LIBRARY π
User Login Record Library (libulog, -lulog)
β¨ SYNOPSIS β¨
#include <ulog.h>
void
ulog_login(const char *line, const char *user, const char *host);
void
ulog_login_pseudo(int fd, const char *host);
void
ulog_logout(const char *line);
void
ulog_logout_pseudo(int fd);
π DESCRIPTION π
Okay so hereβs the login-record tea:
ulog_login()andulog_login_pseudo()register a login session on a TTY. Iconic behavior.ulog_login()adds an entry for TTYlineand usernameuser. Simple, slay.ulog_login_pseudo()uses file descriptor to a pseudo-terminal master devicefdto determine the TTY name, while using the username belonging to the real user ID of the calling process. Itβs giving βlet the system handle the identity situationβ π«Ά- The optional
hostargument denotes a remote hostname, in case the login session is provided by a network service. So if the login came from the network,hostcan carry that info. ulog_logout()andulog_logout_pseudo()mark the previously registered login session as being terminated. Bye bestie π
Now the spicy security bit:
Because the line and user arguments of ulog_login() and ulog_logout() cannot be trusted, these functions require administrative privileges. No cap. π₯
The ulog_login_pseudo() and ulog_logout_pseudo() functions spawn a privileged process to perform the actual logging. They do not just do the privileged work themselves β they spawn a privileged process to perform the actual logging. Periodt.
π SEE ALSO π
π°οΈ HISTORY π°οΈ
These functions appeared in FreeBSD 9.0. Vintage but still cute.
Okay bye bestie, this page is from Debian, dated October 11, 2010, and itβs the ULOG_LOGIN(3) manual page β mwah ππ«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2009 Ed Schouten <ed@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms