X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=settings.cpp;h=11984bc1735b1ecdcf6c49f6e321317547cabc25;hb=71764fe41e37f36bcbc89ac62f664aeda4240790;hp=f7346cbdd036b8d6d4833ce435782824995a84b0;hpb=2f3ab42db3d63e674e520a68fe507119af519288;p=nssm.git diff --git a/settings.cpp b/settings.cpp index f7346cb..11984bc 100644 --- a/settings.cpp +++ b/settings.cpp @@ -1074,6 +1074,7 @@ int native_set_objectname(const TCHAR *service_name, void *param, const TCHAR *n That means the username is actually passed in the additional parameter. */ bool localsystem = false; + bool virtual_account = false; TCHAR *username = NSSM_LOCALSYSTEM_ACCOUNT; TCHAR *password = 0; if (additional) { @@ -1089,6 +1090,7 @@ int native_set_objectname(const TCHAR *service_name, void *param, const TCHAR *n username = (TCHAR *) well_known; password = _T(""); } + else if (is_virtual_account(service_name, username)) virtual_account = true; else if (! password) { /* We need a password if the account requires it. */ print_message(stderr, NSSM_MESSAGE_MISSING_PASSWORD, name); @@ -1112,7 +1114,7 @@ int native_set_objectname(const TCHAR *service_name, void *param, const TCHAR *n HeapFree(GetProcessHeap(), 0, qsc); } - if (! well_known) { + if (! well_known && ! virtual_account) { if (grant_logon_as_service(username)) { if (passwordsize) SecureZeroMemory(password, passwordsize); print_message(stderr, NSSM_MESSAGE_GRANT_LOGON_AS_SERVICE_FAILED, username);