Skip to content

Commit

Permalink
Update WellKnownPrincipal.cs (#140)
Browse files Browse the repository at this point in the history
* Update WellKnownPrincipal.cs

The correct type for this is user.  this small thing made a huge confusion for some people today :(
i think this was caused from copy pasting s-1-5-15 the one above it in a fix long ago.

do not confuse IUSR type with IIS_IUSRS
https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers

* Update WellKnownPrincipalTest.cs
  • Loading branch information
Argentix03 authored Jul 26, 2024
1 parent d5e4bad commit f80bc17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CommonLib/WellKnownPrincipal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static bool GetWellKnownPrincipal(string sid, out TypedPrincipal commonPr
"S-1-5-13" => new TypedPrincipal("Terminal Server Users", Label.Group),
"S-1-5-14" => new TypedPrincipal("Remote Interactive Logon", Label.Group),
"S-1-5-15" => new TypedPrincipal("This Organization", Label.Group),
"S-1-5-17" => new TypedPrincipal("IUSR", Label.Group),
"S-1-5-17" => new TypedPrincipal("IUSR", Label.User),
"S-1-5-18" => new TypedPrincipal("Local System", Label.User),
"S-1-5-19" => new TypedPrincipal("Local Service", Label.User),
"S-1-5-20" => new TypedPrincipal("Network Service", Label.User),
Expand Down Expand Up @@ -88,4 +88,4 @@ public static bool GetWellKnownPrincipal(string sid, out TypedPrincipal commonPr
return commonPrincipal != null;
}
}
}
}
4 changes: 2 additions & 2 deletions test/unit/WellKnownPrincipalTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private static (string sid, string name, Label label)[] GetWellKnownPrincipals()
("S-1-5-13", "Terminal Server Users", Label.Group),
("S-1-5-14", "Remote Interactive Logon", Label.Group),
("S-1-5-15", "This Organization", Label.Group),
("S-1-5-17", "IUSR", Label.Group),
("S-1-5-17", "IUSR", Label.User),
("S-1-5-18", "Local System", Label.User),
("S-1-5-19", "Local Service", Label.User),
("S-1-5-20", "Network Service", Label.User),
Expand Down Expand Up @@ -148,4 +148,4 @@ public void GetWellKnownPrincipal_NonWellKnown_ReturnsNull()

#endregion
}
}
}

0 comments on commit f80bc17

Please sign in to comment.