Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶
Lookup returns the user.User entry associated with the given username.
Values are cached up to 1 hour, or 1 minute for failure cases.
func SocketFileFor ¶ added in v1.5.0
SocketFileFor creates a unix domain socket file on the specified path and, if possible, makes it usable by only the specified user. Failing that it will leave the socket open to all users. Non-fatal errors are logged.
See WriteFileFor if writing a regular file.
func UIDforUser ¶ added in v1.5.0
UIDforUser returns the UID for the specified username or returns an error.
Will always fail on Windows and Plan 9.
func WriteFileFor ¶ added in v1.5.0
WriteFileFor is like os.WriteFile except if possible it chowns the file to the specified user (possibly from Task.User) and sets the permissions to 0o600.
If chowning fails (either due to OS or Nomad being unprivileged), the file will be left world readable (0o666).
On failure a multierror with both the original and fallback errors will be returned.
See SocketFileFor if writing a unix socket file.
Types ¶
This section is empty.