Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

fix syntax of equality test in /bin/sh#10

Open
walterdejong wants to merge 1 commit intojtniehof:masterfrom
walterdejong:test_bug
Open

fix syntax of equality test in /bin/sh#10
walterdejong wants to merge 1 commit intojtniehof:masterfrom
walterdejong:test_bug

Conversation

@walterdejong
Copy link
Contributor

Teus Hagen wrote me an e-mail saying:

The script shield-trigger-iptables is using the sh (an falls down in some distros like Debian into the dash) engine.
In dump sh the test function will fail on arguments starting with the '-' symbol.
Maybe change "#! /bin/sh" to "#!/bin/bash" ?

To test it:
sh -c "[ -D == -D ]"

The failure message:

/usr/sbin/shield-trigger-iptables: 37: [: -D: unexpected operator
/usr/sbin/shield-trigger-iptables: 45: [: -D: unexpected operator
iptables v1.4.18: Couldn't load target `pam_shield':No such file or directory

The fix is to use a single = rather than == since this is for /bin/sh.

Greets,

--Walter

@drydenp
Copy link

drydenp commented Nov 24, 2017

I can confirm that this patch would be necessary for Dash to function properly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants