Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure scripting episode & zet #20

Closed
iandstanley opened this issue Jan 25, 2022 · 0 comments
Closed

Secure scripting episode & zet #20

iandstanley opened this issue Jan 25, 2022 · 0 comments

Comments

@iandstanley
Copy link

iandstanley commented Jan 25, 2022

I was watching your video on secure scripting and was interested in your no path script in zet 20220109171814

There is a issue with the script in that you cannot pass arguments to the target script executed

To fix shift the ARGV stack down and add $@ to the exec which will also need the quotes removing to stop exec getting confused

#!/bin/sh
cmd='which $1'
export PATH=
shift
exec $cmd $@

Note replace the ' with a backquote (iPhone keyboard has no backtick

Also the script on the video said which $2 rather than which $1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant