users - user-level user management API
users is Monolith's userspace user management API. It controls mapping of usernames to UIDs, the used cryptographic library, and access to /etc/passwd.
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.
Logs out the current user.
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.
Sets the current user's login shell to file.
Returns the current user's home directory. Alias for os.getenv("HOME").
Returns the current user's login shell. Alias for os.getenv("SHELL").
Identical to users(2).sudo.
Monolith System Interfaces (c) 2020 Ocawesome101 under the GNU GPLv3.