summaryrefslogtreecommitdiff
path: root/contrib/solaris
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-07-15 18:49:20 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-07-15 18:49:20 +0000
commit104c3feb6999556db85283a8ba7ac1f8c38b5609 (patch)
tree42a2b2d0d3e516c595f74b742ece297a1d63a9c6 /contrib/solaris
parent938b8285661f56181405b8c1637b31bf7b618de0 (diff)
- (bal) Privsep user creation support in Solaris buildpkg.sh by
dtucker@zip.com.au
Diffstat (limited to 'contrib/solaris')
-rwxr-xr-xcontrib/solaris/buildpkg.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/solaris/buildpkg.sh b/contrib/solaris/buildpkg.sh
index 426db1f6a..def325b87 100755
--- a/contrib/solaris/buildpkg.sh
+++ b/contrib/solaris/buildpkg.sh
@@ -98,6 +98,19 @@ do
98 eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2` 98 eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2`
99done 99done
100 100
101
102## Collect value of privsep user
103for confvar in SSH_PRIVSEP_USER
104do
105 eval $confvar=`awk '/#define[ \t]'$confvar'/{print $3}' config.h`
106done
107
108## Set privsep defaults if not defined
109if [ -z "$SSH_PRIVSEP_USER" ]
110then
111 SSH_PRIVSEP_USER=sshd
112fi
113
101## Extract common info requires for the 'info' part of the package. 114## Extract common info requires for the 'info' part of the package.
102VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//'` 115VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//'`
103 116
@@ -214,6 +227,33 @@ fi
214 227
215installf -f ${PKGNAME} 228installf -f ${PKGNAME}
216 229
230if egrep '^[ \t]*UsePrivilegeSeparation[ \t]+no' $sysconfdir/sshd_config >/dev/null
231then
232 echo "UsePrivilegeSeparation disabled in config, not creating PrivSep user"
233 echo "or group."
234else
235 echo "UsePrivilegeSeparation enabled in config (or defaulting to on)."
236
237 # create group if required
238 if cut -f1 -d: /etc/group | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
239 then
240 echo "PrivSep group $SSH_PRIVSEP_USER already exists."
241 else
242 echo "Creating PrivSep group $SSH_PRIVSEP_USER."
243 groupadd $SSH_PRIVSEP_USER
244 fi
245
246 # Create user if required
247 if cut -f1 -d: /etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
248 then
249 echo "PrivSep user $SSH_PRIVSEP_USER already exists."
250 else
251 echo "Creating PrivSep user $SSH_PRIVSEP_USER."
252 useradd -c 'SSHD PrivSep User' -s /bin/false -g $SSH_PRIVSEP_USER $SSH_PRIVSEP_USER
253 passwd -l $SSH_PRIVSEP_USER
254 fi
255fi
256
217[ "\${POST_INS_START}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start 257[ "\${POST_INS_START}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start
218exit 0 258exit 0
219_EOF 259_EOF