X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-IronPortListener: Outbound_SMTP X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhkLACodwlCcKEeq/2dsb2JhbABEhjW3Em8WbAeCHgEBAQMBEhERSgsCAQgNDQIGCxUCAgIdExUCAQ0BAQQbGodpBgylMIoHklqBIowrgiIyYQONOIlphHGKO4JzgiI From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" To: "cygwin AT cygwin DOT com" Subject: RE: Cygrunsrv and special Windows virtual accounts "NT SERVICE" Date: Fri, 7 Dec 2012 16:49:34 +0000 Message-ID: <5F8AAC04F9616747BC4CC0E803D5907D043FCF9B@MLBXv04.nih.gov> References: <5F8AAC04F9616747BC4CC0E803D5907D043FCB1D AT MLBXv04 DOT nih DOT gov> <20121207160028 DOT GA2374 AT calimero DOT vinschen DOT de> <5F8AAC04F9616747BC4CC0E803D5907D043FCEC7 AT MLBXv04 DOT nih DOT gov> In-Reply-To: <5F8AAC04F9616747BC4CC0E803D5907D043FCEC7@MLBXv04.nih.gov> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id qB7Go7aQ032757 > per the bad user/pass combo, presumably). Per MSDN, http://msdn.microsoft.com/en-us/library/windows/desktop/ms682450%28v=vs.85%29.aspx : If the account name specified by the lpServiceStartName parameter is the name of a managed service account or virtual account name, the lpPassword parameter must be NULL. But cygrunsrv passes either "" or the actual string (when any username is provided). It should pass NULL for the username that look like "NT SERVICE\svcname": if (!(sh = CreateService (sm, san.name (), disp, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS | (interactive ? SERVICE_INTERACTIVE_PROCESS : 0), type == Auto ? SERVICE_AUTO_START : SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, mypath, NULL, NULL, dependencies, username, username ? pass ?: "" : NULL))) Anton Lavrentiev Contractor NIH/NLM/NCBI