public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: csih patch
Date: Mon, 07 Feb 2011 16:40:00 -0000	[thread overview]
Message-ID: <20110207164035.GE24247@calimero.vinschen.de> (raw)

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

                 reply	other threads:[~2011-02-07 16:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110207164035.GE24247@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).