NAME
users - user-level user management API
DESCRIPTION
users is Monolith's userspace user management API. It controls mapping of usernames to UIDs, the used cryptographic library, and access to /etc/passwd.
METHODS
getname(uid:number): string
Resolves the provided uid to a username. If no corresponding username is found, returns a string in the form UID: .
login(user:string or number, password:string): boolean[, string]
Identical to users(2).login, except that this function sets environment variables appropriately and accepts a username or UID as its first argument.
logout(): boolean
Logs out the current user.
uid(): number
Returns the current thread's login UID. A UID of -1 means the current thread is not logged in as a user and has no privileges.
add(name:string, password:string, cansudo:boolean): number or nil, string
Identical to its users(2) counterpart, but takes a name rather than a UID.
del(name:string or number): ...
Identical to users(2).del, but can take a string as its name argument.
setShell(file:string)
Sets the current user's login shell to file.
home(): string
Returns the current user's home directory. Alias for os.getenv("HOME").
shell(): string
Returns the current user's login shell. Alias for os.getenv("SHELL").
sudo(...): ...
Identical to users(2).sudo.
COPYRIGHT
Monolith System Interfaces (c) 2020 Ocawesome101 under the GNU GPLv3.
SEE ALSO
users(2), usermgr(1)