Page MenuHomeFreeBSD

fix shebang sheck with links to non-executable files
AbandonedPublic

Authored by lifanov on Sep 25 2017, 10:17 PM.

Details

Reviewers
mat
antoine
Group Reviewers
O5: Ports Framework(Owns No Changed Paths)
portmgr
Summary
For normal files, shebang check is ignored if they are not
executable, but for symlinks this is not the case.

This is a prerequisite of an upcoming sysutils/ansible fix.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11750
Build 12094: arc lint + arc unit

Event Timeline

antoine added a subscriber: antoine.

I believe this will match directories

This revision now requires changes to proceed.Sep 25 2017, 10:21 PM

address antoine's feedback

Yes, you are correct. Try this please.

I wonder why we check shebang of files that are pointed by symbolic links.

I'm not sure why we check symlinks, but exclusion of executable files pointed to by symlinks doesn't work without this check.

In D12497#259099, @mat wrote:

I wonder why we check shebang of files that are pointed by symbolic links.

Ok, so, the history is:

  1. check every executable files
  2. check only executable files in bin/sbin/libexec/www, but also check symlinks
  3. check every executable files, and symlinks

It seems that the second step should have been removed in rP438168 when we went back to all executable files.

I'd vote for removing all the symlink checks.

Can I commit this fix as-is for now so that I can commit a fix for sysutils/ansible please?

In D12497#259099, @mat wrote:

I wonder why we check shebang of files that are pointed by symbolic links.

It was for the case of /usr/local/bin/foo ->/usr/local/obscuredirectory/foo

But now that we check more than files/links in $PATH , it may no longer be needed

The above check would have caught /usr/local/obscuredirectory/foo without a symlink to it.

$(find ${STAGEDIR}${PREFIX} \
    -type f -perm +111 2>/dev/null)

Yes, I removed the obsolete symlinks thing in rP450638.