Reject special files before preparing inputs

This commit is contained in:
2026-08-29 16:13:36 +00:00
parent a68e8e31a4
commit e7e3bef1e4
4 changed files with 95 additions and 4 deletions

View File

@@ -276,8 +276,8 @@ func requireInspectionFile(path, label string) error {
}
return fmt.Errorf("stat %s %q: %w", label, path, err)
}
if info.IsDir() {
return fmt.Errorf("%s %q is a directory", label, path)
if !info.Mode().IsRegular() {
return fmt.Errorf("%s %q is not a regular file", label, path)
}
return nil
}