atuser(3)
π atuser(3) β AtFS Toolkit Library π
okay bestie, gather round, we're doing user handling today and it's honestly giving backend glamour β¨ this whole page lives in the AtFS Toolkit Library and it's all about turning strings into users and users back into strings. no cap.
β¨ NAME β¨
atUserValid, atScanUser, atUserName, atUserUid β user handling π«Ά
πΈ SYNOPSIS πΈ
first things first, you gotta pull in the headers, literally both of them:
#include <atfs.h>
#include <atfstk.h>
and here are the four icons themselves, copy them exactly pls:
void atScanUser (char *userName; Af_user *resultUser);
char* atUserName (Af_user *user);
Uid_t atUserUid (Af_user *user);
int atUserValid (Af_user *user);
π¦ DESCRIPTION π¦
π atScanUser β the parser girlie
atScanUser scans the string you hand it, userName, and tries to derive an AtFS user identification (resultUser) out of it. it's doing its best, okay?
β οΈ important: it does NOT verify that a corresponding UNIX (/etc/passwd) user entry actually exists. it's not doing a vibe check on the system files, it's just parsing. if you want to test that, useatUserUid. periodt.
here's every format atScanUser understands, and bestie there are four:
userβ when the string has no at sign in it at all, it's treated as a plain user name from the current host and current domain. simple, clean, no drama. πuser@hostβ if the part after the at sign does not contain a period, it's assumed to be a hostname, and the domain is the current domain.user@host.domainβ this format can only be recognized when the domain you gave is equal to the current domain, and the hostname remains as the rest between the at sign and the domain name.user@domainβ a user identification string with a domain name that's different from the local domain gets treated asuser@domain. it might be wrong though, so likeβ¦ proceed with awareness π«
π atUserName β the string builder
atUserName returns a string of the form user@domain, generated from the user structure you gave it.
- if there's no domain name in the structure, it returns
user@hostinstead. - if there's no host and no domain name, you just get
user. minimalist. iconic. π
heads up bestie: the result string lives in static memory, and it will be overwritten on subsequent calls. so if you need to keep it, copy it, don't just stare at it. π
π atUserUid β the mapper
atUserUid tries to map the given user structure to a UNIX user identification.
- returns the uid on success β¨
- returns
-1otherwise π
β atUserValid β the plausibility check
atUserValid checks the given user structure for plausibility. it's the friend who says "bestie, does that even make sense?"
- returns
FALSEon failure - returns a non null value on success π
π§ sign-off π§
this page is from AtFStk-1.12, dated Fri Jun 25 16:39:50 1993 β yeah it's vintage, it's retro, it's still serving. go forth and handle your users, bestie πβ¨π¦
π¦ where this page comes from
- debian bookworm: atfs-dev 1.4pl6-15+b1
- ubuntu jammy: atfs-dev 1.4pl6-15
- ubuntu noble: atfs-dev 1.4pl6-16.1build1
- ubuntu resolute: atfs-dev 1.4pl6-17
- ubuntu stonking: atfs-dev 1.4pl6-17
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms