ULOG_LOGIN(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

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() and ulog_login_pseudo() register a login session on a TTY. Iconic behavior.
  • ulog_login() adds an entry for TTY line and username user. Simple, slay.
  • ulog_login_pseudo() 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. It’s giving β€œlet the system handle the identity situation” 🫢
  • The optional host argument denotes a remote hostname, in case the login session is provided by a network service. So if the login came from the network, host can carry that info.
  • ulog_logout() and ulog_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