View Issue Details

IDProjectCategoryView StatusLast Update
0000545fileGeneralpublic2024-11-10 16:55
Reporterluigisemenzato Assigned Tochristos  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.44 
Fixed in Version5.46 
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

christos

2024-11-10 16:55

manager   ~0004096

Added Dash

Issue History

Date Modified Username Field Change
2024-07-22 19:16 luigisemenzato New Issue
2024-11-10 16:55 christos Assigned To => christos
2024-11-10 16:55 christos Status new => assigned
2024-11-10 16:55 christos Status assigned => resolved
2024-11-10 16:55 christos Resolution open => fixed
2024-11-10 16:55 christos Fixed in Version => 5.46
2024-11-10 16:55 christos Note Added: 0004096