-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fixed inconsistent parsing of --mode
flag
#512
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits and testing suggestion, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the sanssh is at least covered with integration test
sansshell/testing/integrate.sh
Line 632 in 9d31c2a
run_a_test false 0 file chmod --mode="${EXPECTED_NEW_MODE}" ${LOGS}/test-file |
Have you tried running / extending those?
(I should look into that for exec run too, but that one might be little bit more challenging as setup requires to have some user structure established
sansshell/testing/integrate.sh
Line 546 in 9d31c2a
run_a_test false 1 exec run /usr/bin/echo Hello World |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check
Due to default Go's sting-to-int parsing algorithm the value of
--mode
flag was treated as decimal or octal depending on its format (777
vs.0777
), which was yielding unexpected results and was inconsistent with how native UNIX tools work (e.g.chmod
) .From now on,
sanssh
client will always treat--mode
flag value as a 12-bit octal number.