Merge pull request #464 from NextTurn/domain

Fix default domain name
pull/468/head
Oleg Nenashev 2020-03-31 11:19:47 +02:00 committed by GitHub
commit 109e754813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -24,7 +24,7 @@ namespace winsw.Configuration
// Installation // Installation
public bool AllowServiceAcountLogonRight => false; public bool AllowServiceAcountLogonRight => false;
public string? ServiceAccountPassword => null; public string? ServiceAccountPassword => null;
public string ServiceAccountUser => "NULL\\NULL"; public string? ServiceAccountUser => null;
public List<Native.SC_ACTION> FailureActions => new List<Native.SC_ACTION>(0); public List<Native.SC_ACTION> FailureActions => new List<Native.SC_ACTION>(0);
public TimeSpan ResetFailureAfter => TimeSpan.FromDays(1); public TimeSpan ResetFailureAfter => TimeSpan.FromDays(1);

View File

@ -20,7 +20,7 @@ namespace winsw.Configuration
// Installation // Installation
bool AllowServiceAcountLogonRight { get; } bool AllowServiceAcountLogonRight { get; }
string? ServiceAccountPassword { get; } string? ServiceAccountPassword { get; }
string ServiceAccountUser { get; } string? ServiceAccountUser { get; }
List<Native.SC_ACTION> FailureActions { get; } List<Native.SC_ACTION> FailureActions { get; }
TimeSpan ResetFailureAfter { get; } TimeSpan ResetFailureAfter { get; }

View File

@ -634,19 +634,17 @@ namespace winsw
protected string? AllowServiceLogon => GetServiceAccountPart("allowservicelogon"); protected string? AllowServiceLogon => GetServiceAccountPart("allowservicelogon");
// ReSharper disable once InconsistentNaming protected string? ServiceAccountDomain => GetServiceAccountPart("domain");
protected string? serviceAccountDomain => GetServiceAccountPart("domain");
// ReSharper disable once InconsistentNaming protected string? ServiceAccountName => GetServiceAccountPart("user");
protected string? serviceAccountName => GetServiceAccountPart("user");
public string? ServiceAccountPassword => GetServiceAccountPart("password"); public string? ServiceAccountPassword => GetServiceAccountPart("password");
public string ServiceAccountUser => (serviceAccountDomain ?? "NULL") + @"\" + (serviceAccountName ?? "NULL"); public string? ServiceAccountUser => ServiceAccountName is null ? null : (ServiceAccountDomain ?? ".") + "\\" + ServiceAccountName;
public bool HasServiceAccount() public bool HasServiceAccount()
{ {
return !string.IsNullOrEmpty(serviceAccountDomain) && !string.IsNullOrEmpty(serviceAccountName); return !string.IsNullOrEmpty(ServiceAccountName);
} }
public bool AllowServiceAcountLogonRight public bool AllowServiceAcountLogonRight