From 1ec302039dec6eebd1348ff9d78ce8f24207a1be Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 31 Oct 2017 19:38:55 -0400 Subject: [PATCH 1/3] Makes authentication work with Windows domains --- .../ServerInstance/Administration.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/TGServerService/ServerInstance/Administration.cs b/TGServerService/ServerInstance/Administration.cs index edd69e730c..50e42e7f5f 100644 --- a/TGServerService/ServerInstance/Administration.cs +++ b/TGServerService/ServerInstance/Administration.cs @@ -38,9 +38,14 @@ namespace TGServerService { if (TheDroidsWereLookingFor == null) return "ADMIN"; - - var pc = new PrincipalContext(ContextType.Machine); - return GroupPrincipal.FindByIdentity(pc, IdentityType.Sid, TheDroidsWereLookingFor.Value).Name; + + string res = null; + try + { + res = GroupPrincipal.FindByIdentity(new PrincipalContext(ContextType.Machine), IdentityType.Sid, TheDroidsWereLookingFor.Value).Name; + } + catch { } + return res ?? GroupPrincipal.FindByIdentity(new PrincipalContext(ContextType.Domain), IdentityType.Sid, TheDroidsWereLookingFor.Value).Name; } catch { @@ -66,11 +71,12 @@ namespace TGServerService /// Set based off either an ed name or a string from the config /// /// The name of the group to search for + /// Recursive parameter used to check for the group using instead of /// The name of the group allowed to access the if it could be found, otherwise - string FindTheDroidsWereLookingFor(string search = null) + string FindTheDroidsWereLookingFor(string search = null, bool useDomain = false) { //find the group that is authorized to use the tools - var pc = new PrincipalContext(ContextType.Machine); + var pc = new PrincipalContext(useDomain ? ContextType.Domain : ContextType.Machine); var config = Properties.Settings.Default; var groupName = search ?? config.AuthorizedGroupSID; if (String.IsNullOrWhiteSpace(groupName)) @@ -82,7 +88,7 @@ namespace TGServerService //try again with all types gp = GroupPrincipal.FindByIdentity(pc, search); if (gp == null) - return null; + return useDomain ? null : FindTheDroidsWereLookingFor(search, true); } TheDroidsWereLookingFor = gp.Sid; if (search != null) From d7bd3db97eb5e31654b00512b53f7768cb29c7ee Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 31 Oct 2017 19:45:59 -0400 Subject: [PATCH 2/3] Version bump to 3.1.6.2 [TGSDeploy] --- Version.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Version.cs b/Version.cs index cd11a44fd9..857215dc2e 100644 --- a/Version.cs +++ b/Version.cs @@ -12,6 +12,6 @@ using System.Reflection; // [assembly: AssemblyVersion("1.0.*")] //It's impossible to make these a define, don't say I didn't warn you -[assembly: AssemblyVersion("3.1.6.1")] -[assembly: AssemblyFileVersion("3.1.6.1")] -[assembly: AssemblyInformationalVersion("3.1.6.1")] +[assembly: AssemblyVersion("3.1.6.2")] +[assembly: AssemblyFileVersion("3.1.6.2")] +[assembly: AssemblyInformationalVersion("3.1.6.2")] From 0bd7669f90e6375c04e1a5933587c8b1f5b5f697 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 31 Oct 2017 20:41:10 -0400 Subject: [PATCH 3/3] Caches nuget packages --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 8b30349763..3e0b4e6c8d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,8 @@ artifacts: name: TGS3Client - path: MD5-SHA1-Client-v*.txt name: MD5SHA1Client +cache: + - packages -> **\packages.config install: - choco install fciv doxygen.portable graphviz.portable before_build: