public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* csih patch
@ 2011-02-07 16:40 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2011-02-07 16:40 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-07 16:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-07 16:40 csih patch Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).