Skip to content

Commit

Permalink
fix(validate): unprivileged port start returned as default 1024 if ke…
Browse files Browse the repository at this point in the history
…rnel file not found
  • Loading branch information
qdm12 committed Jan 19, 2024
1 parent 75485e0 commit f5037d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions validate/listenport_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func getUnprivilegedPortStart() (startPort uint16, err error) {
buffer := make([]byte, maxFileSize)
file, err := os.Open(filepath)
if err != nil {
if os.IsNotExist(err) {
const defaultUnprivilegedPortStart = 1024
return defaultUnprivilegedPortStart, nil
}
return 0, fmt.Errorf("opening file: %w", err)
}

Expand Down

0 comments on commit f5037d0

Please sign in to comment.