diff options
Diffstat (limited to 'cmd/hsu/parse.go')
| -rw-r--r-- | cmd/hsu/parse.go | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/cmd/hsu/parse.go b/cmd/hsu/parse.go index 6003f6cf..d4f7df43 100644 --- a/cmd/hsu/parse.go +++ b/cmd/hsu/parse.go @@ -18,8 +18,9 @@ const ( useridEnd = useridStart + rangeSize - 1 ) -// parseUint32Fast parses a string representation of an unsigned 32-bit integer value -// using the fast path only. This limits the range of values it is defined in. +// parseUint32Fast parses a string representation of an unsigned 32-bit integer +// value using the fast path only. This limits the range of values it is defined +// in but is perfectly adequate for this use case. func parseUint32Fast(s string) (uint32, error) { sLen := len(s) if sLen < 1 { @@ -40,12 +41,14 @@ func parseUint32Fast(s string) (uint32, error) { return n, nil } -// parseConfig reads a list of allowed users from r until it encounters puid or [io.EOF]. +// parseConfig reads a list of allowed users from r until it encounters puid or +// [io.EOF]. // -// Each line of the file specifies a hakurei userid to kernel uid mapping. A line consists -// of the string representation of the uid of the user wishing to start hakurei containers, -// followed by a space, followed by the string representation of its userid. Duplicate uid -// entries are ignored, with the first occurrence taking effect. +// Each line of the file specifies a hakurei userid to kernel uid mapping. A +// line consists of the string representation of the uid of the user wishing to +// start hakurei containers, followed by a space, followed by the string +// representation of its userid. Duplicate uid entries are ignored, with the +// first occurrence taking effect. // // All string representations are parsed by calling parseUint32Fast. func parseConfig(r io.Reader, puid uint32) (userid uint32, ok bool, err error) { @@ -112,10 +115,6 @@ func mustParseConfig(puid int) (userid uint32) { return } -// envIdentity is the name of the environment variable holding a -// string representation of the current application identity. -var envIdentity = "HAKUREI_IDENTITY" - // mustReadIdentity calls parseUint32Fast to interpret the value stored in envIdentity, // terminating the program if the value is not set, malformed, or out of bounds. func mustReadIdentity() uint32 { |
