-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Consider using this impl
// backend/privileges.go - Make privilege escalation more transparent
func CreatePrivilegedCmd(operation, command string, args ...string) (func() error, chan OperationResult) {
resultChan := make(chan OperationResult, 1)
// Use XDG_RUNTIME_DIR instead of /tmp for better security
rootPath := os.Getenv("XDG_RUNTIME_DIR")
if rootPath == "" {
rootPath = filepath.Join(os.TempDir(), "pkgmate-"+os.Getenv("USER"))
}
// Ensure directory is user-owned
if err := os.MkdirAll(rootPath, 0700); err != nil {
// handle error
}
// Rest of implementation...
}Reactions are currently unavailable