-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
✨ add disable option for permission #882
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zwpaper The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is what the output looks like ❯ cargo run -- --long
Finished dev [unoptimized + debuginfo] target(s) in 0.11s
Running `target\debug\lsd.exe --long`
lsd: .: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\build.rs: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\Cargo.lock: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\Cargo.toml: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\CHANGELOG.md: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\ci: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\CODEOWNERS: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\doc: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\LICENSE: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\README.md: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\rustfmt.toml: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\src: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\target: The specified domain either does not exist or could not be contacted. (os error 1355)
lsd: .\tests: The specified domain either does not exist or could not be contacted. (os error 1355)
.????????? ? ? 1.8 KB Tue Sep 12 14:47:32 2023 build.rs
.????????? ? ? 39 KB Fri Sep 15 22:24:29 2023 Cargo.lock
.????????? ? ? 1.9 KB Fri Sep 15 22:24:29 2023 Cargo.toml
.????????? ? ? 20 KB Fri Sep 15 22:24:29 2023 CHANGELOG.md
d????????? ? ? 0 B Tue Sep 12 14:47:32 2023 ci
.????????? ? ? 35 B Tue Sep 12 14:47:32 2023 CODEOWNERS
d????????? ? ? 0 B Tue Sep 12 14:47:32 2023 doc
.????????? ? ? 11 KB Tue Sep 12 14:47:32 2023 LICENSE
.????????? ? ? 20 KB Fri Sep 15 22:24:29 2023 README.md
.????????? ? ? 181 B Tue Sep 12 14:47:32 2023 rustfmt.toml
d????????? ? ? 4.0 KB Fri Sep 15 22:24:29 2023 src
d????????? ? ? 0 B Tue Sep 12 14:48:03 2023 target
d????????? ? ? 0 B Tue Sep 12 14:47:32 2023 tests Perhaps we can provide a hint to the user, e.g.
I'm still thinking the mode attributes should be default for windows (#866 (comment)), ACL seems like a bad default because it isn't safe
Then we could have a separate |
hi @domsleee, thanks for the advice! Honestly, I am not a Windows user, so your suggestion(or other Windows users) would be valuable to me. I was trying to add the ability to disable permission detection on Windows in this PR, first, let me make sure that this works in your view. and for the default options for windows, how about we try and disable it automatically if errors occur, this seems more to be intelligent. |
src/meta/mod.rs
Outdated
match windows_utils::get_file_data(path) { | ||
Ok((owner, permissions)) => (Some(owner), Some(permissions)), | ||
Err(e) => { | ||
eprintln!("lsd: {}: {}\n", path.to_str().unwrap_or(""), e); |
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 think a hint here could help users:
❯ lsd
let hint = if e.raw_os_error() == Some(ERROR_NO_SUCH_DOMAIN) {
" Hint: Consider using `--permission disable`."
} else {
""
};
Outputs:
lsd: .: The specified domain either does not exist or could not be contacted. (os error 1355). Hint: Consider using `--permission disable`.
lsd: .\build.rs: The specified domain either does not exist or could not be contacted. (os error 1355). Hint: Consider using `--permission disable`.
lsd: .\Cargo.lock: The specified domain either does not exist or could not be contacted. (os error 1355). Hint: Consider using `--permission disable`.
lsd: .\Cargo.toml: The specified domain either does not exist or could not be contacted. (os error 1355). Hint: Consider using `--permission disable`.
From my perspective, the
Yeah, it could be an idea to show only the first time 1355 occurs, so that the output is less noisy. There are two cases
Case 1 is fixed by the error handling in your PR, but case 2 is why I'm suggesting that ACL shouldn't be default 👍 |
hi @domsleee, it sounds reasonable to not make it as default for Windows, let me finish this PR, and maybe you can try to implement the rest two? and you could create 2 issues to track them. |
Signed-off-by: Wei Zhang <[email protected]>
Signed-off-by: Wei Zhang <[email protected]>
f5e7bcc
to
53e333d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #882 +/- ##
==========================================
- Coverage 85.93% 85.75% -0.18%
==========================================
Files 51 51
Lines 4962 5005 +43
==========================================
+ Hits 4264 4292 +28
- Misses 698 713 +15 ☔ View full report in Codecov by Sentry. |
add an option for
permission
args to disable the detection of owner and permission,it may be used in Windows to speed up.
a temporary fix for #200
this is a POC or RFC, any comment is welcome!
TODO
cargo fmt