Skip to content

Reduce heuristic triggers #69

@fuad-daoud

Description

@fuad-daoud

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...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions