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, use atUserUid. 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 as user@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@host instead.
  • 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 -1 otherwise πŸ’€

⭐ 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 FALSE on 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