]> andersk Git - gssapi-openssh.git/blobdiff - openssh/contrib/aix/buildbff.sh
merged OpenSSH 5.3p1 to trunk
[gssapi-openssh.git] / openssh / contrib / aix / buildbff.sh
index 5410fea0c86885268455d3965a25f8f67f551bbb..d3d0be7b608c769bda7ebeb999ffa67565afe84a 100755 (executable)
@@ -23,6 +23,8 @@ umask 022
 
 startdir=`pwd`
 
+perl -v >/dev/null || (echo perl required; exit 1)
+
 # Path to inventory.sh: same place as buildbff.sh
 if  echo $0 | egrep '^/'
 then
@@ -149,11 +151,18 @@ fi
 
 
 # Rename config files; postinstall script will copy them if necessary
-for cfgfile in ssh_config sshd_config ssh_prng_cmds
+for cfgfile in ssh_config sshd_config
 do
        mv $FAKE_ROOT/$sysconfdir/$cfgfile $FAKE_ROOT/$sysconfdir/$cfgfile.default
 done
 
+# AIX 5.3 and newer have /dev/random and don't create ssh_prng_cmds
+if [ -f $FAKE_ROOT/$sysconfdir/ssh_prng_cmds ]
+then
+       mv FAKE_ROOT/$sysconfdir/ssh_prng_cmds \
+               $FAKE_ROOT/$sysconfdir/ssh_prng_cmds.default
+fi
+
 #
 # Generate lpp control files.
 #      working dir is $FAKE_ROOT but files are generated in dir above
@@ -200,33 +209,29 @@ do
 done
 echo
 
-# Create PrivSep user if PrivSep not disabled in config
-echo Creating PrivSep prereqs if required.
-if egrep '^[ \t]*UsePrivilegeSeparation[ \t]+no' $sysconfdir/sshd_config >/dev/null
+# Create PrivilegeSeparation user and group if not present
+echo Checking for PrivilegeSeparation user and group.
+if cut -f1 -d: /etc/group | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
 then
-       echo "UsePrivilegeSeparation disabled in config, not creating PrivSep user,"
-       echo "group or chroot directory."
+       echo "PrivSep group $SSH_PRIVSEP_USER already exists."
 else
-       echo "UsePrivilegeSeparation enabled in config (or defaulting to on)."
-
-       # create group if required
-       if cut -f1 -d: /etc/group | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
-       then
-               echo "PrivSep group $SSH_PRIVSEP_USER already exists."
-       else
-               echo "Creating PrivSep group $SSH_PRIVSEP_USER."
-               mkgroup -A $SSH_PRIVSEP_USER
-       fi
+       echo "Creating PrivSep group $SSH_PRIVSEP_USER."
+       mkgroup -A $SSH_PRIVSEP_USER
+fi
 
-       # Create user if required
-       if lsuser "$SSH_PRIVSEP_USER" >/dev/null
-       then
-               echo "PrivSep user $SSH_PRIVSEP_USER already exists."
-       else
-               echo "Creating PrivSep user $SSH_PRIVSEP_USER."
-               mkuser gecos='SSHD PrivSep User' login=false rlogin=false account_locked=true pgrp=$SSH_PRIVSEP_USER $SSH_PRIVSEP_USER
-       fi
+# Create user if required
+if lsuser "$SSH_PRIVSEP_USER" >/dev/null
+then
+       echo "PrivSep user $SSH_PRIVSEP_USER already exists."
+else
+       echo "Creating PrivSep user $SSH_PRIVSEP_USER."
+       mkuser gecos='SSHD PrivSep User' login=false rlogin=false account_locked=true pgrp=$SSH_PRIVSEP_USER $SSH_PRIVSEP_USER
+fi
 
+if egrep '^[ \t]*UsePrivilegeSeparation[ \t]+no' $sysconfdir/sshd_config >/dev/null
+then
+       echo UsePrivilegeSeparation not enabled, privsep directory not required.
+else
        # create chroot directory if required
        if [ -d $PRIVSEP_PATH ]
        then
This page took 0.07867 seconds and 4 git commands to generate.