-
-
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
Make windows fast again (on domain connected machines) #297
Conversation
Instead of calling And if that still feels too slow - maybe persist this cache in TEMP and refresh it at most once a day? |
Any chance of progress being made here? |
Why isn't this merged already? |
Hey, sorry that this PR did not get much attention till now. I would like to reopen the PR, but I don't really have any knowledge of how permissions in Windows works. From what I could understand, "world" is kinda like "everyone else". I would like to know how important of a metric this permission is and how much of an effect this has. |
I've tried making a version that caches results to "get_acl_access_mask", and while it does help a little, especially with world that only need to be done once, |
I don't think we should cache it. For a tool like this showing stale/incorrect data might be worse that not showing any. |
I hope this PR or something like it can be released as soon as is feasible. I just installed the latest and greatest |
I think not querying this data and not displaying the hard coded data on windows is the best option. For every day use it makes more sense to make the tool usable, before supporting features like this on windows. |
By the way, I can enumerate the NTFS access permissions of all 866 objects in a directory on my laptop in 10.67 seconds. This is on a work laptop that is a domain member but not attached to the domain, and it is probably not using the fastest available method to do the enumeration. @meain , you said you don't understand Windows permissions very well, but if you just imagine a Linux system where all the files show a Significantly, while filesystem objects in NTFS have owners, they do not have any specific group associated with them, and they might or might not have any permissions relating to something similar to "world." To give some context, this scheme is really flexible, but it is complex enough that Windows doesn't even try to show a summary of permissions. The closest their standard CLI tools get is So TL;DR - I say if MS doesn't show permissions, why should |
@sql-sith , thanks for the details and screenshots. Just hard coding
In future we could probably add an "attributes" column on Windows like @sql-sith suggested. |
@meain, thanks for the reply! I also thought of the approach of disabling blocks but when I commented out the However, this will not be an obvious fix to most users, so I would suggest turning it off by default (at least on Windows PCs in a domain), or showing an extremely obvious message during installation allowing the user to shut off permissions. Regarding your comment about hard-coding So yes, I was suggesting not showing permissions for any group in Windows, not just |
From what I could understand, 2 blocks don't translate over (permissions, group) as windows might have multiple groups and there is no Regarding disabling |
@meain, that is exactly right. Also, I think that what you are proposing is perfect for now. Keeping the output looking similar is a good thing. I say go for it. :-) I can't help right now because work is too busy but might be able to later ... although maybe I should check what language this is before volunteering. |
Maybe add a flag to not retrieve this data? |
@AsafMah Yes, that is the plan. The idea is that we will only retrieve only the info needed to display the output. So if the user specifies |
This affects domain-connected machines the most, but it's still slow even on machines not part of a domain. In a directory with ~100 files (mostly .dll/.pdb files), lsd Note that 0.44s is still extremely slow; I haven't done any profiling yet to figure out why. Running |
I just added a quick and dirty way to disable the ownership/permissions checks on windows in #484. With that feature, lsd becomes as fast as any other tool (down to 0.04s for the dir above -- so twice as fast as WSL, and within range of the speed-of-light no-process-spawn powershell cmdlet) |
This is great news! I came out to see if anyone had worked on this yet. I'll give it a spin. Feel free to hit me up directly if/when you want to find fast ways to enumerate ACLs in Windows (not that you'll need my help, but just in case). |
@vvuk , I am not a Rustacean, so I have a really basic question. After building the executable from your PR, when I use it on a domain-connected computer it is still very slow, unfortunately. Is there anything I need to do to enable this feature? Thanks a lot for working on this. |
Yep, you need to build with |
See? I know nothing about rust. Or rather, now I know one thing. :) Thanks! |
Also see this PR: #475 |
This is what I have in mind so far. For now, as a stopgap solution we can have permission fetching disabled in windows under a feature flag (#484). The issue with #475 is that we need the permissions to color file names even if they are not explicitly requested. |
Closing this. #484 seems to be better for now. |
Hi @Peltoche, thanks for making
lsd
!I've looked into #200 and did some profiling, the indeed almost all of the time spent is in
GetEffectiveRightsFromAclW
when trying to query one of the "Well known" sids.The problem is that on domain joined machines, windows will try to contact the DC for every file (you can see the calls in the flamegraph to
GetDomainInfo
), which could take a few hundread miliseconds per file, this PR changeslsd
to only query user and group information, which return instantly.There isn't a 1:1 mapping between windows file security conecpts and linux's, and querying this information for an entire folder takes 20-50 seconds, which makes
lsd
difficult to use.Personally I find the information for User/Group more than sufficient :)
I could also feature-gate this change if you feel more comfortable with it.
Closes #200.