From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3619 invoked by alias); 18 Jun 2018 11:07:59 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 2920 invoked by uid 9078); 18 Jun 2018 11:07:59 -0000 Date: Mon, 18 Jun 2018 11:07:00 -0000 Message-ID: <20180618110758.2741.qmail@sourceware.org> From: corinna@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [csih - Cygwin service installation helper, a helper script and tools to create service installation scripts] branch master, updated. v0_9_11-1-g20c23cd X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: b32074f66a5d2df1267b47d1e99b1fd299cde42b X-Git-Newrev: 20c23cd8e0d3e7c10f59d42fa9650c94628aef99 X-SW-Source: 2018-q2/txt/msg00010.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/csih.git;h=20c23cd8e0d3e7c10f59d42fa9650c94628aef99 commit 20c23cd8e0d3e7c10f59d42fa9650c94628aef99 Author: Takashi Yano Date: Sat Jun 16 19:13:52 2018 +0900 Fix the test of whether the computer is on a domain. * cygwin-service-installation-helper.sh (csih_select_rivileged_username): In the case logged in as a local user, csih failed to judge to be on a domain even if the computer is on a domain. This is because ${LOGSERVER,,*} has the same value as \\\\${COMPUTERNAME,,*}. The fix is done to use cygwin username returned by mkpasswd command to check it instead. Also, testing has been changed so that USERDOMAIN is used instead of LOGONSERVER because LOGONSERVER may not be set if "Run as administrator" is used. See the post below for more detail. https://cygwin.com/ml/cygwin/2018-06/msg00166.html Diff: --- cygwin-service-installation-helper.sh | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cygwin-service-installation-helper.sh b/cygwin-service-installation-helper.sh index abdb0ef..fbdff0d 100755 --- a/cygwin-service-installation-helper.sh +++ b/cygwin-service-installation-helper.sh @@ -2882,9 +2882,8 @@ csih_select_privileged_username() if ! csih_use_file_etc "passwd" then # This test succeeds on domain member machines only, not on DCs. - if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \ - -a "${LOGONSERVER}" != "" \ - -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ] + if [ "${USERDOMAIN,,*}" != "${COMPUTERNAME,,*}" \ + -o "$(/usr/bin/mkpasswd -c | /usr/bin/awk -F: '{print $1}')" = "${USERDOMAIN}+${USERNAME}" ] then # Lowercase of USERDOMAIN csih_PRIVILEGED_USERNAME="${COMPUTERNAME,,*}+${username}"