Documentation
¶
Overview ¶
Package privilege implements chroot and privilege-drop (setuid/setgid) for the Nauthilus server process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropPrivileges ¶
DropPrivileges performs user/group lookup, chroot, and privilege drop in the correct order.
The sequence is:
- Resolve user/group to numeric UID/GID (before chroot, needs /etc/passwd).
- Validate essential DNS files inside the chroot directory.
- chroot() into the target directory.
- setgroups() — sets supplementary groups while still root.
- setgid() — must happen before setuid() to retain root for the call.
- setuid() — last step, drops all remaining privileges.
All parameters are optional. If all are empty, DropPrivileges is a no-op.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.