Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Allow symlinks to provide cmd:" #1200

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pkg/sca/sca.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ func generateCmdProviders(ctx context.Context, hdl SCAHandle, generated *config.
}

mode := fi.Mode()
if !mode.IsRegular() {
return nil
}

if mode.Perm()&0555 == 0555 {
if isInDir(path, pathBinDirs) {
basename := filepath.Base(path)
Expand Down Expand Up @@ -578,10 +582,8 @@ func sonameLibver(soname string) string {
}

func getShbang(fp fs.File) (string, error) {
// Lots of programs have shbangs with python3 or sh which are symlinks.
// generateCmdProviders did not previously add a provides for symlinks
// that means we cannot let packages *depend* on python3, python or sh
// until we have packages that *provide* them.
// python3 and sh are symlinks and generateCmdProviders currently only considers
// regular files. Since nothing will fulfill such a depend, do not generate one.
ignores := map[string]bool{"python3": true, "python": true, "sh": true}

buf := make([]byte, 80)
Expand Down
Loading