diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-14 12:44:55 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-14 12:44:55 +0900 |
| commit | e431ab3c24acc5309531a26d71e761619bd69eec (patch) | |
| tree | 7293d4e61c1db3b043b2b8192e2c25e8a87e8cc0 /internal/sysconf.go | |
| parent | 3fba33687b8efca5d1acbc3a23daaa316509e172 (diff) | |
app: check username length against LOGIN_NAME_MAX
This limit is arbitrary, but it's good to enforce it anyway.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/sysconf.go')
| -rw-r--r-- | internal/sysconf.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/sysconf.go b/internal/sysconf.go new file mode 100644 index 00000000..03b236f4 --- /dev/null +++ b/internal/sysconf.go @@ -0,0 +1,6 @@ +package internal + +//#include <unistd.h> +import "C" + +func Sysconf_SC_LOGIN_NAME_MAX() int { return int(C.sysconf(C._SC_LOGIN_NAME_MAX)) } |
