[File] Misdetection of shell

Steve Grubb sgrubb at redhat.com
Tue Feb 11 21:01:12 UTC 2020


Hello,

I wanted to report a simple issue which may become bigger over time. Fedora, 
RHEL, Centos, and probably more Linux distributions have changed so that /bin 
and /sbin are symlinks to /usr/bin and /usr/sbin respectively. I found this 
today:

# file --mime-type /usr/libexec/grepconf.sh
/usr/libexec/grepconf.sh: text/plain

# /usr/bin/head -n 1  /usr/libexec/grepconf.sh
#!/usr/bin/sh

That should really be detected as text/x-shellscript.

I know people are not supposed to do that, but they are. I have 345 scripts 
in /usr/bin, 40 in /usr/sbin, and 73 in /usr/libexec that call the shell by /
usr/bin/sh. So, it looks like there's a bunch of scripts doing this.

Best Regards,
-Steve




More information about the File mailing list