Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Complete the conversion back to the OpenSSH default configur...



details:   https://anonhg.NetBSD.org/src/rev/bf6f85d13089
branches:  trunk
changeset: 526246:bf6f85d13089
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Apr 29 08:23:34 2002 +0000

description:
Complete the conversion back to the OpenSSH default configuration files of
"/etc/ssh/ssh_config" (from "/etc/ssh/ssh.conf") for ssh(1) and other
userland tools, and "/etc/ssh/sshd_config (from "/etc/ssh/sshd.conf")
for sshd(8).

etc/postinstall will detect this, and if "fix" is given, rename the files.

diffstat:

 crypto/dist/ssh/pathnames.h |   6 +-
 crypto/dist/ssh/ssh.1       |  10 ++--
 crypto/dist/ssh/sshd.8      |   8 ++--
 distrib/sets/lists/etc/mi   |   6 +-
 etc/mtree/special           |   6 +-
 etc/postinstall             |  81 +++++++++++++++++++++++++++++++-------------
 etc/rc.d/sshd               |   4 +-
 usr.bin/ssh/Makefile        |   6 +-
 8 files changed, 79 insertions(+), 48 deletions(-)

diffs (truncated from 319 to 300 lines):

diff -r 28b0965b8200 -r bf6f85d13089 crypto/dist/ssh/pathnames.h
--- a/crypto/dist/ssh/pathnames.h       Mon Apr 29 07:28:27 2002 +0000
+++ b/crypto/dist/ssh/pathnames.h       Mon Apr 29 08:23:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pathnames.h,v 1.10 2002/04/22 07:59:41 itojun Exp $    */
+/*     $NetBSD: pathnames.h,v 1.11 2002/04/29 08:23:35 lukem Exp $     */
 /*     $OpenBSD: pathnames.h,v 1.12 2002/03/19 03:03:43 stevesk Exp $  */
 
 /*
@@ -29,8 +29,8 @@
  * Of these, ssh_host_key must be readable only by root, whereas ssh_config
  * should be world-readable.
  */
-#define _PATH_SERVER_CONFIG_FILE       SSHDIR "/sshd.conf"
-#define _PATH_HOST_CONFIG_FILE         SSHDIR "/ssh.conf"
+#define _PATH_SERVER_CONFIG_FILE       SSHDIR "/sshd_config"
+#define _PATH_HOST_CONFIG_FILE         SSHDIR "/ssh_config"
 #define _PATH_HOST_KEY_FILE            SSHDIR "/ssh_host_key"
 #define _PATH_HOST_DSA_KEY_FILE                SSHDIR "/ssh_host_dsa_key"
 #define _PATH_HOST_RSA_KEY_FILE                SSHDIR "/ssh_host_rsa_key"
diff -r 28b0965b8200 -r bf6f85d13089 crypto/dist/ssh/ssh.1
--- a/crypto/dist/ssh/ssh.1     Mon Apr 29 07:28:27 2002 +0000
+++ b/crypto/dist/ssh/ssh.1     Mon Apr 29 08:23:34 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ssh.1,v 1.19 2002/04/22 07:59:46 itojun Exp $
+.\"    $NetBSD: ssh.1,v 1.20 2002/04/29 08:23:35 lukem Exp $
 .\"  -*- nroff -*-
 .\"
 .\" Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
@@ -580,7 +580,7 @@
 Specifies an alternative per-user configuration file.
 If a configuration file is given on the command line,
 the system-wide configuration file
-.Pq Pa /etc/ssh/ssh.conf
+.Pq Pa /etc/ssh/ssh_config
 will be ignored.
 The default for the per-user configuration file is
 .Pa $HOME/.ssh/config .
@@ -655,7 +655,7 @@
 command line options, user's configuration file
 .Pq Pa $HOME/.ssh/config ,
 and system-wide configuration file
-.Pq Pa /etc/ssh/ssh.conf .
+.Pq Pa /etc/ssh/ssh_config .
 For each parameter, the first obtained value
 will be used.
 The configuration files contain sections bracketed by
@@ -1399,7 +1399,7 @@
 does not convert the user-supplied name to a canonical name before
 checking the key, because someone with access to the name servers
 would then be able to fool host authentication.
-.It Pa /etc/ssh/ssh.conf
+.It Pa /etc/ssh/ssh_config
 Systemwide configuration file.
 This file provides defaults for those
 values that are not specified in the user's configuration file, and
@@ -1504,7 +1504,7 @@
 in
 .Pa $HOME/.ssh/config
 or
-.Pa /etc/ssh.conf ,
+.Pa /etc/ssh_config ,
 you will need to change this (e.g. to
 .Dq Cm Cipher No 3des ) .
 Also, if you have private keys encrypted with IDEA, you will need to
diff -r 28b0965b8200 -r bf6f85d13089 crypto/dist/ssh/sshd.8
--- a/crypto/dist/ssh/sshd.8    Mon Apr 29 07:28:27 2002 +0000
+++ b/crypto/dist/ssh/sshd.8    Mon Apr 29 08:23:34 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sshd.8,v 1.24 2002/04/22 07:59:48 itojun Exp $
+.\"    $NetBSD: sshd.8,v 1.25 2002/04/29 08:23:35 lukem Exp $
 .\"  -*- nroff -*-
 .\"
 .\" Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
@@ -199,7 +199,7 @@
 .It Fl f Ar configuration_file
 Specifies the name of the configuration file.
 The default is
-.Pa /etc/ssh/sshd.conf .
+.Pa /etc/ssh/sshd_config .
 .Nm
 refuses to start if there is no configuration file.
 .It Fl g Ar login_grace_time
@@ -317,7 +317,7 @@
 .Sh CONFIGURATION FILE
 .Nm
 reads configuration data from
-.Pa /etc/ssh/sshd.conf
+.Pa /etc/ssh/sshd_config
 (or the file specified with
 .Fl f
 on the command line).
@@ -1177,7 +1177,7 @@
 .Ed
 .Sh FILES
 .Bl -tag -width Ds
-.It Pa /etc/ssh/sshd.conf
+.It Pa /etc/ssh/sshd_config
 Contains configuration data for
 .Nm sshd .
 This file should be writable by root only, but it is recommended
diff -r 28b0965b8200 -r bf6f85d13089 distrib/sets/lists/etc/mi
--- a/distrib/sets/lists/etc/mi Mon Apr 29 07:28:27 2002 +0000
+++ b/distrib/sets/lists/etc/mi Mon Apr 29 08:23:34 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.96 2002/04/26 15:46:13 lukem Exp $
+# $NetBSD: mi,v 1.97 2002/04/29 08:23:36 lukem Exp $
 ./.cshrc                               etc-util-etc
 ./.profile                             etc-util-etc
 ./dev/MAKEDEV.local                    etc-sys-etc
@@ -173,8 +173,8 @@
 ./etc/skel/.rhosts                     etc-sys-etc
 ./etc/skeykeys                         etc-sys-etc
 ./etc/spwd.db                          etc-sys-etc
-./etc/ssh/ssh.conf                     etc-secsh-etc
-./etc/ssh/sshd.conf                    etc-secsh-etc
+./etc/ssh/ssh_config                   etc-secsh-etc
+./etc/ssh/sshd_config                  etc-secsh-etc
 ./etc/sysctl.conf                      etc-sys-etc
 ./etc/syslog.conf                      etc-sys-etc
 ./etc/ttys                             etc-sys-etc
diff -r 28b0965b8200 -r bf6f85d13089 etc/mtree/special
--- a/etc/mtree/special Mon Apr 29 07:28:27 2002 +0000
+++ b/etc/mtree/special Mon Apr 29 08:23:34 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: special,v 1.56 2002/04/29 07:28:27 lukem Exp $
+#      $NetBSD: special,v 1.57 2002/04/29 08:23:35 lukem Exp $
 #      @(#)special     8.2 (Berkeley) 1/23/94
 #
 # Hand-crafted mtree specification for the dangerous files.
@@ -224,7 +224,7 @@
 ./etc/shosts.equiv             type=file mode=0600 optional
 ./etc/spwd.db                  type=file mode=0600 tags=exclude
 ./etc/ssh                      type=dir  mode=0755 optional
-./etc/ssh/ssh.conf             type=file mode=0644 optional
+./etc/ssh/ssh_config           type=file mode=0644 optional
 ./etc/ssh/ssh_host_dsa_key     type=file mode=0600 optional tags=nodiff
 ./etc/ssh/ssh_host_dsa_key.pub type=file mode=0644 optional
 ./etc/ssh/ssh_host_key         type=file mode=0600 optional tags=nodiff
@@ -233,7 +233,7 @@
 ./etc/ssh/ssh_host_rsa_key.pub type=file mode=0644 optional
 ./etc/ssh/ssh_known_hosts      type=file mode=0644 optional
 ./etc/ssh/ssh_known_hosts2     type=file mode=0644 optional
-./etc/ssh/sshd.conf            type=file mode=0644 optional
+./etc/ssh/sshd_config          type=file mode=0644 optional
 ./etc/sysctl.conf              type=file mode=0644
 ./etc/syslog.conf              type=file mode=0644
 ./etc/ttyaction                        type=file mode=0644 optional
diff -r 28b0965b8200 -r bf6f85d13089 etc/postinstall
--- a/etc/postinstall   Mon Apr 29 07:28:27 2002 +0000
+++ b/etc/postinstall   Mon Apr 29 08:23:34 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.5 2002/04/29 06:05:24 lukem Exp $
+# $NetBSD: postinstall,v 1.6 2002/04/29 08:23:35 lukem Exp $
 #
 # Copyright (c) 2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -164,6 +164,31 @@
        )
 }
 
+# move_file op src dest --
+#      check (op == "check") or move (op != "check") from src to dest.
+#      returns 0 if ok, 1 otherwise.
+#
+move_file()
+{
+       [ $# -eq 3 ] || err 2 "USAGE: move_file op src dest"
+       _fm_op=$1
+       _fm_src=$2
+       _fm_dest=$3
+
+       if [ -f "${_fm_src}" -a ! -f "${_fm_dest}" ]; then
+               if [ "${_fm_op}" = "check" ]; then
+                       msg "Move ${_fm_src} to ${_fm_dest}"
+                       return 1
+               fi
+               if ! mv ${_fm_src} ${_fm_dest}; then
+                       msg "Can't move ${_fm_src} to ${_fm_dest}"
+                       return 1
+               fi
+               msg "Moved ${_fm_src} to ${_fm_dest}"
+       fi
+       return 0
+}
+
 
 #
 #      items
@@ -267,45 +292,51 @@
        op=$1
 
        failed=0
-       _dest=${DEST_ETC}/ssh
-       if [ ! -d "${_dest}" ]; then
+       _etcssh=${DEST_ETC}/ssh
+       if [ ! -d "${_etcssh}" ]; then
                if [ "${op}" = "check" ]; then
-                       msg "${_dest} is not a directory"
+                       msg "${_etcssh} is not a directory"
                        failed=1
-               elif ! mkdir ${_dest} ; then
-                       msg "Can't create missing ${_dest}"
+               elif ! mkdir ${_etcssh} ; then
+                       msg "Can't create missing ${_etcssh}"
                        failed=1
                else
-                       msg "Missing ${_dest} created"
+                       msg "Missing ${_etcssh} created"
                fi
        fi
 
        if [ ${failed} -eq 0 ]; then
                for f in \
-                           sshd.conf ssh.conf \
                            ssh_known_hosts ssh_known_hosts2 \
                            ssh_host_dsa_key ssh_host_dsa_key.pub \
                            ssh_host_rsa_key ssh_host_rsa_key.pub \
                            ssh_host_key ssh_host_key.pub \
                    ; do
-                       fs=${DEST_ETC}/${f}
-                       fd=${_dest}/${f}
-                       if [ -f "${fs}" -a ! -f "${fd}" ]; then
-                               if [ "${op}" = "check" ]; then
-                                       msg "Move ${fs} to ${fd}"
-                                       failed=1
-                               elif ! mv ${fs} ${fd}; then
-                                       msg "Can't move ${fs} to ${fd}"
-                                       failed=1
-                               else
-                                       msg "Moved ${fs} to ${fd}"
-                               fi
+                       if ! move_file ${op} ${DEST_ETC}/${f} ${_etcssh}/${f};
+                       then
+                               failed=1
+                       fi
+               done
+               for f in sshd.conf ssh.conf ; do
+                               # /etc/ssh{,d}.conf -> /etc/ssh/ssh{,d}_config
+                       if ! move_file ${op} \
+                           ${DEST_ETC}/${f} ${_etcssh}/${f%.conf}_config ;
+                       then
+                               failed=1
+                       fi
+                               # /etc/ssh/ssh{,d}.conf -> ssh{,d}_config
+                       if ! move_file ${op} \
+                           ${_etcssh}/${f} ${_etcssh}/${f%.conf}_config ;
+                       then
+                               failed=1
                        fi
                done
        fi
 
-       if [ -f "${_dest}/sshd.conf" ]; then
-               sshdconf=${_dest}/sshd.conf
+       if [ -f "${_etcssh}/sshd_config" ]; then
+               sshdconf=${_etcssh}/sshd_config
+       elif [ -f "${_etcssh}/sshd.conf" ]; then
+               sshdconf=${_etcssh}/sshd.conf
        elif [ -f "${DEST_ETC}/sshd.conf" ]; then
                sshdconf=${DEST_ETC}/sshd.conf
        else
@@ -445,10 +476,10 @@
                        fi
                done
 
-               if [ "${op}" = "fix" ]; then
+               if [ "${op}" = "check" ]; then
+                       plural="checks"
+               else
                        plural="fixes"
-               else
-                       plural="checks"
                fi
 
                echo "${PROGNAME} ${plural} passed:${items_passed}"
diff -r 28b0965b8200 -r bf6f85d13089 etc/rc.d/sshd
--- a/etc/rc.d/sshd     Mon Apr 29 07:28:27 2002 +0000
+++ b/etc/rc.d/sshd     Mon Apr 29 08:23:34 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sshd,v 1.17 2002/04/29 05:55:06 lukem Exp $
+# $NetBSD: sshd,v 1.18 2002/04/29 08:23:34 lukem Exp $
 #
 
 # PROVIDE: sshd
@@ -12,7 +12,7 @@
 rcvar=$name
 command="/usr/sbin/${name}"
 pidfile="/var/run/${name}.pid"
-required_files="/etc/ssh/${name}.conf"
+required_files="/etc/ssh/sshd_config"
 extra_commands="keygen reload"
 
 sshd_keygen()
diff -r 28b0965b8200 -r bf6f85d13089 usr.bin/ssh/Makefile
--- a/usr.bin/ssh/Makefile      Mon Apr 29 07:28:27 2002 +0000



Home | Main Index | Thread Index | Old Index