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

"chsh -s path/to/shell" argument handling differs from regular chsh #140

Open
drjaska opened this issue Oct 25, 2024 · 0 comments
Open

"chsh -s path/to/shell" argument handling differs from regular chsh #140

drjaska opened this issue Oct 25, 2024 · 0 comments

Comments

@drjaska
Copy link

drjaska commented Oct 25, 2024

https://github.com/termux/termux-tools/blob/master/scripts/chsh.in#L16

Line 16 NEW_SHELL=@TERMUX_PREFIX@/bin/$1

This assumes that a full path is not given and expects a binary name from the $PREFIX/bin directory.

Or if abused a relative path starting from that directory but I would assume that to break later on.

I would recommend to check if $1 contains slashes or not.

I would expect chsh -s "$(command -v bash)" to work as it does on other systems but here it results in the shell executable file path /data/data/com.termux/files/usr/bin//data/data/com.termux/files/usr/bin/bash which errors the executability check.

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