delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/06/07/07:58:19

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:to:subject:references
:in-reply-to:content-type; q=dns; s=default; b=HuZhJfiGOnEke5Cys
wVwJxmc1DU6xNfb7TcJtVBo0iB1H/C735FIXFTyqXQLv1ka/QqeRvJhZaX2B5gHc
8so/geyvXGZ8ljlZXYsc1x5QdiGk7+KT5Cabjcer6sFoKVPTD6V2zDjCWc6VcYsB
HxjI52mQUmChW9UgjL/FM25wx0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:to:subject:references
:in-reply-to:content-type; s=default; bh=HJ7I6IcShcU7mjwlqG84qDV
2M7g=; b=TRlBc+pTdI4EjJv5ZcZdMKq8RfeReLZc1ToD2bTJT5NG9aR24ot6INk
MesAuG4rIyU5YhEwFDhKCDZHBVR7E+yTeNq2pwVU6vBzqsc7v5o3GNbHQ98FEef+
GkTfpOc9PSLMkLTPIptubctzG6f+kBfPCBrfZ06oU9GPgYIIaqAw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-23.3 required=5.0 tests=AWL,BAYES_20,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Water, van, jh, JH
X-HELO: lb1-smtp-cloud2.xs4all.net
Date: Wed, 07 Jun 2017 13:57:58 +0200
Message-ID: <e254a19b71087a19d79291df5ca33b2e@smtp-cloud2.xs4all.net>
From: Houder <houder AT xs4all DOT nl>
To: cygwin AT cygwin DOT com
Subject: Re: Installing sshd on W7 reveals errors in CSIH_SCRIPT -- patch file against master
References: <c50589c74b974315dd7756109e270c74 AT xs4all DOT nl> <a2907cfe582879ff35f5357cf937c279 AT xs4all DOT nl> <20170607091501 DOT GB5971 AT calimero DOT vinschen DOT de>
In-Reply-to: <20170607091501.GB5971@calimero.vinschen.de>
User-Agent: mua.awk 0.99

On Wed, 7 Jun 2017 11:15:01, Corinna Vinschen wrote:
> --24zk1gE8NUlDmwG9
> Content-Type: text/plain; charset=utf-8
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
> 
> Hi Houder,
> 
> On May 27 14:01, Houder wrote:
> > On 2017-05-26 21:35, Houder wrote:
> > > Hi,
> > >=20
> > > Installing sshd on W7 reveals errors in CSIH_SCRIPT ...
> > >=20
> > > CSIH_SCRIPT =3D /usr/share/csih/cygwin-service-installation-helper.sh
> >=20
> > Retrieved CSIH_SCRIPT from the master (January 19 2017) here:
> >=20
> >     https://cygwin.com/git/?p=3Dcygwin-apps/csih.git;a=3Dsummary
> >=20
> > Attached patch file against master ...
> 
> Can you please recreate the patch with `git format-patch' and attach
> it to your reply?  That would be most helpful.

Sigh! ... it has been years and YEARS! since I exercised git. So I attempted
to do what you are asking for ...

 - cloned csih
 - branched
 - created TWO fixes in that branch
 - invoked 'git format-patch -n HEAD^^' # which is completely new to

Two files were created ... I included them here. Sufficient?

Regards,
Henri

-----

File 0001-Amend-prologue-of-csih_use_file_etc.patch:

From 2d96db1b32df33b142aa23afaa90ad21db74cc3d Mon Sep 17 00:00:00 2001
From: "J.H. van de Water" <houder AT xs4all DOT nl>
Date: Wed, 7 Jun 2017 13:28:21 +0200
Subject: [PATCH 1/2] Amend prologue of csih_use_file_etc

Prologue (bottom) of csih_use_file_etc should state:

    Returns 1 if files shall be used, 0 otherwise.

Currently it states the reverse.
---
 cygwin-service-installation-helper.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cygwin-service-installation-helper.sh b/cygwin-service-installation-helper.sh
index a0b6216..f291edc 100755
--- a/cygwin-service-installation-helper.sh
+++ b/cygwin-service-installation-helper.sh
@@ -2566,7 +2566,7 @@ readonly -f csih_old_cygwin
 #
 #     Otherwise, we need the files.
 #
-#   Returns 0 if files shall be used, 1 otherwise.
+#   Returns 1 if files shall be used, 0 otherwise.
 # ======================================================================
 csih_use_file_etc()
 {
-- 
2.7.5

-----

File 0002-Move-call-of-mkpasswd-UPwards-in-csih_create_privile.patch:

From d07d3a567f063d22c9eba381cbcc987b63a8eabb Mon Sep 17 00:00:00 2001
From: "J.H. van de Water" <houder AT xs4all DOT nl>
Date: Wed, 7 Jun 2017 13:36:27 +0200
Subject: [PATCH 2/2] Move call of mkpasswd UPwards in
 csih_create_privileged_user

Move call of mkpasswd UPwards in csih_create_privileged_user, and place it
before the 1st call of passwd.
---
 cygwin-service-installation-helper.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/cygwin-service-installation-helper.sh b/cygwin-service-installation-helper.sh
index f291edc..14a40c1 100755
--- a/cygwin-service-installation-helper.sh
+++ b/cygwin-service-installation-helper.sh
@@ -3003,6 +3003,12 @@ csih_create_privileged_user()
 	  csih_inform "the '${csih_PRIVILEGED_USERNAME}' account."
 	  echo ""
 
+          # If we use /etc account DB only, write new account to /etc/passwd
+          if csih_use_file_etc passwd
+          then
+            /usr/bin/mkpasswd -l -u "${csih_PRIVILEGED_USERNAME}" >> "${SYSCONFDIR}/passwd"
+          fi
+
 	  if ! passwd -e "${csih_PRIVILEGED_USERNAME}" >/dev/null
 	  then
 	    csih_warning "Setting password expiry for user '${csih_PRIVILEGED_USERNAME}' failed!"
@@ -3063,12 +3069,6 @@ csih_create_privileged_user()
         fi
       fi
 
-      # If we use /etc account DB only, write new account to /etc/passwd
-      if csih_use_file_etc passwd
-      then
-	/usr/bin/mkpasswd -l -u "${csih_PRIVILEGED_USERNAME}" >> "${SYSCONFDIR}/passwd"
-      fi
-
       return "${ret}"
     fi # ! username_in_sam
     return 1 # failed to create user (or prevented by auto-answer veto)
-- 
2.7.5

=====


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019