summaryrefslogtreecommitdiff
path: root/contrib/solaris
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/solaris')
-rw-r--r--contrib/solaris/README2
-rwxr-xr-xcontrib/solaris/buildpkg.sh58
-rwxr-xr-xcontrib/solaris/opensshd.in16
3 files changed, 38 insertions, 38 deletions
diff --git a/contrib/solaris/README b/contrib/solaris/README
index 9b0a46e29..eb4c590f4 100644
--- a/contrib/solaris/README
+++ b/contrib/solaris/README
@@ -17,7 +17,7 @@ Directions:
17 17
18If all goes well you should have a solaris package ready to be installed. 18If all goes well you should have a solaris package ready to be installed.
19 19
20If you have any problems with this script please post them to 20If you have any problems with this script please post them to
21openssh-unix-dev@mindrot.org and I will try to assist you as best as I can. 21openssh-unix-dev@mindrot.org and I will try to assist you as best as I can.
22 22
23- Ben Lindstrom 23- Ben Lindstrom
diff --git a/contrib/solaris/buildpkg.sh b/contrib/solaris/buildpkg.sh
index c41b3f963..55203d7d5 100755
--- a/contrib/solaris/buildpkg.sh
+++ b/contrib/solaris/buildpkg.sh
@@ -5,7 +5,7 @@
5# The following code has been provide under Public Domain License. I really 5# The following code has been provide under Public Domain License. I really
6# don't care what you use it for. Just as long as you don't complain to me 6# don't care what you use it for. Just as long as you don't complain to me
7# nor my employer if you break it. - Ben Lindstrom (mouring@eviladmin.org) 7# nor my employer if you break it. - Ben Lindstrom (mouring@eviladmin.org)
8# 8#
9umask 022 9umask 022
10# 10#
11# Options for building the package 11# Options for building the package
@@ -13,7 +13,7 @@ umask 022
13# 13#
14# uncommenting TEST_DIR and using 14# uncommenting TEST_DIR and using
15# configure --prefix=/var/tmp --with-privsep-path=/var/tmp/empty 15# configure --prefix=/var/tmp --with-privsep-path=/var/tmp/empty
16# and 16# and
17# PKGNAME=tOpenSSH should allow testing a package without interfering 17# PKGNAME=tOpenSSH should allow testing a package without interfering
18# with a real OpenSSH package on a system. This is not needed on systems 18# with a real OpenSSH package on a system. This is not needed on systems
19# that support the -R option to pkgadd. 19# that support the -R option to pkgadd.
@@ -81,7 +81,7 @@ export PATH
81# we will look for config.local to override the above options 81# we will look for config.local to override the above options
82[ -s ./config.local ] && . ./config.local 82[ -s ./config.local ] && . ./config.local
83 83
84## Start by faking root install 84## Start by faking root install
85echo "Faking root install..." 85echo "Faking root install..."
86START=`pwd` 86START=`pwd`
87OPENSSHD_IN=`dirname $0`/opensshd.in 87OPENSSHD_IN=`dirname $0`/opensshd.in
@@ -98,20 +98,20 @@ fi
98## Fill in some details, like prefix and sysconfdir 98## Fill in some details, like prefix and sysconfdir
99for confvar in prefix exec_prefix bindir sbindir libexecdir datadir mandir sysconfdir piddir 99for confvar in prefix exec_prefix bindir sbindir libexecdir datadir mandir sysconfdir piddir
100do 100do
101 eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2` 101 eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2`
102done 102done
103 103
104 104
105## Collect value of privsep user 105## Collect value of privsep user
106for confvar in SSH_PRIVSEP_USER 106for confvar in SSH_PRIVSEP_USER
107do 107do
108 eval $confvar=`awk '/#define[ \t]'$confvar'/{print $3}' config.h` 108 eval $confvar=`awk '/#define[ \t]'$confvar'/{print $3}' config.h`
109done 109done
110 110
111## Set privsep defaults if not defined 111## Set privsep defaults if not defined
112if [ -z "$SSH_PRIVSEP_USER" ] 112if [ -z "$SSH_PRIVSEP_USER" ]
113then 113then
114 SSH_PRIVSEP_USER=sshd 114 SSH_PRIVSEP_USER=sshd
115fi 115fi
116 116
117## Extract common info requires for the 'info' part of the package. 117## Extract common info requires for the 'info' part of the package.
@@ -243,16 +243,16 @@ fi
243 243
244if egrep '^[ \t]*UsePrivilegeSeparation[ \t]+no' \${PKG_INSTALL_ROOT}/$sysconfdir/sshd_config >/dev/null 244if egrep '^[ \t]*UsePrivilegeSeparation[ \t]+no' \${PKG_INSTALL_ROOT}/$sysconfdir/sshd_config >/dev/null
245then 245then
246 echo "UsePrivilegeSeparation disabled in config, not creating PrivSep user" 246 echo "UsePrivilegeSeparation disabled in config, not creating PrivSep user"
247 echo "or group." 247 echo "or group."
248else 248else
249 echo "UsePrivilegeSeparation enabled in config (or defaulting to on)." 249 echo "UsePrivilegeSeparation enabled in config (or defaulting to on)."
250 250
251 # create group if required 251 # create group if required
252 if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null 252 if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
253 then 253 then
254 echo "PrivSep group $SSH_PRIVSEP_USER already exists." 254 echo "PrivSep group $SSH_PRIVSEP_USER already exists."
255 else 255 else
256 # Use gid of 67 if possible 256 # Use gid of 67 if possible
257 if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSHDGID'\$' >/dev/null 257 if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSHDGID'\$' >/dev/null
258 then 258 then
@@ -260,15 +260,15 @@ else
260 else 260 else
261 sshdgid="-g $SSHDGID" 261 sshdgid="-g $SSHDGID"
262 fi 262 fi
263 echo "Creating PrivSep group $SSH_PRIVSEP_USER." 263 echo "Creating PrivSep group $SSH_PRIVSEP_USER."
264 \$chroot /usr/sbin/groupadd \$sshdgid $SSH_PRIVSEP_USER 264 \$chroot /usr/sbin/groupadd \$sshdgid $SSH_PRIVSEP_USER
265 fi 265 fi
266 266
267 # Create user if required 267 # Create user if required
268 if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null 268 if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
269 then 269 then
270 echo "PrivSep user $SSH_PRIVSEP_USER already exists." 270 echo "PrivSep user $SSH_PRIVSEP_USER already exists."
271 else 271 else
272 # Use uid of 67 if possible 272 # Use uid of 67 if possible
273 if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSHDGID'\$' >/dev/null 273 if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSHDGID'\$' >/dev/null
274 then 274 then
@@ -276,10 +276,10 @@ else
276 else 276 else
277 sshduid="-u $SSHDUID" 277 sshduid="-u $SSHDUID"
278 fi 278 fi
279 echo "Creating PrivSep user $SSH_PRIVSEP_USER." 279 echo "Creating PrivSep user $SSH_PRIVSEP_USER."
280 \$chroot /usr/sbin/useradd -c 'SSHD PrivSep User' -s /bin/false -g $SSH_PRIVSEP_USER \$sshduid $SSH_PRIVSEP_USER 280 \$chroot /usr/sbin/useradd -c 'SSHD PrivSep User' -s /bin/false -g $SSH_PRIVSEP_USER \$sshduid $SSH_PRIVSEP_USER
281 \$chroot /usr/bin/passwd -l $SSH_PRIVSEP_USER 281 \$chroot /usr/bin/passwd -l $SSH_PRIVSEP_USER
282 fi 282 fi
283fi 283fi
284 284
285[ "\${POST_INS_START}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start 285[ "\${POST_INS_START}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start
@@ -358,12 +358,12 @@ cat >mk-proto.awk << _EOF
358 BEGIN { print "i pkginfo"; print "i preinstall"; \\ 358 BEGIN { print "i pkginfo"; print "i preinstall"; \\
359 print "i postinstall"; print "i preremove"; \\ 359 print "i postinstall"; print "i preremove"; \\
360 print "i request"; print "i space"; \\ 360 print "i request"; print "i space"; \\
361 split("$SYSTEM_DIR",sys_files); } 361 split("$SYSTEM_DIR",sys_files); }
362 { 362 {
363 for (dir in sys_files) { if ( \$3 != sys_files[dir] ) 363 for (dir in sys_files) { if ( \$3 != sys_files[dir] )
364 { \$5="root"; \$6="sys"; } 364 { \$5="root"; \$6="sys"; }
365 else 365 else
366 { \$4="?"; \$5="?"; \$6="?"; break;} 366 { \$4="?"; \$5="?"; \$6="?"; break;}
367 } } 367 } }
368 { print; } 368 { print; }
369_EOF 369_EOF
diff --git a/contrib/solaris/opensshd.in b/contrib/solaris/opensshd.in
index 48b6c5702..50e18deea 100755
--- a/contrib/solaris/opensshd.in
+++ b/contrib/solaris/opensshd.in
@@ -22,24 +22,24 @@ HOST_KEY_RSA=$etcdir/ssh_host_rsa_key
22 22
23checkkeys() { 23checkkeys() {
24 if [ ! -f $HOST_KEY_RSA1 ]; then 24 if [ ! -f $HOST_KEY_RSA1 ]; then
25 ${SSH_KEYGEN} -t rsa1 -f ${HOST_KEY_RSA1} -N "" 25 ${SSH_KEYGEN} -t rsa1 -f ${HOST_KEY_RSA1} -N ""
26 fi 26 fi
27 if [ ! -f $HOST_KEY_DSA ]; then 27 if [ ! -f $HOST_KEY_DSA ]; then
28 ${SSH_KEYGEN} -t dsa -f ${HOST_KEY_DSA} -N "" 28 ${SSH_KEYGEN} -t dsa -f ${HOST_KEY_DSA} -N ""
29 fi 29 fi
30 if [ ! -f $HOST_KEY_RSA ]; then 30 if [ ! -f $HOST_KEY_RSA ]; then
31 ${SSH_KEYGEN} -t rsa -f ${HOST_KEY_RSA} -N "" 31 ${SSH_KEYGEN} -t rsa -f ${HOST_KEY_RSA} -N ""
32 fi 32 fi
33} 33}
34 34
35stop_service() { 35stop_service() {
36 if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then 36 if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then
37 PID=`${CAT} ${PIDFILE}` 37 PID=`${CAT} ${PIDFILE}`
38 fi 38 fi
39 if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then 39 if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then
40 ${KILL} ${PID} 40 ${KILL} ${PID}
41 else 41 else
42 echo "Unable to read PID file" 42 echo "Unable to read PID file"
43 fi 43 fi
44} 44}
45 45
@@ -55,8 +55,8 @@ start_service() {
55 55
56 sshd_rc=$? 56 sshd_rc=$?
57 if [ $sshd_rc -ne 0 ]; then 57 if [ $sshd_rc -ne 0 ]; then
58 echo "$0: Error ${sshd_rc} starting ${SSHD}... bailing." 58 echo "$0: Error ${sshd_rc} starting ${SSHD}... bailing."
59 exit $sshd_rc 59 exit $sshd_rc
60 fi 60 fi
61 echo done. 61 echo done.
62} 62}