003 File Manager
Current Path:
/usr/src/crypto/openssh
usr
/
src
/
crypto
/
openssh
/
📁
..
📄
.depend
(129.94 KB)
📄
.gitignore
(341 B)
📄
.skipped-commit-ids
(1.85 KB)
📄
CREDITS
(5.36 KB)
📄
ChangeLog
(299.53 KB)
📄
FREEBSD-upgrade
(5.68 KB)
📄
FREEBSD-vendor
(131 B)
📄
INSTALL
(9.36 KB)
📄
LICENCE
(14.83 KB)
📄
Makefile.in
(24.73 KB)
📄
OVERVIEW
(6.16 KB)
📄
PROTOCOL
(18 KB)
📄
PROTOCOL.agent
(220 B)
📄
PROTOCOL.certkeys
(11.91 KB)
📄
PROTOCOL.chacha20poly1305
(4.52 KB)
📄
PROTOCOL.key
(1.5 KB)
📄
PROTOCOL.krl
(5.13 KB)
📄
PROTOCOL.mux
(8.87 KB)
📄
README
(2.39 KB)
📄
README.dns
(1.57 KB)
📄
README.platform
(3.95 KB)
📄
README.privsep
(2.25 KB)
📄
README.tun
(4.78 KB)
📄
TODO
(2.54 KB)
📄
aclocal.m4
(5.56 KB)
📄
addrmatch.c
(10.97 KB)
📄
atomicio.c
(4.4 KB)
📄
atomicio.h
(2.14 KB)
📄
audit-bsm.c
(11.82 KB)
📄
audit-linux.c
(3.46 KB)
📄
audit.c
(5.69 KB)
📄
audit.h
(2.27 KB)
📄
auth-bsdauth.c
(3.65 KB)
📄
auth-krb5.c
(6.93 KB)
📄
auth-options.c
(23.45 KB)
📄
auth-options.h
(2.75 KB)
📄
auth-pam.c
(35.07 KB)
📄
auth-pam.h
(1.89 KB)
📄
auth-passwd.c
(6.42 KB)
📄
auth-rhosts.c
(8.89 KB)
📄
auth-shadow.c
(4.25 KB)
📄
auth-sia.c
(3.15 KB)
📄
auth-sia.h
(1.4 KB)
📄
auth-skey.c
(2.75 KB)
📄
auth.c
(32.86 KB)
📄
auth.h
(7.95 KB)
📄
auth2-chall.c
(9.77 KB)
📄
auth2-gss.c
(9.63 KB)
📄
auth2-hostbased.c
(8.08 KB)
📄
auth2-kbdint.c
(2.2 KB)
📄
auth2-none.c
(2.29 KB)
📄
auth2-passwd.c
(2.36 KB)
📄
auth2-pubkey.c
(28.79 KB)
📄
auth2.c
(22.23 KB)
📄
authfd.c
(14.47 KB)
📄
authfd.h
(3.05 KB)
📄
authfile.c
(12.59 KB)
📄
authfile.h
(2.34 KB)
📄
bitmap.c
(4.44 KB)
📄
bitmap.h
(1.9 KB)
📄
blacklist.c
(2.81 KB)
📄
blacklist_client.h
(2.09 KB)
📄
buildpkg.sh.in
(17.64 KB)
📄
canohost.c
(4.72 KB)
📄
canohost.h
(842 B)
📄
chacha.c
(5.28 KB)
📄
chacha.h
(1000 B)
📄
channels.c
(133.25 KB)
📄
channels.h
(12.96 KB)
📄
cipher-aes.c
(4.54 KB)
📄
cipher-aesctr.c
(2.06 KB)
📄
cipher-aesctr.h
(1.3 KB)
📄
cipher-chachapoly.c
(3.72 KB)
📄
cipher-chachapoly.h
(1.58 KB)
📄
cipher-ctr.c
(3.57 KB)
📄
cipher.c
(13.57 KB)
📄
cipher.h
(3.15 KB)
📄
cleanup.c
(1.01 KB)
📄
clientloop.c
(66.05 KB)
📄
clientloop.h
(3.69 KB)
📄
compat.c
(6.62 KB)
📄
compat.h
(2.77 KB)
📄
config.guess
(42.74 KB)
📄
config.h
(53.02 KB)
📄
config.sub
(35.49 KB)
📄
configure.ac
(147.81 KB)
📁
contrib
📄
crc32.c
(4.92 KB)
📄
crc32.h
(1.44 KB)
📄
crypto_api.h
(1.12 KB)
📄
defines.h
(21.73 KB)
📄
dh.c
(15.14 KB)
📄
dh.h
(2.59 KB)
📄
digest-libc.c
(5.69 KB)
📄
digest-openssl.c
(4.95 KB)
📄
digest.h
(2.51 KB)
📄
dispatch.c
(3.52 KB)
📄
dispatch.h
(2.2 KB)
📄
dns.c
(9.15 KB)
📄
dns.h
(2.03 KB)
📄
ed25519.c
(3.1 KB)
📄
entropy.c
(6.34 KB)
📄
entropy.h
(1.47 KB)
📄
fatal.c
(1.63 KB)
📄
fe25519.c
(8.13 KB)
📄
fe25519.h
(2.31 KB)
📄
fixalgorithms
(422 B)
📄
fixpaths
(499 B)
📄
freebsd-configure.sh
(1.07 KB)
📄
freebsd-namespace.sh
(1.93 KB)
📄
freebsd-post-merge.sh
(224 B)
📄
freebsd-pre-merge.sh
(429 B)
📄
ge25519.c
(11.04 KB)
📄
ge25519.h
(1.35 KB)
📄
ge25519_base.data
(164.61 KB)
📄
groupaccess.c
(3.5 KB)
📄
groupaccess.h
(1.53 KB)
📄
gss-genr.c
(7.99 KB)
📄
gss-serv-krb5.c
(5.63 KB)
📄
gss-serv.c
(10.32 KB)
📄
hash.c
(623 B)
📄
hmac.c
(5.08 KB)
📄
hmac.h
(1.62 KB)
📄
hostfile.c
(21.7 KB)
📄
hostfile.h
(3.8 KB)
📄
includes.h
(3.85 KB)
📄
install-sh
(13.67 KB)
📄
kex.c
(25.9 KB)
📄
kex.h
(7.32 KB)
📄
kexc25519.c
(4.62 KB)
📄
kexc25519c.c
(5.11 KB)
📄
kexc25519s.c
(4.99 KB)
📄
kexdh.c
(3.27 KB)
📄
kexdhc.c
(6.13 KB)
📄
kexdhs.c
(6.06 KB)
📄
kexecdh.c
(3.49 KB)
📄
kexecdhc.c
(6.22 KB)
📄
kexecdhs.c
(5.94 KB)
📄
kexgex.c
(3.67 KB)
📄
kexgexc.c
(7.63 KB)
📄
kexgexs.c
(7.35 KB)
📄
krb5_config.h
(315 B)
📄
krl.c
(35.63 KB)
📄
krl.h
(2.67 KB)
📄
log.c
(10.67 KB)
📄
log.h
(2.64 KB)
📄
loginrec.c
(41.91 KB)
📄
loginrec.h
(4.6 KB)
📄
logintest.c
(8.58 KB)
📄
mac.c
(7.24 KB)
📄
mac.h
(1.96 KB)
📄
match.c
(9.14 KB)
📄
match.h
(1.16 KB)
📄
md5crypt.c
(3.98 KB)
📄
md5crypt.h
(744 B)
📄
mdoc2man.awk
(8.38 KB)
📄
misc.c
(43.77 KB)
📄
misc.h
(5.69 KB)
📄
mkinstalldirs
(633 B)
📄
moduli
(552 KB)
📄
moduli.5
(3.6 KB)
📄
moduli.c
(20.46 KB)
📄
monitor.c
(50.56 KB)
📄
monitor.h
(3.83 KB)
📄
monitor_fdpass.c
(4.71 KB)
📄
monitor_fdpass.h
(1.49 KB)
📄
monitor_wrap.c
(27.44 KB)
📄
monitor_wrap.h
(3.84 KB)
📄
msg.c
(2.75 KB)
📄
msg.h
(1.49 KB)
📄
mux.c
(65.73 KB)
📄
myproposal.h
(5.62 KB)
📄
nchan.c
(12.06 KB)
📄
nchan.ms
(3.86 KB)
📄
nchan2.ms
(3.38 KB)
📄
opacket.c
(5.55 KB)
📄
opacket.h
(5.98 KB)
📁
openbsd-compat
📄
openssh.xml.in
(2.77 KB)
📄
opensshd.init.in
(1.86 KB)
📄
packet.c
(70.79 KB)
📄
packet.h
(7.39 KB)
📄
pathnames.h
(5.69 KB)
📄
pkcs11.h
(41.37 KB)
📄
platform-misc.c
(1.09 KB)
📄
platform-pledge.c
(1.86 KB)
📄
platform-tracing.c
(1.69 KB)
📄
platform.c
(4.71 KB)
📄
platform.h
(1.43 KB)
📄
poly1305.c
(4.54 KB)
📄
poly1305.h
(645 B)
📄
progressmeter.c
(7.48 KB)
📄
progressmeter.h
(1.44 KB)
📄
readconf.c
(81 KB)
📄
readconf.h
(7.83 KB)
📄
readpass.c
(4.99 KB)
📁
regress
📄
rijndael.c
(51.57 KB)
📄
rijndael.h
(2.07 KB)
📄
sandbox-capsicum.c
(3.39 KB)
📄
sandbox-darwin.c
(2.49 KB)
📄
sandbox-null.c
(1.62 KB)
📄
sandbox-pledge.c
(1.83 KB)
📄
sandbox-rlimit.c
(2.43 KB)
📄
sandbox-seccomp-filter.c
(9.88 KB)
📄
sandbox-solaris.c
(2.9 KB)
📄
sandbox-systrace.c
(6.27 KB)
📄
sc25519.c
(7.16 KB)
📄
sc25519.h
(2.83 KB)
📄
scp.1
(5.56 KB)
📄
scp.c
(39.14 KB)
📄
servconf.c
(79.73 KB)
📄
servconf.h
(10.13 KB)
📄
serverloop.c
(26.03 KB)
📄
serverloop.h
(1000 B)
📄
session.c
(66.72 KB)
📄
session.h
(2.59 KB)
📄
sftp-client.c
(49.62 KB)
📄
sftp-client.h
(4.29 KB)
📄
sftp-common.c
(6.83 KB)
📄
sftp-common.h
(2.02 KB)
📄
sftp-glob.c
(3.38 KB)
📄
sftp-server-main.c
(1.49 KB)
📄
sftp-server.8
(4.98 KB)
📄
sftp-server.c
(42.36 KB)
📄
sftp.1
(14.53 KB)
📄
sftp.c
(59.73 KB)
📄
sftp.h
(3.33 KB)
📄
smult_curve25519_ref.c
(6.71 KB)
📄
ssh-add.1
(6.45 KB)
📄
ssh-add.c
(17.69 KB)
📄
ssh-agent.1
(7.16 KB)
📄
ssh-agent.c
(33.19 KB)
📄
ssh-dss.c
(5.55 KB)
📄
ssh-ecdsa.c
(5.54 KB)
📄
ssh-ed25519.c
(4.21 KB)
📄
ssh-gss.h
(4.71 KB)
📄
ssh-keygen.1
(26.5 KB)
📄
ssh-keygen.c
(78.58 KB)
📄
ssh-keyscan.1
(3.82 KB)
📄
ssh-keyscan.c
(17.83 KB)
📄
ssh-keysign.8
(2.95 KB)
📄
ssh-keysign.c
(8.26 KB)
📄
ssh-pkcs11-client.c
(6.65 KB)
📄
ssh-pkcs11-helper.8
(1.33 KB)
📄
ssh-pkcs11-helper.c
(9.79 KB)
📄
ssh-pkcs11.c
(19.56 KB)
📄
ssh-pkcs11.h
(1.06 KB)
📄
ssh-rsa.c
(11.89 KB)
📄
ssh-sandbox.h
(1.09 KB)
📄
ssh-xmss.c
(5 KB)
📄
ssh.1
(44.3 KB)
📄
ssh.c
(61.58 KB)
📄
ssh.h
(2.6 KB)
📄
ssh2.h
(5.66 KB)
📄
ssh_api.c
(13.81 KB)
📄
ssh_api.h
(4.33 KB)
📄
ssh_config
(1.53 KB)
📄
ssh_config.5
(51.41 KB)
📄
ssh_namespace.h
(44.25 KB)
📄
sshbuf-getput-basic.c
(11.81 KB)
📄
sshbuf-getput-crypto.c
(5.64 KB)
📄
sshbuf-misc.c
(3.53 KB)
📄
sshbuf.c
(8.96 KB)
📄
sshbuf.h
(12.2 KB)
📄
sshconnect.c
(43.92 KB)
📄
sshconnect.h
(2.3 KB)
📄
sshconnect2.c
(59.05 KB)
📄
sshd.8
(30.87 KB)
📄
sshd.c
(64.58 KB)
📄
sshd_config
(3.18 KB)
📄
sshd_config.5
(50.55 KB)
📄
ssherr.c
(5.04 KB)
📄
ssherr.h
(3.28 KB)
📄
sshkey-xmss.c
(28.17 KB)
📄
sshkey-xmss.h
(2.89 KB)
📄
sshkey.c
(102.94 KB)
📄
sshkey.h
(10.09 KB)
📄
sshlogin.c
(5.25 KB)
📄
sshlogin.h
(935 B)
📄
sshpty.c
(5.59 KB)
📄
sshpty.h
(1.03 KB)
📄
sshtty.c
(2.95 KB)
📄
survey.sh.in
(1.68 KB)
📄
ttymodes.c
(10.1 KB)
📄
ttymodes.h
(4.85 KB)
📄
uidswap.c
(7.09 KB)
📄
uidswap.h
(680 B)
📄
umac.c
(44.91 KB)
📄
umac.h
(4.58 KB)
📄
umac128.c
(414 B)
📄
utf8.c
(8.09 KB)
📄
utf8.h
(1.17 KB)
📄
uuencode.c
(2.94 KB)
📄
uuencode.h
(1.5 KB)
📄
verify.c
(668 B)
📄
version.h
(385 B)
📄
xmalloc.c
(2.41 KB)
📄
xmalloc.h
(1.08 KB)
📄
xmss_commons.c
(630 B)
📄
xmss_commons.h
(450 B)
📄
xmss_fast.c
(32.16 KB)
📄
xmss_fast.h
(3.64 KB)
📄
xmss_hash.c
(3.35 KB)
📄
xmss_hash.h
(841 B)
📄
xmss_hash_address.c
(1.2 KB)
📄
xmss_hash_address.h
(836 B)
📄
xmss_wots.c
(4.74 KB)
📄
xmss_wots.h
(1.86 KB)
Editing: buildpkg.sh.in
#!/bin/sh # # Fake Root Solaris/SVR4/SVR5 Build System - Prototype # # The following code has been provide under Public Domain License. I really # don't care what you use it for. Just as long as you don't complain to me # nor my employer if you break it. - Ben Lindstrom (mouring@eviladmin.org) # umask 022 # # Options for building the package # You can create a openssh-config.local with your customized options # REMOVE_FAKE_ROOT_WHEN_DONE=yes # # uncommenting TEST_DIR and using # configure --prefix=/var/tmp --with-privsep-path=/var/tmp/empty # and # PKGNAME=tOpenSSH should allow testing a package without interfering # with a real OpenSSH package on a system. This is not needed on systems # that support the -R option to pkgadd. #TEST_DIR=/var/tmp # leave commented out for production build PKGNAME=OpenSSH # revisions within the same version (REV=a) #REV= SYSVINIT_NAME=opensshd AWK=${AWK:="nawk"} MAKE=${MAKE:="make"} SSHDUID=67 # Default privsep uid SSHDGID=67 # Default privsep gid # uncomment these next three as needed #PERMIT_ROOT_LOGIN=no #X11_FORWARDING=yes #USR_LOCAL_IS_SYMLINK=yes # System V init run levels SYSVINITSTART=S98 SYSVINITSTOPT=K30 # We will source these if they exist POST_MAKE_INSTALL_FIXES=./pkg-post-make-install-fixes.sh POST_PROTOTYPE_EDITS=./pkg-post-prototype-edit.sh # We'll be one level deeper looking for these PKG_PREINSTALL_LOCAL=../pkg-preinstall.local PKG_POSTINSTALL_LOCAL=../pkg-postinstall.local PKG_PREREMOVE_LOCAL=../pkg-preremove.local PKG_POSTREMOVE_LOCAL=../pkg-postremove.local PKG_REQUEST_LOCAL=../pkg-request.local # end of sourced files # OPENSSHD=opensshd.init OPENSSH_MANIFEST=openssh.xml OPENSSH_FMRI=svc:/site/${SYSVINIT_NAME}:default SMF_METHOD_DIR=/lib/svc/method/site SMF_MANIFEST_DIR=/var/svc/manifest/site PATH_GROUPADD_PROG=@PATH_GROUPADD_PROG@ PATH_USERADD_PROG=@PATH_USERADD_PROG@ PATH_PASSWD_PROG=@PATH_PASSWD_PROG@ # # list of system directories we do NOT want to change owner/group/perms # when installing our package SYSTEM_DIR="/etc \ /etc/init.d \ /etc/rcS.d \ /etc/rc0.d \ /etc/rc1.d \ /etc/rc2.d \ /etc/opt \ /lib \ /lib/svc \ /lib/svc/method \ /lib/svc/method/site \ /opt \ /opt/bin \ /usr \ /usr/bin \ /usr/lib \ /usr/sbin \ /usr/share \ /usr/share/man \ /usr/share/man/man1 \ /usr/share/man/man8 \ /usr/local \ /usr/local/bin \ /usr/local/etc \ /usr/local/libexec \ /usr/local/man \ /usr/local/man/man1 \ /usr/local/man/man8 \ /usr/local/sbin \ /usr/local/share \ /var \ /var/opt \ /var/run \ /var/svc \ /var/svc/manifest \ /var/svc/manifest/site \ /var/tmp \ /tmp" # We may need to build as root so we make sure PATH is set up # only set the path if it's not set already [ -d /opt/bin ] && { echo $PATH | grep ":/opt/bin" > /dev/null 2>&1 [ $? -ne 0 ] && PATH=$PATH:/opt/bin } [ -d /usr/local/bin ] && { echo $PATH | grep ":/usr/local/bin" > /dev/null 2>&1 [ $? -ne 0 ] && PATH=$PATH:/usr/local/bin } [ -d /usr/ccs/bin ] && { echo $PATH | grep ":/usr/ccs/bin" > /dev/null 2>&1 [ $? -ne 0 ] && PATH=$PATH:/usr/ccs/bin } export PATH # [ -f Makefile ] || { echo "Please run this script from your build directory" exit 1 } # we will look for openssh-config.local to override the above options [ -s ./openssh-config.local ] && . ./openssh-config.local START=`pwd` FAKE_ROOT=$START/pkg ## Fill in some details, like prefix and sysconfdir for confvar in prefix exec_prefix bindir sbindir libexecdir datadir mandir sysconfdir piddir srcdir do eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2` done ## Are we using Solaris' SMF? DO_SMF=0 if egrep "^#define USE_SOLARIS_PROCESS_CONTRACTS" config.h > /dev/null 2>&1 then DO_SMF=1 fi ## Collect value of privsep user for confvar in SSH_PRIVSEP_USER do eval $confvar=`awk '/#define[ \t]'$confvar'/{print $3}' config.h` done ## Set privsep defaults if not defined if [ -z "$SSH_PRIVSEP_USER" ] then SSH_PRIVSEP_USER=sshd fi ## Extract common info requires for the 'info' part of the package. VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//'` ARCH=`uname -m` DEF_MSG="\n" OS_VER=`uname -v` SCRIPT_SHELL=/sbin/sh UNAME_R=`uname -r` UNAME_S=`uname -s` case ${UNAME_S} in SunOS) UNAME_S=Solaris OS_VER=${UNAME_R} ARCH=`uname -p` RCS_D=yes DEF_MSG="(default: n)" ;; SCO_SV) case ${UNAME_R} in 3.2) UNAME_S=OpenServer5 OS_VER=`uname -X | grep Release | sed -e 's/^Rel.*3.2v//'` ;; 5) UNAME_S=OpenServer6 ;; esac SCRIPT_SHELL=/bin/sh RC1_D=no DEF_MSG="(default: n)" ;; esac case `basename $0` in buildpkg.sh) ## Start by faking root install echo "Faking root install..." [ -d $FAKE_ROOT ] && rm -fr $FAKE_ROOT mkdir $FAKE_ROOT ${MAKE} install-nokeys DESTDIR=$FAKE_ROOT if [ $? -gt 0 ] then echo "Fake root install failed, stopping." exit 1 fi ## Setup our run level stuff while we are at it. if [ $DO_SMF -eq 1 ] then # For Solaris' SMF, /lib/svc/method/site is the preferred place # for start/stop scripts that aren't supplied with the OS, and # similarly /var/svc/manifest/site for manifests. mkdir -p $FAKE_ROOT${TEST_DIR}${SMF_METHOD_DIR} mkdir -p $FAKE_ROOT${TEST_DIR}${SMF_MANIFEST_DIR} cp ${OPENSSHD} $FAKE_ROOT${TEST_DIR}${SMF_METHOD_DIR}/${SYSVINIT_NAME} chmod 744 $FAKE_ROOT${TEST_DIR}${SMF_METHOD_DIR}/${SYSVINIT_NAME} cat ${OPENSSH_MANIFEST} | \ sed -e "s|__SYSVINIT_NAME__|${SYSVINIT_NAME}|" \ -e "s|__SMF_METHOD_DIR__|${SMF_METHOD_DIR}|" \ > $FAKE_ROOT${TEST_DIR}${SMF_MANIFEST_DIR}/${SYSVINIT_NAME}.xml chmod 644 $FAKE_ROOT${TEST_DIR}${SMF_MANIFEST_DIR}/${SYSVINIT_NAME}.xml else mkdir -p $FAKE_ROOT${TEST_DIR}/etc/init.d cp ${OPENSSHD} $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} chmod 744 $FAKE_ROOT${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} fi [ "${PERMIT_ROOT_LOGIN}" = no ] && \ perl -p -i -e "s/#PermitRootLogin yes/PermitRootLogin no/" \ $FAKE_ROOT${sysconfdir}/sshd_config [ "${X11_FORWARDING}" = yes ] && \ perl -p -i -e "s/#X11Forwarding no/X11Forwarding yes/" \ $FAKE_ROOT${sysconfdir}/sshd_config # fix PrintMotd perl -p -i -e "s/#PrintMotd yes/PrintMotd no/" \ $FAKE_ROOT${sysconfdir}/sshd_config # We don't want to overwrite config files on multiple installs mv $FAKE_ROOT${sysconfdir}/ssh_config $FAKE_ROOT${sysconfdir}/ssh_config.default mv $FAKE_ROOT${sysconfdir}/sshd_config $FAKE_ROOT${sysconfdir}/sshd_config.default # local tweeks here [ -s "${POST_MAKE_INSTALL_FIXES}" ] && . ${POST_MAKE_INSTALL_FIXES} cd $FAKE_ROOT ## Ok, this is outright wrong, but it will work. I'm tired of pkgmk ## whining. for i in *; do PROTO_ARGS="$PROTO_ARGS $i=/$i"; done ## Build info file echo "Building pkginfo file..." cat > pkginfo << _EOF PKG=$PKGNAME NAME="OpenSSH Portable for ${UNAME_S}" DESC="Secure Shell remote access utility; replaces telnet and rlogin/rsh." VENDOR="OpenSSH Portable Team - https://www.openssh.com/portable.html" ARCH=$ARCH VERSION=$VERSION$REV CATEGORY="Security,application" BASEDIR=/ CLASSES="none" PSTAMP="${UNAME_S} ${OS_VER} ${ARCH} `date '+%d%b%Y %H:%M'`" _EOF ## Build empty depend file that may get updated by $POST_PROTOTYPE_EDITS echo "Building depend file..." touch depend ## Build space file echo "Building space file..." if [ $DO_SMF -eq 1 ] then # XXX Is this necessary? If not, remove space line from mk-proto.awk. touch space else cat > space << _EOF # extra space required by start/stop links added by installf # in postinstall $TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1 $TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME} 0 1 _EOF [ "$RC1_D" = no ] || \ echo "$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1" >> space [ "$RCS_D" = yes ] && \ echo "$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME} 0 1" >> space fi ## Build preinstall file echo "Building preinstall file..." cat > preinstall << _EOF #! ${SCRIPT_SHELL} # _EOF # local preinstall changes here [ -s "${PKG_PREINSTALL_LOCAL}" ] && . ${PKG_PREINSTALL_LOCAL} cat >> preinstall << _EOF # if [ "\${PRE_INS_STOP}" = "yes" ] then if [ $DO_SMF -eq 1 ] then svcadm disable $OPENSSH_FMRI else ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop fi fi exit 0 _EOF ## Build postinstall file echo "Building postinstall file..." cat > postinstall << _EOF #! ${SCRIPT_SHELL} # [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config ] || \\ cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config.default \\ \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config ] || \\ cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config.default \\ \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config # make rc?.d dirs only if we are doing a test install [ -n "${TEST_DIR}" ] && [ $DO_SMF -ne 1 ] && { [ "$RCS_D" = yes ] && mkdir -p ${TEST_DIR}/etc/rcS.d mkdir -p ${TEST_DIR}/etc/rc0.d [ "$RC1_D" = no ] || mkdir -p ${TEST_DIR}/etc/rc1.d mkdir -p ${TEST_DIR}/etc/rc2.d } if [ $DO_SMF -eq 1 ] then # Delete the existing service, if it exists, then import the # new one. if svcs $OPENSSH_FMRI > /dev/null 2>&1 then svccfg delete -f $OPENSSH_FMRI fi # NOTE, The manifest disables sshd by default. svccfg import ${TEST_DIR}${SMF_MANIFEST_DIR}/${SYSVINIT_NAME}.xml else if [ "\${USE_SYM_LINKS}" = yes ] then [ "$RCS_D" = yes ] && \\ installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s [ "$RC1_D" = no ] || \\ installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s else [ "$RCS_D" = yes ] && \\ installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l [ "$RC1_D" = no ] || \\ installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/${SYSVINITSTOPT}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/${SYSVINITSTART}${SYSVINIT_NAME}=\${PKG_INSTALL_ROOT}$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l fi fi # If piddir doesn't exist we add it. (Ie. --with-pid-dir=/var/opt/ssh) [ -d $piddir ] || installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR$piddir d 0755 root sys _EOF # local postinstall changes here [ -s "${PKG_POSTINSTALL_LOCAL}" ] && . ${PKG_POSTINSTALL_LOCAL} cat >> postinstall << _EOF installf -f ${PKGNAME} # Use chroot to handle PKG_INSTALL_ROOT if [ ! -z "\${PKG_INSTALL_ROOT}" ] then chroot="chroot \${PKG_INSTALL_ROOT}" fi # If this is a test build, we will skip the groupadd/useradd/passwd commands if [ ! -z "${TEST_DIR}" ] then chroot=echo fi echo "PrivilegeSeparation user always required." if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null then echo "PrivSep user $SSH_PRIVSEP_USER already exists." SSH_PRIVSEP_GROUP=\`grep "^$SSH_PRIVSEP_USER:" \${PKG_INSTALL_ROOT}/etc/passwd | awk -F: '{print \$4}'\` SSH_PRIVSEP_GROUP=\`grep ":\$SSH_PRIVSEP_GROUP:" \${PKG_INSTALL_ROOT}/etc/group | awk -F: '{print \$1}'\` else DO_PASSWD=yes fi [ -z "\$SSH_PRIVSEP_GROUP" ] && SSH_PRIVSEP_GROUP=$SSH_PRIVSEP_USER # group required? if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'\$SSH_PRIVSEP_GROUP'\$' >/dev/null then echo "PrivSep group \$SSH_PRIVSEP_GROUP already exists." else DO_GROUP=yes fi # create group if required [ "\$DO_GROUP" = yes ] && { # Use gid of 67 if possible if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSHDGID'\$' >/dev/null then : else sshdgid="-g $SSHDGID" fi echo "Creating PrivSep group \$SSH_PRIVSEP_GROUP." \$chroot ${PATH_GROUPADD_PROG} \$sshdgid \$SSH_PRIVSEP_GROUP } # Create user if required [ "\$DO_PASSWD" = yes ] && { # Use uid of 67 if possible if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSHDUID'\$' >/dev/null then : else sshduid="-u $SSHDUID" fi echo "Creating PrivSep user $SSH_PRIVSEP_USER." \$chroot ${PATH_USERADD_PROG} -c 'SSHD PrivSep User' -s /bin/false -g $SSH_PRIVSEP_USER \$sshduid $SSH_PRIVSEP_USER \$chroot ${PATH_PASSWD_PROG} -l $SSH_PRIVSEP_USER } if [ "\${POST_INS_START}" = "yes" ] then if [ $DO_SMF -eq 1 ] then svcadm enable $OPENSSH_FMRI else ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start fi fi exit 0 _EOF ## Build preremove file echo "Building preremove file..." cat > preremove << _EOF #! ${SCRIPT_SHELL} # if [ $DO_SMF -eq 1 ] then svcadm disable $OPENSSH_FMRI else ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} stop fi _EOF # local preremove changes here [ -s "${PKG_PREREMOVE_LOCAL}" ] && . ${PKG_PREREMOVE_LOCAL} cat >> preremove << _EOF exit 0 _EOF ## Build postremove file echo "Building postremove file..." cat > postremove << _EOF #! ${SCRIPT_SHELL} # if [ $DO_SMF -eq 1 ] then if svcs $OPENSSH_FMRI > /dev/null 2>&1 then svccfg delete -f $OPENSSH_FMRI fi fi _EOF # local postremove changes here [ -s "${PKG_POSTREMOVE_LOCAL}" ] && . ${PKG_POSTREMOVE_LOCAL} cat >> postremove << _EOF exit 0 _EOF ## Build request file echo "Building request file..." cat > request << _EOF trap 'exit 3' 15 _EOF [ -x /usr/bin/ckyorn ] || cat >> request << _EOF ckyorn() { # for some strange reason OpenServer5 has no ckyorn # We build a striped down version here DEFAULT=n PROMPT="Yes or No [yes,no,?,quit]" HELP_PROMPT=" Enter y or yes if your answer is yes; n or no if your answer is no." USAGE="usage: ckyorn [options] where options may include: -d default -h help -p prompt " if [ \$# != 0 ] then while getopts d:p:h: c do case \$c in h) HELP_PROMPT="\$OPTARG" ;; d) DEFAULT=\$OPTARG ;; p) PROMPT=\$OPTARG ;; \\?) echo "\$USAGE" 1>&2 exit 1 ;; esac done shift \`expr \$OPTIND - 1\` fi while true do echo "\${PROMPT}\\c " 1>&2 read key [ -z "\$key" ] && key=\$DEFAULT case \$key in [n,N]|[n,N][o,O]|[y,Y]|[y,Y][e,E][s,S]) echo "\${key}\\c" exit 0 ;; \\?) echo \$HELP_PROMPT 1>&2 ;; q|quit) echo "q\\c" 1>&2 exit 3 ;; esac done } _EOF if [ $DO_SMF -eq 1 ] then # This could get hairy, as the running sshd may not be under SMF. # We'll assume an earlier version of OpenSSH started via SMF. cat >> request << _EOF PRE_INS_STOP=no POST_INS_START=no # determine if should restart the daemon if [ -s ${piddir}/sshd.pid ] && \\ /usr/bin/svcs -H $OPENSSH_FMRI 2>&1 | egrep "^online" > /dev/null 2>&1 then ans=\`ckyorn -d n \\ -p "Should the running sshd daemon be restarted? ${DEF_MSG}"\` || exit \$? case \$ans in [y,Y]*) PRE_INS_STOP=yes POST_INS_START=yes ;; esac else # determine if we should start sshd ans=\`ckyorn -d n \\ -p "Start the sshd daemon after installing this package? ${DEF_MSG}"\` || exit \$? case \$ans in [y,Y]*) POST_INS_START=yes ;; esac fi # make parameters available to installation service, # and so to any other packaging scripts cat >\$1 <<! PRE_INS_STOP='\$PRE_INS_STOP' POST_INS_START='\$POST_INS_START' ! _EOF else cat >> request << _EOF USE_SYM_LINKS=no PRE_INS_STOP=no POST_INS_START=no # Use symbolic links? ans=\`ckyorn -d n \\ -p "Do you want symbolic links for the start/stop scripts? ${DEF_MSG}"\` || exit \$? case \$ans in [y,Y]*) USE_SYM_LINKS=yes ;; esac # determine if should restart the daemon if [ -s ${piddir}/sshd.pid -a -f ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} ] then ans=\`ckyorn -d n \\ -p "Should the running sshd daemon be restarted? ${DEF_MSG}"\` || exit \$? case \$ans in [y,Y]*) PRE_INS_STOP=yes POST_INS_START=yes ;; esac else # determine if we should start sshd ans=\`ckyorn -d n \\ -p "Start the sshd daemon after installing this package? ${DEF_MSG}"\` || exit \$? case \$ans in [y,Y]*) POST_INS_START=yes ;; esac fi # make parameters available to installation service, # and so to any other packaging scripts cat >\$1 <<! USE_SYM_LINKS='\$USE_SYM_LINKS' PRE_INS_STOP='\$PRE_INS_STOP' POST_INS_START='\$POST_INS_START' ! _EOF fi # local request changes here [ -s "${PKG_REQUEST_LOCAL}" ] && . ${PKG_REQUEST_LOCAL} cat >> request << _EOF exit 0 _EOF ## Next Build our prototype echo "Building prototype file..." cat >mk-proto.awk << _EOF BEGIN { print "i pkginfo"; print "i depend"; \\ print "i preinstall"; print "i postinstall"; \\ print "i preremove"; print "i postremove"; \\ print "i request"; print "i space"; \\ split("$SYSTEM_DIR",sys_files); } { for (dir in sys_files) { if ( \$3 != sys_files[dir] ) { if ( \$1 == "s" ) { \$5=""; \$6=""; } else { \$5="root"; \$6="sys"; } } else { \$4="?"; \$5="?"; \$6="?"; break;} } } { print; } _EOF find . | egrep -v "prototype|pkginfo|mk-proto.awk" | sort | \ pkgproto $PROTO_ARGS | ${AWK} -f mk-proto.awk > prototype # /usr/local is a symlink on some systems [ "${USR_LOCAL_IS_SYMLINK}" = yes ] && { grep -v "^d none /usr/local ? ? ?$" prototype > prototype.new mv prototype.new prototype } ## Step back a directory and now build the package. cd .. # local prototype tweeks here [ -s "${POST_PROTOTYPE_EDITS}" ] && . ${POST_PROTOTYPE_EDITS} echo "Building package.." pkgmk -d ${FAKE_ROOT} -f $FAKE_ROOT/prototype -o echo | pkgtrans -os ${FAKE_ROOT} ${START}/$PKGNAME-$VERSION$REV-$UNAME_S-$ARCH.pkg ;; justpkg.sh) rm -fr ${FAKE_ROOT}/${PKGNAME} grep -v "^PSTAMP=" $FAKE_ROOT/pkginfo > $$tmp mv $$tmp $FAKE_ROOT/pkginfo cat >> $FAKE_ROOT/pkginfo << _EOF PSTAMP="${UNAME_S} ${OS_VER} ${ARCH} `date '+%d%b%Y %H:%M'`" _EOF pkgmk -d ${FAKE_ROOT} -f $FAKE_ROOT/prototype -o echo | pkgtrans -os ${FAKE_ROOT} ${START}/$PKGNAME-$VERSION$REV-$UNAME_S-$ARCH.pkg ;; esac [ "${REMOVE_FAKE_ROOT_WHEN_DONE}" = yes ] && rm -rf $FAKE_ROOT exit 0
Upload File
Create Folder