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>
This commit is contained in:
2025-02-14 12:44:55 +09:00
parent 3fba33687b
commit e431ab3c24
2 changed files with 9 additions and 1 deletions

6
internal/sysconf.go Normal file
View File

@@ -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)) }