Skip to content

Commit

Permalink
Fix detach for interactive users
Browse files Browse the repository at this point in the history
  • Loading branch information
dorssel committed Feb 1, 2025
1 parent 87eaf69 commit 8d95d3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Usbipd/RegistryUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ public static RegistryKey SetDeviceAsAttached(Guid guid, BusId busId, IPAddress
var registrySecurity = attached.GetAccessControl(AccessControlSections.All);
registrySecurity.AddAccessRule(new RegistryAccessRule(new SecurityIdentifier(WellKnownSidType.WinConsoleLogonSid, null),
RegistryRights.Delete, AccessControlType.Allow));
// Required for Windows 11 (WinConsoleLogonSid is not enough)
registrySecurity.AddAccessRule(new RegistryAccessRule(new SecurityIdentifier(WellKnownSidType.InteractiveSid, null),
RegistryRights.Delete, AccessControlType.Allow));

Check warning on line 108 in Usbipd/RegistryUtilities.cs

View check run for this annotation

Codecov / codecov/patch

Usbipd/RegistryUtilities.cs#L107-L108

Added lines #L107 - L108 were not covered by tests
attached.SetAccessControl(registrySecurity);
try
{
Expand Down

0 comments on commit 8d95d3b

Please sign in to comment.