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

Fixed inconsistent parsing of --mode flag #512

Merged
merged 14 commits into from
Nov 21, 2024

Conversation

sfc-gh-psmolenski
Copy link
Collaborator

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.

@sfc-gh-psmolenski sfc-gh-psmolenski added the bug Something isn't working label Nov 15, 2024
@sfc-gh-psmolenski sfc-gh-psmolenski marked this pull request as ready for review November 15, 2024 10:48
Copy link
Collaborator

@sfc-gh-mwalas sfc-gh-mwalas left a 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

services/localfile/client/utils.go Outdated Show resolved Hide resolved
services/localfile/client/client.go Show resolved Hide resolved
services/localfile/client/client.go Outdated Show resolved Hide resolved
services/localfile/client/client.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@sfc-gh-ikryvanos sfc-gh-ikryvanos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Please add integration test to check that bug is fixed and it could be merged

@sfc-gh-psmolenski sfc-gh-psmolenski force-pushed the localfile-mode-inconsistency branch from ab742df to 49f35fa Compare November 21, 2024 13:13
@sfc-gh-psmolenski sfc-gh-psmolenski merged commit b1836a3 into main Nov 21, 2024
7 checks passed
@sfc-gh-psmolenski sfc-gh-psmolenski deleted the localfile-mode-inconsistency branch November 21, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants