Re: Testers for new ssh-*-config scripts wanted!

2003-11-03 Thread Corinna Vinschen
On Mon, Nov 03, 2003 at 09:38:16AM +0100, Philippe Torche wrote:
> Sorry but,
> 
> The doc of bash explains this behavior (help read). You can experiment the
> same think on Redhat per exemple. And don't forget to use "echo $_cygwin |
> od -t x1" to show what is stored in the variable.

I did, of course.  Backspace works w/o -e, too.

I'll use -e nevertheless to allow complete readline support.

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.

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



RE: Testers for new ssh-*-config scripts wanted!

2003-11-03 Thread Philippe Torche
Sorry but,

The doc of bash explains this behavior (help read). You can experiment the
same think on Redhat per exemple. And don't forget to use "echo $_cygwin |
od -t x1" to show what is stored in the variable.

Have a nice cygweek, Philippe.

> -Message d'origine-
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> De la part de Corinna Vinschen
> Envoyé : vendredi, 31. octobre 2003 18:24
> À : [EMAIL PROTECTED]
> Objet : Re: Testers for new ssh-*-config scripts wanted!
> 
> On Fri, Oct 31, 2003 at 05:07:18PM +0100, Philippe Torche wrote:
> > Nope,
> > 
> > read from bash don't reconize control caracters without -e 
> parameter:
> > $ read _cygwin
> > Ntser[Backspace]c
> > $ echo $_cygwin | od -t x1
> > 000 6e 74 73 65 72 08 63 0a
> > 010
> > 
> > BUT OK with "-e"
> > 
> > $ read -e _cygwin
> > Ntser[Backspace]c
> > $ echo $_cygwin | od -t x1
> > 000 6e 74 73 65 63 0a
> > 006
> 
> Erm... when I use bash, read always recognizes the backspace 
> correctly.
> *dig dig dig*
> Even better, when using /bin/sh (ash), I don't have your 
> above problem either.  I can change the string and no control 
> code shows up in the variable's value.  What's different on 
> your machine?
Nothing !
> 
> Corinna
> 
> -- 
> Corinna Vinschen  Please, send mails 
> regarding Cygwin to
> Cygwin Developer
> mailto:[EMAIL PROTECTED]
> Red Hat, Inc.
> 
> --
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:   http://cygwin.com/problems.html
> Documentation: http://cygwin.com/docs.html
> FAQ:   http://cygwin.com/faq/
> 
> 


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



Re: Testers for new ssh-*-config scripts wanted!

2003-10-31 Thread Corinna Vinschen
On Fri, Oct 31, 2003 at 05:07:18PM +0100, Philippe Torche wrote:
> Nope,
> 
> read from bash don't reconize control caracters without -e parameter:
> $ read _cygwin
> Ntser[Backspace]c
> $ echo $_cygwin | od -t x1
> 000 6e 74 73 65 72 08 63 0a
> 010
> 
> BUT OK with "-e"
> 
> $ read -e _cygwin
> Ntser[Backspace]c
> $ echo $_cygwin | od -t x1
> 000 6e 74 73 65 63 0a
> 006

Erm... when I use bash, read always recognizes the backspace correctly.
*dig dig dig*
Even better, when using /bin/sh (ash), I don't have your above problem
either.  I can change the string and no control code shows up in the
variable's value.  What's different on your machine?

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.

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



RE: Testers for new ssh-*-config scripts wanted!

2003-10-31 Thread Philippe Torche
Nope,

read from bash don't reconize control caracters without -e parameter:
$ read _cygwin
Ntser[Backspace]c
$ echo $_cygwin | od -t x1
000 6e 74 73 65 72 08 63 0a
010

BUT OK with "-e"

$ read -e _cygwin
Ntser[Backspace]c
$ echo $_cygwin | od -t x1
000 6e 74 73 65 63 0a
006

Thanks, Philippe.

> -Message d'origine-
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> De la part de Corinna Vinschen
> Envoyé : vendredi, 31. octobre 2003 12:08
> À : [EMAIL PROTECTED]
> Objet : RE: Testers for new ssh-*-config scripts wanted!
> 
> On Fri, Oct 31, 2003 at 09:55:04AM +0100, Philippe Torche wrote:
> > Script ssh-host-config works for me, but when I've entered 
> the CYGWIN 
> > env var, I've do a error and type "ntser", then backspace 
> and then the 
> > correct "c" caracters.
> > Thus CYGWIN key in the registry has now "ntser\x08c" 
> instead of "ntsec"!
> > This is caused by the read command!
> 
> Yeah, but that's not a fault of the script but of the shell.  
> Nothing I can do about in the script.  Except if I require 
> the script to run under bash instead of sh, to allow readline support.
> 
> Would that be acceptable?  I have attached a new version of 
> ssh-host-config to this mail, which requires bash now.  If 
> that's not ok, it's easy to revert again.
> 
> I've also attached the two vanilla files ssh_config and 
> sshd_config to put into /etc/defaults/etc. This should 
> simplify testing.
> 
> Changed in this version of ssh-host-config:
> 
> - Require bash.
> - Remove annoying backslashes when echoing a bang (!).
> - Allow /var/log/lastlog to be a directory (But that can again create
>   problems with permissions, Pierre!)
> 
> Please don't forget to test ssh-user-config, too.  Thanks.
> 
> > PS Wait for a "Windows 2003 Server" version
> 
> You know, PGA and PTC.  See wtf ;-)
> 
> Thanks to all testers,
> Corinna
> 
> -- 
> Corinna Vinschen  Please, send mails 
> regarding Cygwin to
> Cygwin Developer
> mailto:[EMAIL PROTECTED]
> Red Hat, Inc.
> 


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



RE: Testers for new ssh-*-config scripts wanted!

2003-10-31 Thread Corinna Vinschen
On Fri, Oct 31, 2003 at 09:55:04AM +0100, Philippe Torche wrote:
> Script ssh-host-config works for me, but when I've entered the CYGWIN env
> var, I've do a error and type "ntser", then backspace and then the correct
> "c" caracters.
> Thus CYGWIN key in the registry has now "ntser\x08c" instead of "ntsec"!
> This is caused by the read command!

Yeah, but that's not a fault of the script but of the shell.  Nothing
I can do about in the script.  Except if I require the script to run
under bash instead of sh, to allow readline support.

Would that be acceptable?  I have attached a new version of ssh-host-config
to this mail, which requires bash now.  If that's not ok, it's easy to
revert again.

I've also attached the two vanilla files ssh_config and sshd_config to
put into /etc/defaults/etc. This should simplify testing.

Changed in this version of ssh-host-config:

- Require bash.
- Remove annoying backslashes when echoing a bang (!).
- Allow /var/log/lastlog to be a directory (But that can again create
  problems with permissions, Pierre!)

Please don't forget to test ssh-user-config, too.  Thanks.

> PS Wait for a "Windows 2003 Server" version

You know, PGA and PTC.  See wtf ;-)

Thanks to all testers,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.
#!/bin/bash
#
# ssh-host-config, Copyright 2000, 2001, 2002, 2003 Red Hat Inc.
#
# This file is part of the Cygwin port of OpenSSH.

# Subdirectory where the new package is being installed
PREFIX=/usr

# Directory where the config files are stored
SYSCONFDIR=/etc
LOCALSTATEDIR=/var

progname=$0
auto_answer=""
port_number=22

privsep_configured=no
privsep_used=yes
sshd_in_passwd=no
sshd_in_sam=no

request()
{
  if [ "${auto_answer}" = "yes" ]
  then
return 0
  elif [ "${auto_answer}" = "no" ]
  then
return 1
  fi

  answer=""
  while [ "X${answer}" != "Xyes" -a "X${answer}" != "Xno" ]
  do
echo -n "$1 (yes/no) "
read answer
  done
  if [ "X${answer}" = "Xyes" ]
  then
return 0
  else
return 1
  fi
}

# Check options

while :
do
  case $# in
  0)
break
;;
  esac

  option=$1
  shift

  case "$option" in
  -d | --debug )
set -x
;;

  -y | --yes )
auto_answer=yes
;;

  -n | --no )
auto_answer=no
;;

  -p | --port )
port_number=$1
shift
;;

  *)
echo "usage: ${progname} [OPTION]..."
echo
echo "This script creates an OpenSSH host configuration."
echo
echo "Options:"
echo "--debug  -d Enable shell's debug output."
echo "--yes-y Answer all questions with \"yes\" automatically."
echo "--no -n Answer all questions with \"no\" automatically."
echo "--port   -p  sshd listens on port n."
echo
exit 1
;;

  esac
done

# Check if running on NT
_sys="`uname -a`"
_nt=`expr "$_sys" : "CYGWIN_NT"`

# Check for running ssh/sshd processes first. Refuse to do anything while
# some ssh processes are still running

if ps -ef | grep -v grep | grep -q ssh
then
  echo
  echo "There are still ssh processes running. Please shut them down first."
  echo
  exit 1
fi

# Check for ${SYSCONFDIR} directory

if [ -e "${SYSCONFDIR}" -a ! -d "${SYSCONFDIR}" ]
then
  echo
  echo "${SYSCONFDIR} is existant but not a directory."
  echo "Cannot create global configuration files."
  echo
  exit 1
fi

# Create it if necessary

if [ ! -e "${SYSCONFDIR}" ]
then
  mkdir "${SYSCONFDIR}"
  if [ ! -e "${SYSCONFDIR}" ]
  then
echo
echo "Creating ${SYSCONFDIR} directory failed"
echo
exit 1
  fi
fi

# Create /var/log and /var/log/lastlog if not already existing

if [ -f ${LOCALSTATEDIR}/log ]
then
  echo "Creating ${LOCALSTATEDIR}/log failed!"
else
  if [ ! -d ${LOCALSTATEDIR}/log ]
  then
mkdir -p ${LOCALSTATEDIR}/log
  fi
  if [ -d ${LOCALSTATEDIR}/log/lastlog ]
  then
chmod 777 ${LOCALSTATEDIR}/log/lastlog
  elif [ ! -f ${LOCALSTATEDIR}/log/lastlog ]
  then
cat /dev/null > ${LOCALSTATEDIR}/log/lastlog
chmod 666 ${LOCALSTATEDIR}/log/lastlog
  fi
fi

# Create /var/empty file used as chroot jail for privilege separation
if [ -f ${LOCALSTATEDIR}/empty ]
then
  echo "Creating ${LOCALSTATEDIR}/empty failed!"
else
  mkdir -p ${LOCALSTATEDIR}/empty
  if [ $_nt -gt 0 ]
  then
chmod 755 ${LOCALSTATEDIR}/empty
  fi
fi

# First generate host keys if not already existing

if [ ! -f "${SYSCONFDIR}/ssh_host_key" ]
then
  echo "Generating ${SYSCONFDIR}/ssh_host_key"
  ssh-keygen -t rsa1 -f ${SYSCONFDIR}/ssh_host_key -N '' > /dev/null
fi

if [ ! -f "${SYSCONFDIR}/ssh_host_rsa_key" ]
then
  echo "Generating ${SYSCONFDIR}/ssh_host_rsa_key"
  ssh-keygen -t rsa -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' > /dev/null
fi

if [ ! -f "${SYSCONFDIR}/ssh_host_dsa_key" ]
then
  echo "Generating ${SYSCONFDIR}/ssh_host_dsa_key"
  ssh-keygen -t dsa -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' > /dev/null
fi

# Check if ssh_config exists. I

RE: Testers for new ssh-*-config scripts wanted!

2003-10-31 Thread Philippe Torche
Script ssh-host-config works for me, but when I've entered the CYGWIN env
var, I've do a error and type "ntser", then backspace and then the correct
"c" caracters.
Thus CYGWIN key in the registry has now "ntser\x08c" instead of "ntsec"!
This is caused by the read command!

Thanks.

PS Wait for a "Windows 2003 Server" version

> -Message d'origine-
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> De la part de Corinna Vinschen
> Envoyé : jeudi, 30. octobre 2003 18:11
> À : [EMAIL PROTECTED]
> Objet : Testers for new ssh-*-config scripts wanted!
> 
> Hi,
> 
> is anybody here willing to give my new ssh-host-config and 
> ssh-user-config shell scripts a thorough test?  I tested them 
> by myself but I have this nagging feeling I missed something 
> important.
> 
> The important changes:
> 
> - On NT, try to set permissions on files and directories to a 
> useful value.
> - On NT, try to set ownership on files and directories to a 
> useful value.
> 
> Only in ssh-host-config:
> 
> - Write the /etc/services entries for ssh now with CRLF lineendings.
> - Remove the code to accomplish old style installations, with "old
>   being older than roughly 3 years.
> - /etc/ssh_config and /etc/sshd_config are not hardcoded here-scripts
>   in the ssh-host-config script anymore, but they are copied and
>   modified from ssh_config and sshd_config files in /etc/defaults/etc.
>   This allows to accomodate changes in the vanilla scripts without
>   having to change the shh-host-config script.
> - On NT, always set ownership of various files to SYSTEM, if sshd
>   has been installed as service.
> 
> Both scripts are attached.  When testing the new "copy config 
> files from /etc/defaults/etc" functionality, please think of 
> copying the ssh_config and sshd_config files (if possible the 
> vanilla versions) to /etc/defaults/etc first.
> 
> Feedback and patches welcome and thanks in advance, Corinna
> 
> -- 
> Corinna Vinschen  Please, send mails 
> regarding Cygwin to
> Cygwin Developer
> mailto:[EMAIL PROTECTED]
> Red Hat, Inc.
> 


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



RE: Testers for new ssh-*-config scripts wanted!

2003-10-30 Thread Harig, Mark
OK.  Thanks!  I will extract the contents
of the here documents and put them in
/etc/defaults/etc/sshd_config and 
/etc/defaults/etc/ssh_config.  I don't
trust my files in /etc/ to be vanilla
at this point.

> -Original Message-
> From: Brian Ford [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 30, 2003 5:35 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Testers for new ssh-*-config scripts wanted!
> 
> 
> On Thu, 30 Oct 2003, Harig, Mark wrote:
> 
> > I have OpenSSH 3.7.1p2-1 installed, but I
> > do not have the 'ssh_config' or 'sshd_config'
> > template files that the 'ssh-host-config' script
> > expects.  Am I missing a step here that I should
> > have taken to generate these files?
> >
> Yes, see:
> 
> > Corinna Vinschen wrote:
> > > Both scripts are attached.  When testing the new "copy 
> config files
> > > from /etc/defaults/etc" functionality, please think of copying the
> > > ssh_config and sshd_config files (if possible the vanilla 
> versions)
> > > to /etc/defaults/etc first.
> > >
> She meant the ones you would have in /etc if you had previously
> run the old ssh-host-config script.  If you had not, they can be found
> embeded in the old ssh-host-config script as mentioned here:
> 
> > > - /etc/ssh_config and /etc/sshd_config are not hardcoded 
> here-scripts
> > >   in the ssh-host-config script anymore, but they are copied and
> > >   modified from ssh_config and sshd_config files in 
> /etc/defaults/etc.
> > >   This allows to accomodate changes in the vanilla scripts without
> > >   having to change the shh-host-config script.
> > >
> 
> -- 
> Brian Ford
> Senior Realtime Software Engineer
> VITAL - Visual Simulation Systems
> FlightSafety International
> Phone: 314-551-8460
> Fax:   314-551-8444
> 
> --
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:   http://cygwin.com/problems.html
> Documentation: http://cygwin.com/docs.html
> FAQ:   http://cygwin.com/faq/
> 
> 

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



RE: Testers for new ssh-*-config scripts wanted!

2003-10-30 Thread Brian Ford
On Thu, 30 Oct 2003, Harig, Mark wrote:

> I have OpenSSH 3.7.1p2-1 installed, but I
> do not have the 'ssh_config' or 'sshd_config'
> template files that the 'ssh-host-config' script
> expects.  Am I missing a step here that I should
> have taken to generate these files?
>
Yes, see:

> Corinna Vinschen wrote:
> > Both scripts are attached.  When testing the new "copy config files
> > from /etc/defaults/etc" functionality, please think of copying the
> > ssh_config and sshd_config files (if possible the vanilla versions)
> > to /etc/defaults/etc first.
> >
She meant the ones you would have in /etc if you had previously
run the old ssh-host-config script.  If you had not, they can be found
embeded in the old ssh-host-config script as mentioned here:

> > - /etc/ssh_config and /etc/sshd_config are not hardcoded here-scripts
> >   in the ssh-host-config script anymore, but they are copied and
> >   modified from ssh_config and sshd_config files in /etc/defaults/etc.
> >   This allows to accomodate changes in the vanilla scripts without
> >   having to change the shh-host-config script.
> >

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

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



RE: Testers for new ssh-*-config scripts wanted!

2003-10-30 Thread Harig, Mark
I have OpenSSH 3.7.1p2-1 installed, but I
do not have the 'ssh_config' or 'sshd_config'
template files that the 'ssh-host-config' script
expects.  Am I missing a step here that I should
have taken to generate these files?

I ran 'cygcheck -f /etc/defaults/etc/ssh_config'
and searched the Cygwin Package List at
http://cygwin.com/packages, but both searches
did not find any packages that should contain these
template files.

> -Original Message-
> From: Corinna Vinschen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 30, 2003 12:11 PM
> To: [EMAIL PROTECTED]
> Subject: Testers for new ssh-*-config scripts wanted!
> 
> 
> Hi,
> 
> is anybody here willing to give my new ssh-host-config and 
> ssh-user-config
> shell scripts a thorough test?  I tested them by myself but I 
> have this
> nagging feeling I missed something important.
> 
> The important changes:
> 
> - On NT, try to set permissions on files and directories to a 
> useful value.
> - On NT, try to set ownership on files and directories to a 
> useful value.
> 
> Only in ssh-host-config:
> 
> - Write the /etc/services entries for ssh now with CRLF lineendings.
> - Remove the code to accomplish old style installations, with "old
>   being older than roughly 3 years.
> - /etc/ssh_config and /etc/sshd_config are not hardcoded here-scripts
>   in the ssh-host-config script anymore, but they are copied and
>   modified from ssh_config and sshd_config files in /etc/defaults/etc.
>   This allows to accomodate changes in the vanilla scripts without
>   having to change the shh-host-config script.
> - On NT, always set ownership of various files to SYSTEM, if sshd
>   has been installed as service.
> 
> Both scripts are attached.  When testing the new "copy config files
> from /etc/defaults/etc" functionality, please think of copying the
> ssh_config and sshd_config files (if possible the vanilla versions)
> to /etc/defaults/etc first.
> 
> Feedback and patches welcome and thanks in advance,
> Corinna
> 
> -- 
> Corinna Vinschen  Please, send mails 
> regarding Cygwin to
> Cygwin Developer
> mailto:[EMAIL PROTECTED]
> Red Hat, Inc.
> 

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



RE: Testers for new ssh-*-config scripts wanted!

2003-10-30 Thread Harig, Mark
I will read these two scripts "soon".
This won't be a thorough test, but it
will be another set of eyes reading the
code.

Of course, a much better candidate for
reading (and testing the scripts would
be someone who is knowledgeable about
OpenSSH.  I'm simply a user of it.

> -Original Message-
> From: Corinna Vinschen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 30, 2003 12:11 PM
> To: [EMAIL PROTECTED]
> Subject: Testers for new ssh-*-config scripts wanted!
> 
> 
> Hi,
> 
> is anybody here willing to give my new ssh-host-config and 
> ssh-user-config
> shell scripts a thorough test?  I tested them by myself but I 
> have this
> nagging feeling I missed something important.
> 
> The important changes:
> 
> - On NT, try to set permissions on files and directories to a 
> useful value.
> - On NT, try to set ownership on files and directories to a 
> useful value.
> 
> Only in ssh-host-config:
> 
> - Write the /etc/services entries for ssh now with CRLF lineendings.
> - Remove the code to accomplish old style installations, with "old
>   being older than roughly 3 years.
> - /etc/ssh_config and /etc/sshd_config are not hardcoded here-scripts
>   in the ssh-host-config script anymore, but they are copied and
>   modified from ssh_config and sshd_config files in /etc/defaults/etc.
>   This allows to accomodate changes in the vanilla scripts without
>   having to change the shh-host-config script.
> - On NT, always set ownership of various files to SYSTEM, if sshd
>   has been installed as service.
> 
> Both scripts are attached.  When testing the new "copy config files
> from /etc/defaults/etc" functionality, please think of copying the
> ssh_config and sshd_config files (if possible the vanilla versions)
> to /etc/defaults/etc first.
> 
> Feedback and patches welcome and thanks in advance,
> Corinna
> 
> -- 
> Corinna Vinschen  Please, send mails 
> regarding Cygwin to
> Cygwin Developer
mailto:[EMAIL PROTECTED]
Red Hat, Inc.

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