diff options
-rw-r--r-- | .cvsignore | 1 | ||||
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Makefile.in | 13 | ||||
-rw-r--r-- | buildpkg.sh.in | 550 | ||||
-rw-r--r-- | configure.ac | 15 |
5 files changed, 579 insertions, 5 deletions
diff --git a/.cvsignore b/.cvsignore index 12de9ef50..e38a50bbd 100644 --- a/.cvsignore +++ b/.cvsignore | |||
@@ -20,5 +20,6 @@ ssh_prng_cmds | |||
20 | *.out | 20 | *.out |
21 | *.0 | 21 | *.0 |
22 | buildit.sh | 22 | buildit.sh |
23 | buildpkg.sh | ||
23 | autom4te.cache | 24 | autom4te.cache |
24 | ssh-rand-helper | 25 | ssh-rand-helper |
@@ -4,6 +4,9 @@ | |||
4 | - (dtucker) [auth-pam.c] Use an invalid password for root if | 4 | - (dtucker) [auth-pam.c] Use an invalid password for root if |
5 | PermitRootLogin != yes or the login is invalid, to prevent leaking | 5 | PermitRootLogin != yes or the login is invalid, to prevent leaking |
6 | information. Based on Openwall's owl-always-auth patch. ok djm@ | 6 | information. Based on Openwall's owl-always-auth patch. ok djm@ |
7 | - (tim) [configure.ac Makefile.in] Add support for "make package" ok djm@ | ||
8 | - (tim) [buildpkg.sh.in] New file. A more flexible version of | ||
9 | contrib/solaris/buildpkg.sh used for "make package". | ||
7 | 10 | ||
8 | 20040527 | 11 | 20040527 |
9 | - (dtucker) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec | 12 | - (dtucker) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec |
@@ -1170,4 +1173,4 @@ | |||
1170 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 1173 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
1171 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 1174 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
1172 | 1175 | ||
1173 | $Id: ChangeLog,v 1.3370 2004/05/30 12:04:56 dtucker Exp $ | 1176 | $Id: ChangeLog,v 1.3371 2004/05/31 04:38:51 tim Exp $ |
diff --git a/Makefile.in b/Makefile.in index 919b36819..45bf44823 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: Makefile.in,v 1.257 2004/02/18 03:35:11 djm Exp $ | 1 | # $Id: Makefile.in,v 1.258 2004/05/31 04:38:51 tim Exp $ |
2 | 2 | ||
3 | # uncomment if you run a non bourne compatable shell. Ie. csh | 3 | # uncomment if you run a non bourne compatable shell. Ie. csh |
4 | #SHELL = @SH@ | 4 | #SHELL = @SH@ |
@@ -201,10 +201,13 @@ clean: regressclean | |||
201 | distclean: regressclean | 201 | distclean: regressclean |
202 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log | 202 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log |
203 | rm -f *.out core | 203 | rm -f *.out core |
204 | rm -f Makefile config.h config.status ssh_prng_cmds *~ | 204 | rm -f Makefile buildpkg.sh config.h config.status ssh_prng_cmds *~ |
205 | rm -rf autom4te.cache | 205 | rm -rf autom4te.cache |
206 | (cd openbsd-compat && $(MAKE) distclean) | 206 | (cd openbsd-compat && $(MAKE) distclean) |
207 | (cd scard && $(MAKE) distclean) | 207 | (cd scard && $(MAKE) distclean) |
208 | if test -d pkg ; then \ | ||
209 | rm -fr pkg ; \ | ||
210 | fi | ||
208 | 211 | ||
209 | veryclean: distclean | 212 | veryclean: distclean |
210 | rm -f configure config.h.in *.0 | 213 | rm -f configure config.h.in *.0 |
@@ -407,3 +410,9 @@ regressclean: | |||
407 | if [ -f regress/Makefile -a -r regress/Makefile ]; then \ | 410 | if [ -f regress/Makefile -a -r regress/Makefile ]; then \ |
408 | (cd regress && $(MAKE) clean) \ | 411 | (cd regress && $(MAKE) clean) \ |
409 | fi | 412 | fi |
413 | |||
414 | package: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) | ||
415 | if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \ | ||
416 | sh buildpkg.sh; \ | ||
417 | fi | ||
418 | |||
diff --git a/buildpkg.sh.in b/buildpkg.sh.in new file mode 100644 index 000000000..656754c10 --- /dev/null +++ b/buildpkg.sh.in | |||
@@ -0,0 +1,550 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Fake Root Solaris/SVR4/SVR5 Build System - Prototype | ||
4 | # | ||
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 | ||
7 | # nor my employer if you break it. - Ben Lindstrom (mouring@eviladmin.org) | ||
8 | # | ||
9 | umask 022 | ||
10 | # | ||
11 | # Options for building the package | ||
12 | # You can create a openssh-config.local with your customized options | ||
13 | # | ||
14 | REMOVE_FAKE_ROOT_WHEN_DONE=yes | ||
15 | # | ||
16 | # uncommenting TEST_DIR and using | ||
17 | # configure --prefix=/var/tmp --with-privsep-path=/var/tmp/empty | ||
18 | # and | ||
19 | # PKGNAME=tOpenSSH should allow testing a package without interfering | ||
20 | # with a real OpenSSH package on a system. This is not needed on systems | ||
21 | # that support the -R option to pkgadd. | ||
22 | #TEST_DIR=/var/tmp # leave commented out for production build | ||
23 | PKGNAME=OpenSSH | ||
24 | SYSVINIT_NAME=opensshd | ||
25 | MAKE=${MAKE:="make"} | ||
26 | SSHDUID=67 # Default privsep uid | ||
27 | SSHDGID=67 # Default privsep gid | ||
28 | # uncomment these next three as needed | ||
29 | #PERMIT_ROOT_LOGIN=no | ||
30 | #X11_FORWARDING=yes | ||
31 | #USR_LOCAL_IS_SYMLINK=yes | ||
32 | # System V init run levels | ||
33 | SYSVINITSTART=S98 | ||
34 | SYSVINITSTOPT=K30 | ||
35 | # We will source these if they exist | ||
36 | POST_MAKE_INSTALL_FIXES=./pkg_post_make_install_fixes.sh | ||
37 | POST_PROTOTYPE_EDITS=./pkg-post-prototype-edit.sh | ||
38 | # We'll be one level deeper looking for these | ||
39 | PKG_PREINSTALL_LOCAL=../pkg-preinstall.local | ||
40 | PKG_POSTINSTALL_LOCAL=../pkg-postinstall.local | ||
41 | PKG_PREREMOVE_LOCAL=../pkg-preremove.local | ||
42 | PKG_POSTREMOVE_LOCAL=../pkg-postremove.local | ||
43 | PKG_REQUEST_LOCAL=../pkg-request.local | ||
44 | # end of sourced files | ||
45 | # | ||
46 | OPENSSHD_IN=@top_srcdir@/contrib/solaris/opensshd.in | ||
47 | |||
48 | PATH_GROUPADD_PROG=@PATH_GROUPADD_PROG@ | ||
49 | PATH_USERADD_PROG=@PATH_USERADD_PROG@ | ||
50 | PATH_PASSWD_PROG=@PATH_PASSWD_PROG@ | ||
51 | # | ||
52 | # list of system directories we do NOT want to change owner/group/perms | ||
53 | # when installing our package | ||
54 | SYSTEM_DIR="/etc \ | ||
55 | /etc/init.d \ | ||
56 | /etc/rcS.d \ | ||
57 | /etc/rc0.d \ | ||
58 | /etc/rc1.d \ | ||
59 | /etc/rc2.d \ | ||
60 | /etc/opt \ | ||
61 | /opt \ | ||
62 | /opt/bin \ | ||
63 | /usr \ | ||
64 | /usr/bin \ | ||
65 | /usr/lib \ | ||
66 | /usr/sbin \ | ||
67 | /usr/share \ | ||
68 | /usr/share/man \ | ||
69 | /usr/share/man/man1 \ | ||
70 | /usr/share/man/man8 \ | ||
71 | /usr/local \ | ||
72 | /usr/local/bin \ | ||
73 | /usr/local/etc \ | ||
74 | /usr/local/libexec \ | ||
75 | /usr/local/man \ | ||
76 | /usr/local/man/man1 \ | ||
77 | /usr/local/man/man8 \ | ||
78 | /usr/local/sbin \ | ||
79 | /usr/local/share \ | ||
80 | /var \ | ||
81 | /var/opt \ | ||
82 | /var/run \ | ||
83 | /var/tmp \ | ||
84 | /tmp" | ||
85 | |||
86 | # We may need to build as root so we make sure PATH is set up | ||
87 | # only set the path if it's not set already | ||
88 | [ -d /opt/bin ] && { | ||
89 | echo $PATH | grep ":/opt/bin" > /dev/null 2>&1 | ||
90 | [ $? -ne 0 ] && PATH=$PATH:/opt/bin | ||
91 | } | ||
92 | [ -d /usr/local/bin ] && { | ||
93 | echo $PATH | grep ":/usr/local/bin" > /dev/null 2>&1 | ||
94 | [ $? -ne 0 ] && PATH=$PATH:/usr/local/bin | ||
95 | } | ||
96 | [ -d /usr/ccs/bin ] && { | ||
97 | echo $PATH | grep ":/usr/ccs/bin" > /dev/null 2>&1 | ||
98 | [ $? -ne 0 ] && PATH=$PATH:/usr/ccs/bin | ||
99 | } | ||
100 | export PATH | ||
101 | # | ||
102 | |||
103 | [ -f Makefile ] || { | ||
104 | echo "Please run this script from your build directory" | ||
105 | exit 1 | ||
106 | } | ||
107 | |||
108 | # we will look for openssh-config.local to override the above options | ||
109 | [ -s ./openssh-config.local ] && . ./openssh-config.local | ||
110 | |||
111 | START=`pwd` | ||
112 | FAKE_ROOT=$START/pkg | ||
113 | |||
114 | ## Fill in some details, like prefix and sysconfdir | ||
115 | for confvar in prefix exec_prefix bindir sbindir libexecdir datadir mandir sysconfdir piddir srcdir | ||
116 | do | ||
117 | eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2` | ||
118 | done | ||
119 | |||
120 | |||
121 | ## Collect value of privsep user | ||
122 | for confvar in SSH_PRIVSEP_USER | ||
123 | do | ||
124 | eval $confvar=`awk '/#define[ \t]'$confvar'/{print $3}' config.h` | ||
125 | done | ||
126 | |||
127 | ## Set privsep defaults if not defined | ||
128 | if [ -z "$SSH_PRIVSEP_USER" ] | ||
129 | then | ||
130 | SSH_PRIVSEP_USER=sshd | ||
131 | fi | ||
132 | |||
133 | ## Extract common info requires for the 'info' part of the package. | ||
134 | VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//'` | ||
135 | |||
136 | ARCH=`uname -m` | ||
137 | DEF_MSG="\n" | ||
138 | OS_VER=`uname -v` | ||
139 | SCRIPT_SHELL=/sbin/sh | ||
140 | UNAME_S=`uname -s` | ||
141 | case ${UNAME_S} in | ||
142 | SunOS) UNAME_S=Solaris | ||
143 | ARCH=`uname -p` | ||
144 | RCS_D=yes | ||
145 | DEF_MSG="(default: n)" | ||
146 | ;; | ||
147 | SCO_SV) UNAME_S=OpenServer | ||
148 | OS_VER=`uname -X | grep Release | sed -e 's/^Rel.*3.2v//'` | ||
149 | SCRIPT_SHELL=/bin/sh | ||
150 | RC1_D=no | ||
151 | DEF_MSG="(default: n)" | ||
152 | ;; | ||
153 | esac | ||
154 | |||
155 | case `basename $0` in | ||
156 | buildpkg.sh) | ||
157 | ## Start by faking root install | ||
158 | echo "Faking root install..." | ||
159 | [ -d $FAKE_ROOT ] && rm -fr $FAKE_ROOT | ||
160 | mkdir $FAKE_ROOT | ||
161 | ${MAKE} install-nokeys DESTDIR=$FAKE_ROOT | ||
162 | if [ $? -gt 0 ] | ||
163 | then | ||
164 | echo "Fake root install failed, stopping." | ||
165 | exit 1 | ||
166 | fi | ||
167 | |||
168 | ## Setup our run level stuff while we are at it. | ||
169 | mkdir -p $FAKE_ROOT${TEST_DIR}/etc/init.d | ||
170 | |||
171 | ## setup our initscript correctly | ||
172 | sed -e "s#%%configDir%%#${sysconfdir}#g" \ | ||
173 | -e "s#%%openSSHDir%%#$prefix#g" \ | ||
174 | -e "s#%%pidDir%%#${piddir}#g" \ | ||
175 | ${OPENSSHD_IN} > $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} | ||
176 | chmod 744 $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} | ||
177 | |||
178 | [ "${PERMIT_ROOT_LOGIN}" = no ] && \ | ||
179 | perl -p -i -e "s/#PermitRootLogin yes/PermitRootLogin no/" \ | ||
180 | $FAKE_ROOT/${sysconfdir}/sshd_config | ||
181 | [ "${X11_FORWARDING}" = yes ] && \ | ||
182 | perl -p -i -e "s/#X11Forwarding no/X11Forwarding yes/" \ | ||
183 | $FAKE_ROOT/${sysconfdir}/sshd_config | ||
184 | # fix PrintMotd | ||
185 | perl -p -i -e "s/#PrintMotd yes/PrintMotd no/" \ | ||
186 | $FAKE_ROOT/${sysconfdir}/sshd_config | ||
187 | |||
188 | # We don't want to overwrite config files on multiple installs | ||
189 | mv $FAKE_ROOT/${sysconfdir}/ssh_config $FAKE_ROOT/${sysconfdir}/ssh_config.default | ||
190 | mv $FAKE_ROOT/${sysconfdir}/sshd_config $FAKE_ROOT/${sysconfdir}/sshd_config.default | ||
191 | [ -f $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds ] && \ | ||
192 | mv $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds $FAKE_ROOT/${sysconfdir}/ssh_prng_cmds.default | ||
193 | |||
194 | # local tweeks here | ||
195 | [ -s "${POST_MAKE_INSTALL_FIXES}" ] && . ${POST_MAKE_INSTALL_FIXES} | ||
196 | |||
197 | cd $FAKE_ROOT | ||
198 | |||
199 | ## Ok, this is outright wrong, but it will work. I'm tired of pkgmk | ||
200 | ## whining. | ||
201 | for i in *; do | ||
202 | PROTO_ARGS="$PROTO_ARGS $i=/$i"; | ||
203 | done | ||
204 | |||
205 | ## Build info file | ||
206 | echo "Building pkginfo file..." | ||
207 | cat > pkginfo << _EOF | ||
208 | PKG=$PKGNAME | ||
209 | NAME="OpenSSH Portable for ${UNAME_S}" | ||
210 | DESC="Secure Shell remote access utility; replaces telnet and rlogin/rsh." | ||
211 | VENDOR="OpenSSH Portable Team - http://www.openssh.com/portable.html" | ||
212 | ARCH=$ARCH | ||
213 | VERSION=$VERSION | ||
214 | CATEGORY="Security,application" | ||
215 | BASEDIR=/ | ||
216 | CLASSES="none" | ||
217 | PSTAMP="${UNAME_S} ${OS_VER} ${ARCH} `date '+%d%b%Y %H:%M'`" | ||
218 | _EOF | ||
219 | |||
220 | ## Build empty depend file that may get updated by $POST_PROTOTYPE_EDITS | ||
221 | echo "Building depend file..." | ||
222 | touch depend | ||
223 | |||
224 | ## Build space file | ||
225 | echo "Building space file..." | ||
226 | cat > space << _EOF | ||
227 | # extra space required by start/stop links added by installf in postinstall | ||
228 | $TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1 | ||
229 | $TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME} 0 1 | ||
230 | _EOF | ||
231 | [ "$RC1_D" = no ] || \ | ||
232 | echo "$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1" >> space | ||
233 | [ "$RCS_D" = yes ] && \ | ||
234 | echo "$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1" >> space | ||
235 | |||
236 | ## Build preinstall file | ||
237 | echo "Building preinstall file..." | ||
238 | cat > preinstall << _EOF | ||
239 | #! ${SCRIPT_SHELL} | ||
240 | # | ||
241 | _EOF | ||
242 | |||
243 | # local preinstall changes here | ||
244 | [ -s "${PKG_PREINSTALL_LOCAL}" ] && . ${PKG_PREINSTALL_LOCAL} | ||
245 | |||
246 | cat >> preinstall << _EOF | ||
247 | # | ||
248 | [ "\${PRE_INS_STOP}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop | ||
249 | exit 0 | ||
250 | _EOF | ||
251 | |||
252 | ## Build postinstall file | ||
253 | echo "Building postinstall file..." | ||
254 | cat > postinstall << _EOF | ||
255 | #! ${SCRIPT_SHELL} | ||
256 | # | ||
257 | [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config ] || \\ | ||
258 | cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config.default \\ | ||
259 | \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config | ||
260 | [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config ] || \\ | ||
261 | cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config.default \\ | ||
262 | \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config | ||
263 | [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds.default ] && { | ||
264 | [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds ] || \\ | ||
265 | cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds.default \\ | ||
266 | \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds | ||
267 | } | ||
268 | |||
269 | # make rc?.d dirs only if we are doing a test install | ||
270 | [ -n "${TEST_DIR}" ] && { | ||
271 | [ "$RCS_D" = yes ] && mkdir -p ${TEST_DIR}/etc/rcS.d | ||
272 | mkdir -p ${TEST_DIR}/etc/rc0.d | ||
273 | [ "$RC1_D" = no ] || mkdir -p ${TEST_DIR}/etc/rc1.d | ||
274 | mkdir -p ${TEST_DIR}/etc/rc2.d | ||
275 | } | ||
276 | |||
277 | if [ "\${USE_SYM_LINKS}" = yes ] | ||
278 | then | ||
279 | [ "$RCS_D" = yes ] && \ | ||
280 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s | ||
281 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s | ||
282 | [ "$RC1_D" = no ] || \ | ||
283 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s | ||
284 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s | ||
285 | else | ||
286 | [ "$RCS_D" = yes ] && \ | ||
287 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l | ||
288 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l | ||
289 | [ "$RC1_D" = no ] || \ | ||
290 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l | ||
291 | installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l | ||
292 | fi | ||
293 | |||
294 | # If piddir doesn't exist we add it. (Ie. --with-pid-dir=/var/opt/ssh) | ||
295 | [ -d $piddir ] || installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR$piddir d 0755 root sys | ||
296 | |||
297 | _EOF | ||
298 | |||
299 | # local postinstall changes here | ||
300 | [ -s "${PKG_POSTINSTALL_LOCAL}" ] && . ${PKG_POSTINSTALL_LOCAL} | ||
301 | |||
302 | cat >> postinstall << _EOF | ||
303 | installf -f ${PKGNAME} | ||
304 | |||
305 | # Use chroot to handle PKG_INSTALL_ROOT | ||
306 | if [ ! -z "\${PKG_INSTALL_ROOT}" ] | ||
307 | then | ||
308 | chroot="chroot \${PKG_INSTALL_ROOT}" | ||
309 | fi | ||
310 | # If this is a test build, we will skip the groupadd/useradd/passwd commands | ||
311 | if [ ! -z "${TEST_DIR}" ] | ||
312 | then | ||
313 | chroot=echo | ||
314 | fi | ||
315 | |||
316 | if egrep '^[ \t]*UsePrivilegeSeparation[ \t]+no' \${PKG_INSTALL_ROOT}/$sysconfdir/sshd_config >/dev/null | ||
317 | then | ||
318 | echo "UsePrivilegeSeparation disabled in config, not creating PrivSep user" | ||
319 | echo "or group." | ||
320 | else | ||
321 | echo "UsePrivilegeSeparation enabled in config (or defaulting to on)." | ||
322 | |||
323 | # create group if required | ||
324 | if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null | ||
325 | then | ||
326 | echo "PrivSep group $SSH_PRIVSEP_USER already exists." | ||
327 | else | ||
328 | # Use gid of 67 if possible | ||
329 | if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSHDGID'\$' >/dev/null | ||
330 | then | ||
331 | : | ||
332 | else | ||
333 | sshdgid="-g $SSHDGID" | ||
334 | fi | ||
335 | echo "Creating PrivSep group $SSH_PRIVSEP_USER." | ||
336 | \$chroot ${PATH_GROUPADD_PROG} \$sshdgid $SSH_PRIVSEP_USER | ||
337 | fi | ||
338 | |||
339 | # Create user if required | ||
340 | if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null | ||
341 | then | ||
342 | echo "PrivSep user $SSH_PRIVSEP_USER already exists." | ||
343 | else | ||
344 | # Use uid of 67 if possible | ||
345 | if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSHDGID'\$' >/dev/null | ||
346 | then | ||
347 | : | ||
348 | else | ||
349 | sshduid="-u $SSHDUID" | ||
350 | fi | ||
351 | echo "Creating PrivSep user $SSH_PRIVSEP_USER." | ||
352 | \$chroot ${PATH_USERADD_PROG} -c 'SSHD PrivSep User' -s /bin/false -g $SSH_PRIVSEP_USER \$sshduid $SSH_PRIVSEP_USER | ||
353 | \$chroot ${PATH_PASSWD_PROG} -l $SSH_PRIVSEP_USER | ||
354 | fi | ||
355 | fi | ||
356 | |||
357 | [ "\${POST_INS_START}" = "yes" ] && ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start | ||
358 | exit 0 | ||
359 | _EOF | ||
360 | |||
361 | ## Build preremove file | ||
362 | echo "Building preremove file..." | ||
363 | cat > preremove << _EOF | ||
364 | #! ${SCRIPT_SHELL} | ||
365 | # | ||
366 | ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop | ||
367 | _EOF | ||
368 | |||
369 | # local preremove changes here | ||
370 | [ -s "${PKG_PREREMOVE_LOCAL}" ] && . ${PKG_PREREMOVE_LOCAL} | ||
371 | |||
372 | cat >> preremove << _EOF | ||
373 | exit 0 | ||
374 | _EOF | ||
375 | |||
376 | ## Build postremove file | ||
377 | echo "Building postremove file..." | ||
378 | cat > postremove << _EOF | ||
379 | #! ${SCRIPT_SHELL} | ||
380 | # | ||
381 | _EOF | ||
382 | |||
383 | # local postremove changes here | ||
384 | [ -s "${PKG_POSTREMOVE_LOCAL}" ] && . ${PKG_POSTREMOVE_LOCAL} | ||
385 | |||
386 | cat >> postremove << _EOF | ||
387 | exit 0 | ||
388 | _EOF | ||
389 | |||
390 | ## Build request file | ||
391 | echo "Building request file..." | ||
392 | cat > request << _EOF | ||
393 | trap 'exit 3' 15 | ||
394 | |||
395 | _EOF | ||
396 | |||
397 | [ -x /usr/bin/ckyorn ] || cat >> request << _EOF | ||
398 | |||
399 | ckyorn() { | ||
400 | # for some strange reason OpenServer has no ckyorn | ||
401 | # We build a striped down version here | ||
402 | |||
403 | DEFAULT=n | ||
404 | PROMPT="Yes or No [yes,no,?,quit]" | ||
405 | HELP_PROMPT=" Enter y or yes if your answer is yes; n or no if your answer is no." | ||
406 | USAGE="usage: ckyorn [options] | ||
407 | where options may include: | ||
408 | -d default | ||
409 | -h help | ||
410 | -p prompt | ||
411 | " | ||
412 | |||
413 | if [ \$# != 0 ] | ||
414 | then | ||
415 | while getopts d:p:h: c | ||
416 | do | ||
417 | case \$c in | ||
418 | h) HELP_PROMPT="\$OPTARG" ;; | ||
419 | d) DEFAULT=\$OPTARG ;; | ||
420 | p) PROMPT=\$OPTARG ;; | ||
421 | \\?) echo "\$USAGE" 1>&2 | ||
422 | exit 1 ;; | ||
423 | esac | ||
424 | done | ||
425 | shift \`expr \$OPTIND - 1\` | ||
426 | fi | ||
427 | |||
428 | while true | ||
429 | do | ||
430 | echo "\${PROMPT}\\c " 1>&2 | ||
431 | read key | ||
432 | [ -z "\$key" ] && key=\$DEFAULT | ||
433 | case \$key in | ||
434 | [n,N]|[n,N][o,O]|[y,Y]|[y,Y][e,E][s,S]) echo "\${key}\\c" | ||
435 | exit 0 ;; | ||
436 | \\?) echo \$HELP_PROMPT 1>&2 ;; | ||
437 | q|quit) echo "q\\c" 1>&2 | ||
438 | exit 3 ;; | ||
439 | esac | ||
440 | done | ||
441 | |||
442 | } | ||
443 | |||
444 | _EOF | ||
445 | |||
446 | cat >> request << _EOF | ||
447 | USE_SYM_LINKS=no | ||
448 | PRE_INS_STOP=no | ||
449 | POST_INS_START=no | ||
450 | # Use symbolic links? | ||
451 | ans=\`ckyorn -d n \ | ||
452 | -p "Do you want symbolic links for the start/stop scripts? ${DEF_MSG}"\` || exit \$? | ||
453 | case \$ans in | ||
454 | [y,Y]*) USE_SYM_LINKS=yes ;; | ||
455 | esac | ||
456 | |||
457 | # determine if should restart the daemon | ||
458 | if [ -s ${piddir}/sshd.pid -a -f ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} ] | ||
459 | then | ||
460 | ans=\`ckyorn -d n \ | ||
461 | -p "Should the running sshd daemon be restarted? ${DEF_MSG}"\` || exit \$? | ||
462 | case \$ans in | ||
463 | [y,Y]*) PRE_INS_STOP=yes | ||
464 | POST_INS_START=yes | ||
465 | ;; | ||
466 | esac | ||
467 | |||
468 | else | ||
469 | |||
470 | # determine if we should start sshd | ||
471 | ans=\`ckyorn -d n \ | ||
472 | -p "Start the sshd daemon after installing this package? ${DEF_MSG}"\` || exit \$? | ||
473 | case \$ans in | ||
474 | [y,Y]*) POST_INS_START=yes ;; | ||
475 | esac | ||
476 | fi | ||
477 | |||
478 | # make parameters available to installation service, | ||
479 | # and so to any other packaging scripts | ||
480 | cat >\$1 <<! | ||
481 | USE_SYM_LINKS='\$USE_SYM_LINKS' | ||
482 | PRE_INS_STOP='\$PRE_INS_STOP' | ||
483 | POST_INS_START='\$POST_INS_START' | ||
484 | ! | ||
485 | |||
486 | _EOF | ||
487 | |||
488 | # local request changes here | ||
489 | [ -s "${PKG_REQUEST_LOCAL}" ] && . ${PKG_REQUEST_LOCAL} | ||
490 | |||
491 | cat >> request << _EOF | ||
492 | exit 0 | ||
493 | |||
494 | _EOF | ||
495 | |||
496 | ## Next Build our prototype | ||
497 | echo "Building prototype file..." | ||
498 | cat >mk-proto.awk << _EOF | ||
499 | BEGIN { print "i pkginfo"; print "i depend"; \\ | ||
500 | print "i preinstall"; print "i postinstall"; \\ | ||
501 | print "i preremove"; print "i postremove"; \\ | ||
502 | print "i request"; print "i space"; \\ | ||
503 | split("$SYSTEM_DIR",sys_files); } | ||
504 | { | ||
505 | for (dir in sys_files) { if ( \$3 != sys_files[dir] ) | ||
506 | { if ( \$1 == "s" ) | ||
507 | { \$5=""; \$6=""; } | ||
508 | else | ||
509 | { \$5="root"; \$6="sys"; } | ||
510 | } | ||
511 | else | ||
512 | { \$4="?"; \$5="?"; \$6="?"; break;} | ||
513 | } } | ||
514 | { print; } | ||
515 | _EOF | ||
516 | |||
517 | find . | egrep -v "prototype|pkginfo|mk-proto.awk" | sort | \ | ||
518 | pkgproto $PROTO_ARGS | nawk -f mk-proto.awk > prototype | ||
519 | |||
520 | # /usr/local is a symlink on some systems | ||
521 | [ "${USR_LOCAL_IS_SYMLINK}" = yes ] && { | ||
522 | grep -v "^d none /usr/local ? ? ?$" prototype > prototype.new | ||
523 | mv prototype.new prototype | ||
524 | } | ||
525 | |||
526 | ## Step back a directory and now build the package. | ||
527 | cd .. | ||
528 | # local prototype tweeks here | ||
529 | [ -s "${POST_PROTOTYPE_EDITS}" ] && . ${POST_PROTOTYPE_EDITS} | ||
530 | |||
531 | echo "Building package.." | ||
532 | pkgmk -d ${FAKE_ROOT} -f $FAKE_ROOT/prototype -o | ||
533 | echo | pkgtrans -os ${FAKE_ROOT} ${START}/$PKGNAME-$VERSION-$UNAME_S-$ARCH.pkg | ||
534 | ;; | ||
535 | |||
536 | justpkg.sh) | ||
537 | rm -fr ${FAKE_ROOT}/${PKGNAME} | ||
538 | grep -v "^PSTAMP=" $FAKE_ROOT/pkginfo > $$tmp | ||
539 | mv $$tmp $FAKE_ROOT/pkginfo | ||
540 | cat >> $FAKE_ROOT/pkginfo << _EOF | ||
541 | PSTAMP="${UNAME_S} ${OS_VER} ${ARCH} `date '+%d%b%Y %H:%M'`" | ||
542 | _EOF | ||
543 | pkgmk -d ${FAKE_ROOT} -f $FAKE_ROOT/prototype -o | ||
544 | echo | pkgtrans -os ${FAKE_ROOT} ${START}/$PKGNAME-$VERSION-$UNAME_S-$ARCH.pkg | ||
545 | ;; | ||
546 | |||
547 | esac | ||
548 | |||
549 | [ "${REMOVE_FAKE_ROOT_WHEN_DONE}" = yes ] && rm -rf $FAKE_ROOT | ||
550 | |||
diff --git a/configure.ac b/configure.ac index 76ac0e06c..9f5d11935 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.218 2004/05/23 04:09:40 djm Exp $ | 1 | # $Id: configure.ac,v 1.219 2004/05/31 04:38:51 tim Exp $ |
2 | # | 2 | # |
3 | # Copyright (c) 1999-2004 Damien Miller | 3 | # Copyright (c) 1999-2004 Damien Miller |
4 | # | 4 | # |
@@ -38,6 +38,13 @@ AC_PATH_PROG(TEST_MINUS_S_SH, ksh) | |||
38 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) | 38 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
39 | AC_PATH_PROG(SH, sh) | 39 | AC_PATH_PROG(SH, sh) |
40 | 40 | ||
41 | dnl for buildpkg.sh | ||
42 | AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd, | ||
43 | [/usr/sbin${PATH_SEPARATOR}/etc]) | ||
44 | AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd, | ||
45 | [/usr/sbin${PATH_SEPARATOR}/etc]) | ||
46 | AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no) | ||
47 | |||
41 | # System features | 48 | # System features |
42 | AC_SYS_LARGEFILE | 49 | AC_SYS_LARGEFILE |
43 | 50 | ||
@@ -2908,7 +2915,7 @@ if test "$ac_cv_lib_pam_pam_set_item" = yes ; then | |||
2908 | fi | 2915 | fi |
2909 | 2916 | ||
2910 | AC_EXEEXT | 2917 | AC_EXEEXT |
2911 | AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds]) | 2918 | AC_CONFIG_FILES([Makefile buildpkg.sh openbsd-compat/Makefile scard/Makefile ssh_prng_cmds]) |
2912 | AC_OUTPUT | 2919 | AC_OUTPUT |
2913 | 2920 | ||
2914 | # Print summary of options | 2921 | # Print summary of options |
@@ -2973,6 +2980,10 @@ echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}" | |||
2973 | 2980 | ||
2974 | echo "" | 2981 | echo "" |
2975 | 2982 | ||
2983 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then | ||
2984 | echo "SVR4 style packages are supported with \"make package\"\n" | ||
2985 | fi | ||
2986 | |||
2976 | if test "x$PAM_MSG" = "xyes" ; then | 2987 | if test "x$PAM_MSG" = "xyes" ; then |
2977 | echo "PAM is enabled. You may need to install a PAM control file " | 2988 | echo "PAM is enabled. You may need to install a PAM control file " |
2978 | echo "for sshd, otherwise password authentication may fail. " | 2989 | echo "for sshd, otherwise password authentication may fail. " |