delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/02/07/11:41:04

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 7 Feb 2011 17:40:35 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: csih patch
Message-ID: <20110207164035.GE24247@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
MIME-Version: 1.0
User-Agent: Mutt/1.5.21 (2010-09-15)
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

Hi Chuck,


I'm trying to make the ssh-host-config script more foolproof.  While
doing that I found a problem in cygwin-service-installation-helper.sh
which disallowed ssh-host-config to react differently if certain
problems showed up.

The csih_install_config returns a value which indicates if the
installation was successful.  However, it also returns 1 if the user
said "no" to the question if an existing config file should be
overwritten.  This is not correct, because it disallows the calling
script to check for a problem.  The "no" answer is not a problem, but a
deliberate decision, so it should be treated as if everything's all
right.

Here's a patch to fix that:

--- cygwin-service-installation-helper.sh.ORIG	2011-02-07 17:27:14.749387200 +0100
+++ cygwin-service-installation-helper.sh	2011-02-07 17:27:43.344187200 +0100
@@ -1498,13 +1498,14 @@ csih_install_config()
 
   if [ -f "$dest" ]
   then
-    if csih_request "Overwrite existing ${dest} file?"
+    if ! csih_request "Overwrite existing ${dest} file?"
     then
-      rm -f "${dest}"
-      if [ -f "${dest}" ]
-      then
-        csih_warning "Can't overwrite. ${dest} is write protected."
-      fi
+      return 0
+    fi
+    rm -f "${dest}"
+    if [ -f "${dest}" ]
+    then
+      csih_warning "Can't overwrite. ${dest} is write protected."
     fi
   fi
 

Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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