Skip to content

Commit

Permalink
Fixes issue #95
Browse files Browse the repository at this point in the history
  • Loading branch information
ryannewington committed May 25, 2021
1 parent dad587b commit 69a4406
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/>
<ROW Property="ARPPRODUCTICON" Value="accessmanager.exe" Type="8"/>
<ROW Property="Manufacturer" Value="Lithnet"/>
<ROW Property="ProductCode" Value="1033:{2220100A-EA24-421F-9E02-919DB8B51719} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{FBD1A0BA-507C-47AF-8712-976F98380C47} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Lithnet Access Manager Agent"/>
<ROW Property="ProductVersion" Value="1.0.7920.0" Type="32" TargetFile="Lithnet.AccessManager.Agent.exe"/>
<ROW Property="ProductVersion" Value="1.0.7925.0" Type="32" TargetFile="Lithnet.AccessManager.Agent.exe"/>
<ROW Property="SETUPEXEDIR" Value="1"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
<ROW Property="UpgradeCode" Value="{EEDECF4C-BABB-4AE0-9CB9-DC051FF1AE75}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/>
<ROW Property="ARPPRODUCTICON" Value="accessmanager.exe" Type="8"/>
<ROW Property="Manufacturer" Value="Lithnet"/>
<ROW Property="ProductCode" Value="1033:{1C9EE5DE-9953-48A8-AB3D-4DEFCAE91076} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{5B83FDD1-0428-44A6-BDDE-89B0CD161E6C} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Lithnet Access Manager Agent"/>
<ROW Property="ProductVersion" Value="1.0.7920.0" Type="32" TargetFile="Lithnet.AccessManager.Agent.exe"/>
<ROW Property="ProductVersion" Value="1.0.7925.0" Type="32" TargetFile="Lithnet.AccessManager.Agent.exe"/>
<ROW Property="SETUPEXEDIR" Value="1"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
<ROW Property="UpgradeCode" Value="{EEDECF4C-BABB-4AE0-9CB9-DC051FF1AE75}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
<EmbeddedResource Include="..\Lithnet.AccessManager.Service.Setup\output\license*.dat" LinkBase="EmbeddedResources" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Fulfillment\**" />
<EmbeddedResource Remove="Fulfillment\**" />
<None Remove="Fulfillment\**" />
</ItemGroup>

<ItemGroup>
<None Remove="DBScripts\00001-CreateRateLimitCacheTable.sql" />
<None Remove="DBScripts\00003-CreateAuditTable.sql" />
Expand Down Expand Up @@ -99,10 +105,6 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Fulfillment\Interfaces\" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="call %25BuildToolsPath%25\sign-and-save-symbols.bat $(TargetPath) $(TargetDir) $(ProjectName)" />
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ private IList<SearchResult> GetObjects(string path, SearchScope scope, string fi
};

d.PropertiesToLoad.Add("cn");
d.PropertiesToLoad.Add("samAccountName");
d.PropertiesToLoad.Add("msDS-PrincipalName");

SearchResultCollection result = d.FindAll();
Expand All @@ -329,7 +330,9 @@ private IEnumerable<string> GetExpectedGroupNames(IList<SearchResult> results, s
continue;
}

var name = this.groupResolver.BuildGroupName(template, null, cn);
string samAccountName = result.GetPropertyString("samAccountName").TrimEnd('$');

var name = this.groupResolver.BuildGroupName(template, null, samAccountName);
yield return name.TrimStart('\\');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<ROW Property="IAgree" Value="No" Type="4" MsiKey="IAgree"/>
<ROW Property="Manufacturer" Value="Lithnet"/>
<ROW Property="NO_USER_CHECK" Comments="Skips checking username"/>
<ROW Property="ProductCode" Value="1033:{0C16DADE-F411-4139-A587-D45ABD922081} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{2C013076-9CCD-4FFD-B8C3-D37B38B3DCDD} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Lithnet Access Manager Service"/>
<ROW Property="ProductVersion" Value="1.0.7920.0" Type="32" TargetFile="Lithnet.AccessManager.Service.exe"/>
<ROW Property="ProductVersion" Value="1.0.7925.0" Type="32" TargetFile="Lithnet.AccessManager.Service.exe"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
<ROW Property="UpgradeCode" Value="{D17AC68C-2F91-4344-A3BF-B13404566A40}"/>
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,10 @@
<data name="AccessMaskNone" xml:space="preserve">
<value>None</value>
</data>
<data name="ComputerNameInvalid" xml:space="preserve">
<value>The computer name contains unsupported characters</value>
</data>
<data name="ComputerNameIsTooLong" xml:space="preserve">
<value>The computer name is too long</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace Lithnet.AccessManager.Service.Models
public class AccessRequestModel
{
[Required(ErrorMessageResourceType = typeof(UIMessages), ErrorMessageResourceName = "ComputerNameIsRequired")]
[MaxLength(256, ErrorMessageResourceType = typeof(UIMessages), ErrorMessageResourceName = "ComputerNameIsTooLong")]
[RegularExpression(@"[A-Za-z0-9\.\-\\$]+", ErrorMessageResourceType = typeof(UIMessages), ErrorMessageResourceName = "ComputerNameInvalid")]
public string ComputerName { get; set; }

[MaxLength(4096, ErrorMessageResourceType = typeof(UIMessages), ErrorMessageResourceName = "ReasonTooLong")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ private DirectoryEntry FindComputerInGc(string objectName)
}
else
{
string dn = GcGetDnFromAttributeSearch("samAccountName", objectName, "computer");
string dn = GcGetDnFromAttributeSearch("samAccountName", objectName, "computer") ??
GcGetDnFromAttributeSearch("cn", objectName.TrimEnd('$'), "computer");

if (dn == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public IEnumerable<string> GetMemberTtlDNs()

string dn = match.Groups["dn"].Value;
string ttl = match.Groups["ttl"].Value;
string sidDn = $"CN={user.Sid},";
string sidDn = $"<SID={user.Sid}>";

if (string.Equals(user.DistinguishedName, dn, StringComparison.CurrentCultureIgnoreCase) ||
dn.StartsWith(sidDn, StringComparison.OrdinalIgnoreCase))
Expand Down
2 changes: 1 addition & 1 deletion src/Lithnet.AccessManager/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7920
7925

0 comments on commit 69a4406

Please sign in to comment.