Crates.io | omst |
lib.rs | omst |
version | 3.1.0 |
source | src |
created_at | 2022-02-02 22:06:03.05229 |
updated_at | 2024-07-27 16:31:48.683187 |
description | Reveals whomst thou art with a single character. |
homepage | |
repository | https://codeberg.org/clarfonthey/omst |
max_upload_size | |
id | 525886 |
size | 28,093 |
Reveals whomst thou art with a single character.
Available via the Anti-Capitalist Software License for individuals, non-profit organisations, and worker-owned businesses.
Just build omst
and omst-be
for your system and install them in /usr/bin
.
omst
prints one of five characters based upon your effective user permissions:
#
for absolute permissions (i.e. root
, administrator)@
for system users$
for ordinary users%
for restricted users (e.g. nobody
, guest)?
if any error occursIn all cases, the character is followed by a newline. If an error occurs, the exit status will be
nonzero; to see full errors, run omst-be
instead.
Currently, unix-family systems (via libc & shadow) and Windows (via WinAPI) are supported. Android support is currently unavailable.
Mac OS and iOS are supported on a "coincidental" basis, meaning that if it happens to work under the existing code, nice! Otherwise, no substantial code will be added for these targets, since Apple does not make it easy to test software on their platforms without dedicated hardware.
Under unix-family systems, the permissions are mapped based upon the effective user ID
(libc::getuid
) and the UID_MIN
and UID_MAX
fields of /etc/login.defs
:
Absolute
: UID 0 (usually, but not always the root
user)System
: Below UID_MIN
User
: Between UID_MIN
and UID_MAX
(inclusive)Guest
: Above UID_MAX
Under Windows, the permissions are mapped based upon the priv
field of the USER_INFO
struct:
Absolute
: USER_PRIV_ADMIN
System
: Unused (Windows doesn't have system users)User
: USER_PRIV_USER
Guest
: USER_PRIV_GUEST