View Issue Details

IDProjectCategoryView StatusLast Update
0000545fileGeneralpublic2024-07-22 19:16
Reporterluigisemenzato Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version5.44 
Summary0000545: /bin/dash script is confused for C source
DescriptionThe ChromeOS build can fail when it includes a shell script with #! /bin/dash in its first line. This happens because dash is not in the list of known shells, so file ignores the #! line, and instead finds a line containing "main() {" which is valid shell, but also valid C.

I suggest two fixes:

1. Include dash in the list of known shells (hopefully this is not controversial).

2. Using an interpreter that compiles and runs a C source seems pretty unusual (but not impossible: #!/usr/bin/tcc -run) and I am wondering if this would deserve deeper analysis, i.e if the interpreter executable ends in "sh" treat it as a script even if it contains "main () {". In fact, it may be better to call such a file a "script" rather than C source whenever its first line starts with #!. But I realize this might break existing code.

Thanks!
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2024-07-22 19:16 luigisemenzato New Issue