diff -ur SUNWut.orig/bin/utset SUNWut/bin/utset --- SUNWut.orig/bin/utset 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/bin/utset 2008-12-09 10:53:06.000000000 +0100 @@ -870,7 +870,7 @@ print "$R $S" done ) | - (export LC_ALL=C; sort -t 'x' +0 -1n +1 -2n +2 -3n) + (export LC_ALL=C; sort -t 'x' -k 1,1n -k 2,2n -k 3,3n ) exit 0 fi diff -ur SUNWut.orig/lib/dhcp/isc/dhcp_config_linux SUNWut/lib/dhcp/isc/dhcp_config_linux --- SUNWut.orig/lib/dhcp/isc/dhcp_config_linux 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/dhcp/isc/dhcp_config_linux 2008-12-09 10:53:06.000000000 +0100 @@ -7,7 +7,11 @@ # UTDHCPDIR="$ETCDIR"/net/dhcp -DHCPDCONF=/etc/dhcpd.conf +if [[ -f "/etc/dhcp3/dhcpd.conf" ]]; then + DHCPDCONF=/etc/dhcp3/dhcpd.conf +else + DHCPDCONF=/etc/dhcpd.conf +fi UTDHCPFILE="$UTDHCPDIR"/utdhcp OPTIONSFILENAME="SunRay-options" OPTIONSFILE="$UTDHCPDIR"/"$OPTIONSFILENAME" @@ -30,12 +34,16 @@ DUMMY_SUBNET_COMMENT="# Sun Ray: dummy subnet to support DHCP clients on remote subnets" CheckChrooted() { - grep $CHROOTKEY $SYSDHCPD | grep -i yes 2>/dev/null 1>&2 - if [[ $? -eq 0 ]]; then - CHROOTED=true + if [[ -f $SYSDHCPD ]]; then + grep $CHROOTKEY $SYSDHCPD | grep -i yes 2>/dev/null 1>&2 + if [[ $? -eq 0 ]]; then + CHROOTED=true + else + CHROOTED=false + fi else CHROOTED=false - fi + fi } GenerateOptionsDHCPDBlock() { diff -ur SUNWut.orig/lib/dhcp/isc/utdhcpservice SUNWut/lib/dhcp/isc/utdhcpservice --- SUNWut.orig/lib/dhcp/isc/utdhcpservice 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/dhcp/isc/utdhcpservice 2008-12-09 10:53:06.000000000 +0100 @@ -49,14 +49,14 @@ # names of files and directories that will be touched by this script # -DHCP_CONFIG="/etc/dhcpd.conf"; +DHCP_CONFIG="/etc/dhcp3/dhcpd.conf"; DHCP_CONFIG_SAMPLE_RHAS="/usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample"; DHCP_CONFIG_SAMPLE_SLES="/usr/share/doc/packages/dhcp-server/dhcpd.conf"; TMPDIR="/var/opt/SUNWut/tmp" CORONA_NAME="SunRay"; CORONA_TITLE="Sun Ray"; -if [ -d /var/lib/dhcp ]; then - DHCP_DIR="/var/lib/dhcp"; +if [ -d /var/lib/dhcp3 ]; then + DHCP_DIR="/var/lib/dhcp3"; elif [ -d /var/lib/dhcpd ]; then DHCP_DIR="/var/lib/dhcpd"; fi @@ -76,6 +76,7 @@ typeset DHCP_RUNNING=true typeset DHCP_PACKAGE_RH="dhcp" typeset DHCP_PACKAGE_SU="dhcp-server" +typeset DHCP_PACKAGE_DEB="dhcp3-server" typeset DHCP_PACKAGE="DHCP" typeset DHCP_STATE="online" @@ -97,7 +98,12 @@ typeset PACKAGE="${DHCP_PACKAGE}" if $DHCP_INSTALLED ; then # get the actual package name including version and release - PACKAGE="$(rpm -q ${DHCP_PACKAGE} 2> /dev/null)" + DPKG=$(which dpkg1) + if [[ -f "$DPKG" ]]; then + PACKAGE="$(dpkg -l | grep dhcp3-server | awk '{print $2$3}' 2> /dev/null)" + else + PACKAGE="$(rpm -q ${DHCP_PACKAGE} 2> /dev/null)" + fi fi if ! $DHCP_RUNNING && [ $DHCP_STATE != "unconfigured" ] ; then DHCP_STATE="disabled" @@ -122,12 +128,18 @@ DHCP_CONFIG_SAMPLE=${DHCP_CONFIG_SAMPLE_RHAS} elif [ -f ${DHCP_CONFIG_SAMPLE_SLES} ]; then DHCP_CONFIG_SAMPLE=${DHCP_CONFIG_SAMPLE_SLES} + elif [ -f ${DHCP_CONFIG_SAMPLE_DEB} ]; then + DHCP_CONFIG_SAMPLE=${DHCP_CONFIG_SAMPLE_DEB} fi diff ${DHCP_CONFIG} ${DHCP_CONFIG_SAMPLE} > /dev/null 2>&1 if [[ $? == 0 ]]; then mv ${DHCP_CONFIG} ${DHCP_CONFIG}.sunray else - dhcpd -t > /dev/null 2>&1 + if [[ -f "/usr/sbin/dhcpd3" ]]; then + dhcpd3 -t > /dev/null 2>&1 + else + dhcpd -t > /dev/null 2>&1 + fi if [[ $? == 0 ]]; then cat > ${DHCP_CONFIG}.$$ <<-! # ${SUNRAY_FILE_MARK} /etc/dhcpd.conf @@ -208,7 +220,11 @@ return 3 fi - /etc/init.d/dhcpd start > /dev/null 2>&1 + if [[ -f /etc/init.d/dhcp3-server ]]; then + /etc/init.d/dhcp3-server start > /dev/null 2>&1 + else + /etc/init.d/dhcpd start > /dev/null 2>&1 + fi return $? } @@ -216,8 +232,11 @@ if ! $DHCP_ENABLED ; then return 3 fi - - /etc/init.d/dhcpd stop > /dev/null 2>&1 + if [[ -f /etc/init.d/dhcp3-server ]]; then + /etc/init.d/dhcp3-server stop > /dev/null 2>&1 + else + /etc/init.d/dhcpd stop > /dev/null 2>&1 + fi return $? } @@ -225,8 +244,11 @@ if ! $DHCP_ENABLED ; then return 3 fi - - /etc/init.d/dhcpd restart > /dev/null 2>&1 + if [[ -f /etc/init.d/dhcp3-server ]]; then + /etc/init.d/dhcp3-server restart > /dev/null 2>&1 + else + /etc/init.d/dhcpd restart > /dev/null 2>&1 + fi return $? } @@ -237,11 +259,16 @@ if [[ $? -ne 0 ]] ; then ${UT_BASEDIR}/lib/utprodinfo -t installed ${DHCP_PACKAGE_SU} 2>/dev/null 1>&2 if [[ $? -ne 0 ]]; then - DHCP_INSTALLED=false - DHCP_ENABLED=false - DHCP_CONFIGURED=false - DHCP_RUNNING=false - DHCP_STATE="uninstalled" + ${UT_BASEDIR}/lib/utprodinfo -t installed ${DHCP_PACKAGE_DEB} 2>/dev/null 1>&2 + if [[ $? -ne 0 ]]; then + DHCP_INSTALLED=false + DHCP_ENABLED=false + DHCP_CONFIGURED=false + DHCP_RUNNING=false + DHCP_STATE="uninstalled" + else + DHCP_PACKAGE=${DHCP_PACKAGE_DEB} + fi else DHCP_PACKAGE=${DHCP_PACKAGE_SU} fi @@ -266,8 +293,11 @@ if [[ $? != 0 ]] ; then DHCP_CONFIGURED=false # Interface / subnet not defined fi - - /etc/init.d/dhcpd status 2> /dev/null | grep "running" >/dev/null 2>&1 + if [[ -f "/etc/init.d/dhcp3-server" ]]; then + /etc/init.d/dhcp3-server status 2> /dev/null | grep "running" >/dev/null 2>&1 + else + /etc/init.d/dhcpd status 2> /dev/null | grep "running" >/dev/null 2>&1 + fi if [[ $? -ne 0 ]]; then DHCP_RUNNING=false fi diff -ur SUNWut.orig/lib/utadmingid SUNWut/lib/utadmingid --- SUNWut.orig/lib/utadmingid 2008-12-09 10:43:32.000000000 +0100 +++ SUNWut/lib/utadmingid 2008-12-09 10:53:06.000000000 +0100 @@ -15,7 +15,7 @@ ETCDIR="/etc/opt/SUNWut" UTADMINPW=${ETCDIR}/utadmin.pw if [ -f $UTADMINPW ] ; then - WEBGUI_GROUP=`/bin/ls -gn $UTADMINPW | /bin/awk '{print $3}' ` + WEBGUI_GROUP=`/bin/ls -gn $UTADMINPW | awk '{print $3}' ` fi WEBGUI_GROUP=${WEBGUI_GROUP:-root} print $WEBGUI_GROUP diff -ur SUNWut.orig/lib/utctl.d/features/utcompatlinksctl SUNWut/lib/utctl.d/features/utcompatlinksctl --- SUNWut.orig/lib/utctl.d/features/utcompatlinksctl 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/utctl.d/features/utcompatlinksctl 2008-12-09 10:53:06.000000000 +0100 @@ -130,14 +130,14 @@ LIBLDAP=/usr/lib/libldap.so.199 LIBLDAP64=/usr/lib64/libldap.so.199 - COMPATLIB_LIBLDAP=/usr/lib/libldap-2.3.so.0 - COMPATLIB_LIBLDAP64=/usr/lib64/libldap-2.3.so.0 + COMPATLIB_LIBLDAP=/usr/lib/libldap-2.4.so.2 + COMPATLIB_LIBLDAP64=/usr/lib64/libldap-2.4.so.2 COMPATLINK_LIBLDAP=$LIB_COMPATLINKS/${LIBLDAP##*/} COMPATLINK64_LIBLDAP=$LIB_COMPATLINKS64/${LIBLDAP##*/} LIBLBER=/usr/lib/liblber.so.199 LIBLBER64=/usr/lib64/liblber.so.199 - COMPATLIB_LIBLBER=/usr/lib/liblber-2.3.so.0 + COMPATLIB_LIBLBER=/usr/lib/liblber-2.4.so.2 COMPATLIB_LIBLBER64=/usr/lib64/liblber-2.3.so.0 COMPATLINK_LIBLBER=$LIB_COMPATLINKS/${LIBLBER##*/} COMPATLINK64_LIBLBER=$LIB_COMPATLINKS64/${LIBLBER##*/} diff -ur SUNWut.orig/lib/utctl.d/features/utcronctl SUNWut/lib/utctl.d/features/utcronctl --- SUNWut.orig/lib/utctl.d/features/utcronctl 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/utctl.d/features/utcronctl 2008-12-09 10:53:06.000000000 +0100 @@ -37,13 +37,13 @@ return fi - (set +e; head -1 $CRONFILE | \ + (set +e; head -n 1 $CRONFILE | \ grep "^# DO NOT EDIT THIS FILE - edit the master and reinstall" \ > /dev/null 2>&1) if [ $? -eq 0 ]; then # comment exists, remove them cat /dev/null >$TMPFILE_COMM - head -3 $CRONFILE | sed \ + head -n 3 $CRONFILE | sed \ -e "/^# DO NOT EDIT THIS FILE - edit the master and reinstall/d" \ -e "/^# (\/[^ ]* installed/d" \ -e "/^# (Cron version/d" >> $TMPFILE_COMM diff -ur SUNWut.orig/lib/utctl.d/features/utgdmconfigctl SUNWut/lib/utctl.d/features/utgdmconfigctl --- SUNWut.orig/lib/utctl.d/features/utgdmconfigctl 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/utctl.d/features/utgdmconfigctl 2008-12-12 15:09:07.000000000 +0100 @@ -411,7 +411,7 @@ SRCRASHSCRIPT="${SUNRAY_GDM_DIR}/XKeepsCrashing.sunray" GDM_PACKAGE_NAME="gdm" TMPFILE="/var/opt/SUNWut/tmp/custom.conf.tmp.$$" - GDMGREETER=$(resolvePath gdmgreeter /usr/lib /usr/libexec) + GDMGREETER=$(resolvePath gdmgreeter /usr/lib /usr/libexec /usr/lib/gdm ) if [ $OS = "SunOS" ]; then AWK=nawk else diff -ur SUNWut.orig/lib/utdmsession SUNWut/lib/utdmsession --- SUNWut.orig/lib/utdmsession 2008-12-09 10:43:32.000000000 +0100 +++ SUNWut/lib/utdmsession 2008-12-09 10:53:06.000000000 +0100 @@ -26,7 +26,7 @@ #exec >/var/tmp/utdmsession.$$ 2>&1 # Debug #set -x -MOD="`/bin/basename $0`" +MOD="`basename $0`" USAGE="usage: $MOD [-c|-d] Xdisplay [-z tag]" UTMNT_DIRLOCK=".session" diff -ur SUNWut.orig/lib/utdtsession SUNWut/lib/utdtsession --- SUNWut.orig/lib/utdtsession 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/utdtsession 2008-12-09 10:53:06.000000000 +0100 @@ -554,7 +554,7 @@ # so that a new session can be created. # get the existing session ID - oldsid=$(head -1 $tif) + oldsid=$(head -n 1 $tif) # get the existing session type OLD_SESSION_TYPE="" diff -ur SUNWut.orig/lib/utgdmconfigpath SUNWut/lib/utgdmconfigpath --- SUNWut.orig/lib/utgdmconfigpath 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/utgdmconfigpath 2008-12-10 20:57:11.000000000 +0100 @@ -7,15 +7,15 @@ # -if [ "`uname -s`" = "SunOS" ]; then - GDM_DIR=/etc/X11/gdm/ -else - GDM_PATH=`rpm -ql "gdm" | grep "custom.conf"` - if [ $? != 0 ]; then - print -u2 "Cannot determine GDM install directory" - exit 1; - fi - GDM_DIR=${GDM_PATH%%custom\.conf*} -fi +#if [ "`uname -s`" = "SunOS" ]; then + GDM_DIR=/etc/gdm/ +#else +# GDM_PATH=`rpm -ql "gdm" | grep "custom.conf"` +# if [ $? != 0 ]; then +# print -u2 "Cannot determine GDM install directory" +# exit 1; +# fi +# GDM_DIR=${GDM_PATH%%custom\.conf*} +#fi print $GDM_DIR exit 0 diff -ur SUNWut.orig/lib/utxinit SUNWut/lib/utxinit --- SUNWut.orig/lib/utxinit 2008-12-09 10:43:32.000000000 +0100 +++ SUNWut/lib/utxinit 2008-12-10 21:22:01.000000000 +0100 @@ -103,7 +103,7 @@ XSERVER="/bin/false" # we check for Xnewt first. It will only fall back to Xsun if # Xnewt does not exist. - for XSERVERBIN in /usr/X11R6/bin/Xnewt /usr/openwin/bin/Xsun ; do + for XSERVERBIN in /opt/SUNWut/lib/Xnewt /usr/openwin/bin/Xsun ; do if [ -x $XSERVERBIN ] ; then XSERVER=$XSERVERBIN break diff -ur SUNWut.orig/lib/utxsun SUNWut/lib/utxsun --- SUNWut.orig/lib/utxsun 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/utxsun 2008-12-09 10:53:06.000000000 +0100 @@ -31,12 +31,17 @@ # fontpath is for a particular system. We'll grep through the # XF86Config file. For FCS we'll do this at install time and # keep the path in a file. -if [[ -f /etc/X11/XF86Config ]] ; then +if [[ -f /etc/X11/xorg.conf ]]; then + XCFG_FILE=/etc/X11/xorg.conf +else + XCFG_FILE=/etc/X11/XF86Config +fi +if [[ -f $XCFG_FILE ]] ; then # match lines with FontPath that are not commented out, # accumulate the path, but remove double quotes before appending: FONTPATH=$($AWK '$1 == "FontPath" { fp = fp "," substr($2,2,length($2)-2) } \ END { print substr(fp,2) } \ - ' /etc/X11/XF86Config) + ' $XCFG_FILE) if [ x$FONTPATH != x ] ; then XMOREOPTS="-fp $FONTPATH" fi diff -ur SUNWut.orig/lib/xmgr/gdm/add-dpy SUNWut/lib/xmgr/gdm/add-dpy --- SUNWut.orig/lib/xmgr/gdm/add-dpy 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/xmgr/gdm/add-dpy 2008-12-10 21:23:16.000000000 +0100 @@ -64,7 +64,7 @@ xcdesc="DisplayManager.*_%d.exportList: SUN_SUNRAY_TOKEN=$token CORONA_TOKEN=$token" if [ "$type" = normal ] then - xsdesc=":%d SunRay local /usr/X11R6/bin/Xnewt :%d" + xsdesc=":%d SunRay local /opt/SUNWut/lib/Xnewt :%d" else xsdesc="# :%d RESERVED" fi diff -ur SUNWut.orig/lib/xmgr/gdm/notify SUNWut/lib/xmgr/gdm/notify --- SUNWut.orig/lib/xmgr/gdm/notify 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/xmgr/gdm/notify 2008-12-10 20:50:50.000000000 +0100 @@ -24,16 +24,16 @@ verbose=0 umask 0022 -DMNAME=gdm-binary -which_gdm=$(whence gdm-binary) -if [ -z $which_gdm ]; then - which_gdm=$(whence gdm) - if [ -z $which_gdm ]; then - print -u2 "gdm/gdm-binary not found" - exit 1 - fi - DMNAME=gdm -fi +DMNAME=gdm +#which_gdm=$(whence gdm-binary) +#if [ -z $which_gdm ]; then +# which_gdm=$(whence gdm) +# if [ -z $which_gdm ]; then +# print -u2 "gdm/gdm-binary not found" +# exit 1 +# fi +# DMNAME=gdm +#fi unset LD_LIBRARY_PATH BASE=/etc/opt/SUNWut/basedir SUNWUTLIB=$BASE/lib diff -ur SUNWut.orig/lib/xmgr/gdm/remove-dpy SUNWut/lib/xmgr/gdm/remove-dpy --- SUNWut.orig/lib/xmgr/gdm/remove-dpy 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/xmgr/gdm/remove-dpy 2008-12-11 07:56:22.000000000 +0100 @@ -42,7 +42,7 @@ POSTLOGIN_DIR=${GDM_DIR}PostLogin INIT_DIR=${GDM_DIR}Init -DPY=`/bin/nawk -F= '{ +DPY=`awk -F= '{ if ($1 == "DISPLAY") {print $2} }' /tmp/SUNWut/config/ctokens/$token` diff -ur SUNWut.orig/lib/xmgr/gdm/reset-dpy SUNWut/lib/xmgr/gdm/reset-dpy --- SUNWut.orig/lib/xmgr/gdm/reset-dpy 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/lib/xmgr/gdm/reset-dpy 2008-12-10 20:51:14.000000000 +0100 @@ -19,16 +19,16 @@ CONFIGDIR=$1 CONFIGXDIR=$CONFIGDIR/xconfig -DMNAME=gdm-binary -which_gdm=$(whence gdm-binary) -if [ -z $which_gdm ]; then - which_gdm=$(whence gdm) - if [ -z $which_gdm ]; then - print -u2 "gdm/gdm-binary not found" - exit 1 - fi - DMNAME=gdm -fi +DMNAME=gdm +#which_gdm=$(whence gdm-binary) +#if [ -z $which_gdm ]; then +# which_gdm=$(whence gdm) +# if [ -z $which_gdm ]; then +# print -u2 "gdm/gdm-binary not found" +# exit 1 +# fi +# DMNAME=gdm +#fi # Note - we start MINDISP at 11 using gdm for linux. It gets around bug # 5057552, which is actually caused by lax privileges defined by diff -ur SUNWut.orig/sbin/utadm SUNWut/sbin/utadm --- SUNWut.orig/sbin/utadm 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/sbin/utadm 2008-12-09 10:53:06.000000000 +0100 @@ -5,7 +5,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # - # # Configuring SunRay interfaces: # ------------------------------ @@ -219,17 +218,28 @@ else NETWORKS="${ETC_OPT_UT}/net/networks"; fi - DHCPCONFIG="/etc/dhcpd.conf" + if [[ -f "/etc/dhcp3/dhcpd.conf" ]]; then + DHCPCONFIG="/etc/dhcp3/dhcpd.conf" + else + DHCPCONFIG="/etc/dhcpd.conf" + fi GREP=grep # XXX need to figure out which <=== - INIT_DHCP="/etc/init.d/dhcpd"; + if [[ -f "/etc/init.d/dhcp3-server" ]]; then + INIT_DHCP="/etc/init.d/dhcp3-server" + else + INIT_DHCP="/etc/init.d/dhcpd" + fi if [[ -d "/etc/sysconfig/network-scripts" ]] ; then IFCONFIG_SCRIPT="/etc/sysconfig/network-scripts/ifcfg-" IFCONFIG_BOOT="ONBOOT=yes" BOOTPROTO=none - else - IFCONFIG_SCRIPT="/etc/sysconfig/network/ifcfg-" - IFCONFIG_BOOT="STARTMODE=onboot" + elif [[ -f "/etc/network/interfaces" ]] ; then + IFCONFIG_SCRIPT="/etc/network/interfaces" BOOTPROTO=static + else + IFCONFIG_SCRIPT="/etc/sysconfig/network/ifcfg-" + IFCONFIG_BOOT="STARTMODE=onboot" + BOOTPROTO=static fi IFCFG_INET=""; @@ -991,6 +1001,10 @@ # get the intf's symbolic name INTF_NAME=`getent hosts ${INTF_IPA} | awk '{print $2}'`; if [ -z "${INTF_NAME}" ]; then + # Work around for bug in Ubuntu getent Launchpad BugID 28585 + INTF_NAME=`getent hosts | grep -w ${INTF_IPA} | awk '{print $2}'` + fi + if [ -z "${INTF_NAME}" ]; then print -u2 "Error: host name for ${INTF_IPA} not found" exit 1; fi @@ -1145,8 +1159,40 @@ ifconfig ${INTF} "${IPADDR}" up netmask "${NETMASK}" broadcast ${BROADCAST}; RC=$? if [[ ${RC} -eq 0 ]] ; then - rm -f ${TMPDIR}/tmpfile.$$; - cat > ${TMPDIR}/tmpfile.$$ <<-! + . /etc/lsb-release 2 > /dev/null + if [[ "$DISTRIB_ID" = "Ubuntu" ]] || [[ "$DISTRIB_ID" = "Debian" ]]; then + rm -f ${TMPDIR}/tmpfile.$$; + cat > ${TMPDIR}/tmpfile.$$ <<-! +# SUNRAY ADD +auto ${INTF} +iface ${INTF} inet ${BOOTPROTO} +address ${IPADDR} +netmask ${NETMASK} +# SUNRAY ADD +! + awk ' { + if (NF == "0") print $0; + else if ($1 == "allow") {print $0; param="false";} + else if ($1 == "mapping") {print $0; param="false";} + else if ($1 == "auto") + {if ($2 == Intf) print "# SUNRAY DEL "$0; + else print $0; + param="false";} + else if ($1 == "iface") + {if ($2 == Intf) {print "# SUNRAY DEL "$0; param="true";} + else {print $0; param="false";}} + else if (param == "true") print "# SUNRAY DEL "$0; + else {print $0; param="false";} + }' \ + Intf=${INTF} \ + ${IFCONFIG_SCRIPT} > ${IFCONFIG_SCRIPT}.$$ + + cat ${IFCONFIG_SCRIPT}.$$ ${TMPDIR}/tmpfile.$$ > ${IFCONFIG_SCRIPT} + rm -f ${TMPDIR}/tmpfile.$$ ${IFCONFIG_SCRIPT}.$$ + + else + rm -f ${TMPDIR}/tmpfile.$$; + cat > ${TMPDIR}/tmpfile.$$ <<-! DEVICE=${INTF} # SUNRAY ADD USERCTL=no # SUNRAY ADD ${IFCONFIG_BOOT} # SUNRAY ADD @@ -1156,17 +1202,18 @@ NETMASK=${NETMASK} # SUNRAY ADD IPADDR=${IPADDR} # SUNRAY ADD ! - if [[ -f ${IFCONFIG_SCRIPT}${INTF} ]] ; then - sed -e "/^"HWADDR"/!s/^/# SUNRAY DEL /" "${IFCONFIG_SCRIPT}${INTF}" > ${IFCONFIG_SCRIPT}${INTF}.$$ - # - # change ether config so it starts on boot - - rm -f ${IFCONFIG_SCRIPT}${INTF} - cat ${IFCONFIG_SCRIPT}${INTF}.$$ ${TMPDIR}/tmpfile.$$ > ${IFCONFIG_SCRIPT}${INTF} - rm -f ${IFCONFIG_SCRIPT}${INTF}.$$ ${TMPDIR}/tmpfile.$$ - else - mv -f ${TMPDIR}/tmpfile.$$ ${IFCONFIG_SCRIPT}${INTF}; - fi + if [[ -f ${IFCONFIG_SCRIPT}${INTF} ]] ; then + sed -e "/.*/s/^/# SUNRAY DEL /" "${IFCONFIG_SCRIPT}${INTF}" > ${IFCONFIG_SCRIPT}${INTF}.$$ + # + # change ether config so it starts on boot + + rm -f ${IFCONFIG_SCRIPT}${INTF} + cat ${IFCONFIG_SCRIPT}${INTF}.$$ ${TMPDIR}/tmpfile.$$ > ${IFCONFIG_SCRIPT}${INTF} + rm -f ${IFCONFIG_SCRIPT}${INTF}.$$ ${TMPDIR}/tmpfile.$$ + else + mv -f ${TMPDIR}/tmpfile.$$ ${IFCONFIG_SCRIPT}${INTF}; + fi + fi fi print "### finished install of \"${INTF}\" interface"; return $RC @@ -1187,6 +1234,38 @@ if [[ ! -s ${IFCONFIG_SCRIPT}${INTF} ]]; then rm -f ${IFCONFIG_SCRIPT}${INTF} fi + elif [[ -f ${IFCONFIG_SCRIPT} ]] ; then + cp ${IFCONFIG_SCRIPT} ${IFCONFIG_SCRIPT}.$$ + awk ' { + if (($2 == "SUNRAY" ) && ($3 == "DEL")) + {if (($4 == "auto") && ($5 == Intf)) + {output=""; + for (field=4; field<=NF; ++field) {output=output$field" ";} + print output; + param="false";} + else if (($4 == "iface") && ($5 == Intf )) + {output=""; for (field=4; field<=NF; ++field) {output=output$field" ";} + print output; + param="true";} + else if (param == "true") + {output=""; for (field=4; field<=NF; ++field) {output=output$field" ";} + print output; + param="true";} + else {print $0; param="false";} + } + else if (($2 == "SUNRAY") && ($3 == "ADD")) + {if (comment_count == "1") {if (remove != "true") {print $0;};comment_count = "2";remove = "false";} + else if (comment_count == "2") {comment_count = "1";remove = "possible"} + else {comment_count = "1"; remove="possible";} + } + else if (remove == "possible") + if (($1 == "auto") && ($2 == Intf)) {remove="true";} + else {remove="false";print "# SUNRAY ADD"; print $0;} + else if (remove != "true") {print $0; param="false";} + }' \ + Intf=${INTF} \ + ${IFCONFIG_SCRIPT}.$$ > ${IFCONFIG_SCRIPT} + rm -f ${IFCONFIG_SCRIPT}.$$ else print -u2 "Warning: unable to update ${IFCONFIG_SCRIPT}${INTF}"; fi @@ -1826,7 +1905,6 @@ ${UTDHCPSERVICE} disable > /dev/null 2>&1 } - # # adds the SR network configuration for both interface and subnetwork only. # @@ -3164,6 +3242,8 @@ lease_file=/var/lib/dhcpd/dhcpd.leases elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then lease_file=/var/lib/dhcp/db/dhcpd.leases + elif [ -f /var/lib/dhcp3/dhcpd.leases ]; then + lease_file=/var/lib/dhcp3/dhcpd.leases fi rm -f $tmp_leases diff -ur SUNWut.orig/sbin/utconfig SUNWut/sbin/utconfig --- SUNWut.orig/sbin/utconfig 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/sbin/utconfig 2008-12-09 10:53:06.000000000 +0100 @@ -240,7 +240,12 @@ # Define Linux specific LDAP variables # Determine which LDAP client package is installed # - LCL_PACKAGE="$(rpm -qf /usr/bin/ldapadd 2>/dev/null)" + . /etc/lsb-release + if [[ "$DISTRIB_ID" = "Ubuntu" ]] || [[ "$DISTRIB_ID" = "Debian" ]]; then + LCL_PACKAGE="$(dpkg-query -S /usr/bin/ldapadd | awk -F: '{print $1}' 2>/dev/null)" + else + LCL_PACKAGE="$(rpm -qf /usr/bin/ldapadd 2>/dev/null)" + fi # Define Linux versions of LDAP client commands # @@ -255,7 +260,11 @@ # Define Linux specific filenames # ETCSERVICES="/etc/services" - DHCPCONFIG="/etc/dhcpd.conf" + if [[ -f "/etc/dhcp3/dhcpd.conf" ]]; then + DHCPCONFIG="/etc/dhcp3/dhcpd.conf" + else + DHCPCONFIG="/etc/dhcpd.conf" + fi ;; *) diff -ur SUNWut.orig/sbin/utfwadm SUNWut/sbin/utfwadm --- SUNWut.orig/sbin/utfwadm 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/sbin/utfwadm 2008-12-09 10:53:06.000000000 +0100 @@ -144,7 +144,7 @@ function GetVersion { FW_FILE_INPUT=${1} # extract the version string and make file names - FW_TYPE=$(od -t x1 $FW_FILE_INPUT | head -1 | awk '{ print sprintf("%s%s%s%s", $2,$3,$4,$5)}') 2> /dev/null + FW_TYPE=$(od -t x1 $FW_FILE_INPUT | head -n 1 | awk '{ print sprintf("%s%s%s%s", $2,$3,$4,$5)}') 2> /dev/null case $FW_TYPE in 4badbeef | 8badbeef) $UTWHAT $FW_FILE_INPUT > ${TMPDIR}/fw_strings.$$ diff -ur SUNWut.orig/sbin/utreplica SUNWut/sbin/utreplica --- SUNWut.orig/sbin/utreplica 2008-12-09 10:43:31.000000000 +0100 +++ SUNWut/sbin/utreplica 2008-12-09 10:53:06.000000000 +0100 @@ -78,7 +78,13 @@ ETCSERVICES=/etc/inet/services LOGFILE="/var/adm/log/$PROGRAM_ID.${TIMESTAMP}.log" ;; - Linux) LCL_PACKAGE="$(rpm -qf /usr/bin/ldapadd 2>/dev/null)" + Linux) . /etc/lsb-release + if [[ "$DISTRIB_ID" = "Ubuntu" ]] || [[ "$DISTRIB_ID" = "Debian" ]]; then + LCL_PACKAGE="$(dpkg-query -S /usr/bin/ldapadd | awk -F: '{print $1}' 2>/dev/null)" + else + LCL_PACKAGE="$(rpm -qf /usr/bin/ldapadd 2>/dev/null)" + fi + LDAPSEARCH="/usr/bin/ldapsearch -x -LLL " GREP=/bin/grep ETCSERVICES=/etc/services @@ -1130,7 +1136,7 @@ Fatal "$server is already configured as a primary server." elif print $remote_rep | egrep "$SECONDARY_ID"\ >/dev/null 2>&1; then - typeset -l tmp_host=`print "$remote_rep" | tail -1` + typeset -l tmp_host=`print "$remote_rep" | tail -n 1` if [ "${tmp_host}" != $HOSTNAME ]; then Fatal "$server is already configured as a secondary server\n"\ "with a different primary." @@ -1169,7 +1175,7 @@ then # only check the first line of the file. This avoids the problem of accidentally # picking up the "replica" attribute which will also have the same string match. - head -1 $DSSERV_REPLOG | grep '^replica: ' >/dev/null 2>&1 + head -n 1 $DSSERV_REPLOG | grep '^replica: ' >/dev/null 2>&1 if [ $? -ne 0 ] then cat /dev/null > $DSSERV_REPLOG