diff --git a/setserial-2.17-rc.patch b/setserial-2.17-rc.patch new file mode 100644 index 0000000..4636629 --- /dev/null +++ b/setserial-2.17-rc.patch @@ -0,0 +1,65 @@ +--- setserial-2.17/rc.serial.rc Thu Jan 27 15:47:30 2000 ++++ setserial-2.17/rc.serial Tue Sep 11 17:54:26 2001 +@@ -19,7 +19,7 @@ + # + + RCLOCKFILE=/var/lock/subsys/serial +-DIRS="/lib/modules/`uname -r`/misc /lib/modules /usr/lib/modules ." ++DIRS="/lib/modules/`uname -r`/kernel/drivers/char /lib/modules/`uname -r`/misc /lib/modules /usr/lib/modules ." + PATH=/bin:/sbin:/usr/bin + DRIVER=serial + DRIVER_NAME=serial +@@ -79,10 +79,11 @@ + + if test $action = stop ; then + if test -n ${SETSERIAL} -a "$LOADED" != "no" -a \ +- `head -1 /etc/serial.conf`X = "###AUTOSAVE###X" ; then ++ "$(head -1 /etc/serial.conf 2>/dev/null)" = "###AUTOSAVE###" ; then + echo -n "Saving state of serial devices... " + grep "^#" /etc/serial.conf > /etc/.serial.conf.new +- ${SETSERIAL} -G -g ${ALLDEVS} >> /etc/.serial.conf.new ++ ${SETSERIAL} -G -g ${ALLDEVS} \ ++ 2>/dev/null >> /etc/.serial.conf.new + mv /etc/serial.conf /etc/.serial.conf.old + mv /etc/.serial.conf.new /etc/serial.conf + echo "done." +@@ -108,22 +109,26 @@ + # If not stop, it must be a start.... + # + +-if test -n $MODULE -a "$LOADED" != "yes" ; then ++if test -n "$MODULE" -a "$LOADED" != "yes" ; then ++ MAPFILE=$(mktemp /tmp/$DRIVER.map.XXXXXX) \ ++ || { echo "Couldn't create secure temporary file"; exit 1; } ++ ERRORS=$(mktemp /tmp/$DRIVER.XXXXXX) \ ++ || { echo "Couldn't create secure temporary file"; exit 1; } + if insmod -fm $MODULE $DRIVER_ARG \ +- > /tmp/$DRIVER.map 2> /tmp/$DRIVER.$$; then :; ++ > "${MAPFILE}" 2> "${ERRORS}"; then :; + else + echo "Couldn't load $DRIVER_NAME driver." +- echo "See error logs in /tmp/$DRIVER.$$" ++ echo "See error logs in ${ERRORS}" + exit 1 + fi +- /bin/rm -f /tmp/$DRIVER.$$ ++ /bin/rm -f "${ERRORS}" + fi + +-if test -f /etc/serial.conf ; then +- if test -n ${SETSERIAL} ; then ++if test -f "/etc/serial.conf" ; then ++ if test -n "${SETSERIAL}" ; then + grep -v ^# < /etc/serial.conf | while read device args + do +- ${SETSERIAL} -z $device $args ++ ${SETSERIAL} -z $device $args 2>/dev/null + done + fi + else +@@ -131,4 +136,4 @@ + fi + + touch ${RCLOCKFILE} +-${SETSERIAL} -bg ${ALLDEVS} ++${SETSERIAL} -bg ${ALLDEVS} 2>/dev/null diff --git a/setserial-2.17-readme.patch b/setserial-2.17-readme.patch new file mode 100644 index 0000000..1ca8f99 --- /dev/null +++ b/setserial-2.17-readme.patch @@ -0,0 +1,11 @@ +--- setserial-2.17/README.readme Tue Sep 11 17:59:52 2001 ++++ setserial-2.17/README Tue Sep 11 18:00:27 2001 +@@ -13,6 +13,6 @@ + + The simplest way to configure the serial ports is to copy the provided + rc.serial file to the appropriate /etc/rc.d directory. For example, +-to install rc.serial on a RedHat system, copy rc.serial to +-/etc/rc.d/init.d/serial, and then run the command "chkconfig -add serial". ++to install rc.serial on a Red Hat Linux system, copy rc.serial to ++/etc/rc.d/init.d/serial, and then run the command "chkconfig --add serial". + diff --git a/setserial.spec b/setserial.spec index 5807daa..16487ab 100644 --- a/setserial.spec +++ b/setserial.spec @@ -3,10 +3,12 @@ Summary: A utility for configuring serial ports. Name: setserial Version: 2.17 -Release: 4 +Release: 5 Source: ftp://tsx-11.mit.edu/pub/linux/sources/sbin/setserial-%{version}.tar.gz Patch0: setserial-2.17-fhs.patch -Copyright: GPL +Patch1: setserial-2.17-rc.patch +Patch2: setserial-2.17-readme.patch +License: GPL Group: Applications/System Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-root @@ -20,6 +22,8 @@ port and IRQ that a particular serial device is using, and more. %prep %setup -q %patch0 -p1 -b .fhs +%patch1 -p1 -b .rc +%patch2 -p1 -b .readme rm -f config.cache %build @@ -44,7 +48,12 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man*/* %changelog -* Tue Jun 19 2001 Florian La Roche +* Tue Sep 11 2001 Tim Waugh 2.17-5 +- Fix init script (bug #52862). +- Avoid temporary file vulnerability in init script. +- Update README: it's --add, not -add. + +* Tue Jun 19 2001 Florian La Roche 2.17-4 - add ExcludeArch: s390 s390x * Wed May 30 2001 Tim Waugh 2.17-3