creating packets home dir

This commit is contained in:
2025-10-05 18:16:15 -03:00
parent 147fca375e
commit 0a965c67c2
2 changed files with 4 additions and 1 deletions

View File

@@ -479,7 +479,7 @@ skipping:
}
func GetPacketsUID() (int, error) {
_ = exec.Command("useradd", "-M", "-N", "-r", "packets").Run()
_ = exec.Command("useradd", "-M", "-N", "-r", "-s", "/bin/false", "-d", "/var/lib/packets", "packets").Run()
cmd := exec.Command("id", "-u", "packets")
out, err := cmd.CombinedOutput()
@@ -500,6 +500,7 @@ func ChangeToNoPermission() error {
if err != nil {
return err
}
_ = os.Chown("/var/lib/packets", uid, 0)
return syscall.Setresuid(0, uid, 0)