[
https://issues.apache.org/jira/browse/HADOOP-12196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622463#comment-14622463
]
Allen Wittenauer commented on HADOOP-12196:
-------------------------------------------
ELF only works on systems that generate ELF. e.g., OS X is problematic:
{code}
$ file /bin/bash
/bin/bash: Mach-O universal binary with 2 architectures
/bin/bash (for architecture x86_64): Mach-O 64-bit executable x86_64
/bin/bash (for architecture i386): Mach-O executable i386
{code}
I wonder if we are overthinking this and just need to throw stderr away. Or
maybe take the head of the file and see if it:
a) begins with a #!
b) ends with a sh
Just random ideas.
> shellcheck plugin is picking up target executables
> --------------------------------------------------
>
> Key: HADOOP-12196
> URL: https://issues.apache.org/jira/browse/HADOOP-12196
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: yetus
> Affects Versions: HADOOP-12111
> Reporter: Allen Wittenauer
> Assignee: Kengo Seki
> Attachments: HADOOP-12196.HADOOP-12111.01.patch
>
>
> When hadoop-yarn-server-nodemanager is in the build, it generates
> target/native/target/usr/local/bin/(test-)container-executor. shellcheck
> picks these up and throws a "hGetContents: invalid argument (invalid byte
> sequence)" error.
> We need some sort of safety to determine if a file is binary or shell code
> and/or prevent target directories from getting picked up. I suspect the
> former to be more reliable than the latter since we can't assume maven.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)