[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#35325: sysklogd: diff for NMU version 1.5-6.1, DELAYED/15



On Tue, May 10, 2011 at 12:09:23PM +0200, Martin Pitt wrote:
> Matt Zimmerman [2011-05-10 11:36 +0200]:
> > The kernel has been fixed in Ubuntu, in Debian, or in upstream?
> 
> All of them by now. The fix got landed upstream in February 2010:
> 
>   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=002345925e6c45861f60db6f4fc6236713fd8847
> 
> I think it landed in 2.6.35.

As a result of this, the following patch is proposed to correct this
change by reverting the previous NMU.  This also cleans up by
deleting the users and changing the ownership of the files back to
root:root.  Comments?

It might need additional logic to remove /var/run/klog after
restarting the daemon.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff -urN sysklogd-1.5-6.1/debian/changelog sysklogd-1.5/debian/changelog
--- sysklogd-1.5-6.1/debian/changelog	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/changelog	2011-12-13 19:00:53.333160796 +0000
@@ -1,3 +1,13 @@
+sysklogd (1.5-6.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Revert previous NMU due to the bug having been fixed in kernel
+    previously, obviating the need for the patch (#35325).  Remove
+    sysklogd and klogd users in postinst, after reverting file
+    ownership back to root.
+
+ -- Roger Leigh <rleigh@debian.org>  Tue, 13 Dec 2011 19:00:46 +0000
+
 sysklogd (1.5-6.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -urN sysklogd-1.5-6.1/debian/control sysklogd-1.5/debian/control
--- sysklogd-1.5-6.1/debian/control	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/control	2011-12-13 18:46:38.751170218 +0000
@@ -8,7 +8,7 @@
 Package: sysklogd
 Architecture: any
 Section: admin
-Depends: ${shlibs:Depends}, klogd | linux-kernel-log-daemon, adduser, lsb-base
+Depends: ${shlibs:Depends}, klogd | linux-kernel-log-daemon, lsb-base
 Conflicts: syslogd
 Provides: syslogd, system-log-daemon
 Replaces: syslogd
@@ -21,7 +21,7 @@
 Package: klogd
 Architecture: any
 Section: admin
-Depends: ${shlibs:Depends}, sysklogd | system-log-daemon, adduser, lsb-base
+Depends: ${shlibs:Depends}, sysklogd | system-log-daemon, lsb-base
 Conflicts: sysklogd (<= 1.3-33)
 Provides: linux-kernel-log-daemon
 Replaces: sysklogd
diff -urN sysklogd-1.5-6.1/debian/cron.daily sysklogd-1.5/debian/cron.daily
--- sysklogd-1.5-6.1/debian/cron.daily	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/cron.daily	2011-12-13 18:46:38.751170218 +0000
@@ -24,9 +24,6 @@
 test -x /sbin/syslogd || exit 0
 test -f /usr/share/sysklogd/dummy || exit 0
 
-USER=$(ps -C syslogd -o user= | head -n 1)
-[ -z "${USER}" ] && USER="root" || true
-
 set -e
 
 cd /var/log
@@ -38,7 +35,7 @@
 for LOG in $logs
 do
    if [ -s $LOG ]; then
-      savelog -g adm -m 640 -u ${USER} -c 7 $LOG >/dev/null
+      savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null
    fi
 done
 
diff -urN sysklogd-1.5-6.1/debian/cron.weekly sysklogd-1.5/debian/cron.weekly
--- sysklogd-1.5-6.1/debian/cron.weekly	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/cron.weekly	2011-12-13 18:46:38.751170218 +0000
@@ -25,9 +25,6 @@
 
 set -e
 
-USER=$(ps -C syslogd -o user= | head -n 1)
-[ -z "${USER}" ] && USER="root" || true
-
 cd /var/log
 
 logs=$(syslogd-listfiles --weekly)
@@ -37,7 +34,7 @@
 for LOG in $logs
 do
    if [ -s $LOG ]; then
-      savelog -g adm -m 640 -u ${USER} -c 4 $LOG >/dev/null
+      savelog -g adm -m 640 -u root -c 4 $LOG >/dev/null
    fi
 done
 
diff -urN sysklogd-1.5-6.1/debian/default.klogd sysklogd-1.5/debian/default.klogd
--- sysklogd-1.5-6.1/debian/default.klogd	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/default.klogd	2011-12-13 18:46:38.751170218 +0000
@@ -12,4 +12,4 @@
 # -c 4 to alter the kernel console log level (deprecated)
 #   use sysctl instead
 #
-#KLOGD="-P /var/run/klogd/kmsg -x"
+KLOGD="-x"
diff -urN sysklogd-1.5-6.1/debian/postinst sysklogd-1.5/debian/postinst
--- sysklogd-1.5-6.1/debian/postinst	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/postinst	2011-12-13 18:57:20.830342400 +0000
@@ -11,7 +11,7 @@
     esac
 
     # Prepare for takeover of the host
-    if [ -z "$2" ]
+    if [ -z "$2" ] || [ "$2" = "1.5-6.1" ] 
     then
 	if [ ! -e /var/log/news ] \
 	    && grep -q '^[^#].*/var/log/news/' /etc/syslog.conf \
@@ -52,7 +52,7 @@
 
     update-rc.d sysklogd defaults 10 90 >/dev/null
 
-    adduser --system --group --no-create-home --quiet syslog
+    deluser --system --quiet syslog || true
 
     # restarting daemon
     #
diff -urN sysklogd-1.5-6.1/debian/postinst.klogd sysklogd-1.5/debian/postinst.klogd
--- sysklogd-1.5-6.1/debian/postinst.klogd	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/postinst.klogd	2011-12-13 18:59:29.252056423 +0000
@@ -25,7 +25,8 @@
 
     update-rc.d klogd defaults 11 89 >/dev/null
 
-    adduser --system --quiet --group --no-create-home klog || true
+    chown -R root:root /var/run/klogd
+    deluser --system --quiet klog || true
 
     # restarting daemon
     #
diff -urN sysklogd-1.5-6.1/debian/postrm.klogd sysklogd-1.5/debian/postrm.klogd
--- sysklogd-1.5-6.1/debian/postrm.klogd	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/postrm.klogd	2011-12-13 18:46:38.755170262 +0000
@@ -4,7 +4,6 @@
 
 if [ "$1" = "purge" ]
 then
-  deluser --system --quiet klog || true
   update-rc.d klogd remove >/dev/null
 
   test ! -f /lib/init/rw/sendsigs.omit.d/klogd || \
diff -urN sysklogd-1.5-6.1/debian/rc sysklogd-1.5/debian/rc
--- sysklogd-1.5-6.1/debian/rc	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/rc	2011-12-13 18:46:38.755170262 +0000
@@ -19,31 +19,8 @@
 
 test -x $binpath || exit 0
 
-# syslogd options should be set in /etc/default/syslogd
-SYSLOGD=""
-
-# user to run syslogd as - this can overriden in /etc/default/syslogd
-USER="syslog"
-
 test ! -r /etc/default/syslogd || . /etc/default/syslogd
 
-# Figure out under which user syslogd should be running as
-if echo ${SYSLOGD} | grep -q '^.*-u[[:space:]]*\([[:alnum:]]*\)[[:space:]]*.*$'
-then
-	# A specific user has been set on the command line, try to extract it.
-	USER=$(echo ${SYSLOGD} | sed -e 's/^.*-u[[:space:]]*\([[:alnum:]]*\)[[:space:]]*.*$/\1/')
-else
-	# By default, run syslogd under the syslog user
-	SYSLOGD="${SYSLOGD} -u ${USER}"
-fi
-
-# Unable to get the user under which syslogd should be running, stop.
-if [ -z "${USER}" ]
-then
-	log_failure_msg "Unable to get syslog user"
-	exit 1
-fi
-
 . /lib/lsb/init-functions
 
 create_xconsole()
@@ -59,18 +36,8 @@
     else
 	chmod 0640 /dev/xconsole
     fi
-
-    chown ${USER}:adm /dev/xconsole
+    chown root:adm /dev/xconsole
     test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole
-
-}
-
-fix_log_ownership()
-{
-	for l in `syslogd-listfiles -a`
-	do
-		chown ${USER}:adm $l
-	done
 }
 
 running()
@@ -112,7 +79,6 @@
   start)
     log_begin_msg "Starting system log daemon..."
     create_xconsole
-    fix_log_ownership
     start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
     log_end_msg $?
     test -d /lib/init/rw/sendsigs.omit.d || mkdir -p /lib/init/rw/sendsigs.omit.d
@@ -126,14 +92,12 @@
     ;;
   reload|force-reload)
     log_begin_msg "Reloading system log daemon..."
-    fix_log_ownership
     start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile --name syslogd
     log_end_msg $?
     ;;
   restart)
     log_begin_msg "Restarting system log daemon..."
     start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile --name syslogd
-    fix_log_ownership
     start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
     log_end_msg $?
     ;;
diff -urN sysklogd-1.5-6.1/debian/rc.klogd sysklogd-1.5/debian/rc.klogd
--- sysklogd-1.5-6.1/debian/rc.klogd	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/rc.klogd	2011-12-13 18:46:38.755170262 +0000
@@ -12,55 +12,37 @@
 
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 
-pidfile=/var/run/klogd/klogd.pid
-kmsgpipe=/var/run/klogd/kmsg
-kmsgpidfile=/var/run/klogd/kmsgpipe.pid
+pidfile=/var/run/klogd.pid
 binpath=/sbin/klogd
 
 test -f $binpath || exit 0
 
-. /lib/lsb/init-functions
-
-#  Use KLOGD="-k /boot/System.map-$(uname -r)" to specify System.map
-#
-KLOGD="-P $kmsgpipe"
-
 test ! -r /etc/default/klogd || . /etc/default/klogd
 
+. /lib/lsb/init-functions
+
 case "$1" in
   start)
     log_begin_msg "Starting kernel log daemon..."
-    # create klog-writeable pid and fifo directory
-    mkdir -p /var/run/klogd
-    chown klog:klog /var/run/klogd
-    mkfifo -m 700 $kmsgpipe
-    chown klog:klog $kmsgpipe
- 
-    # shovel /proc/kmsg to pipe readable by klogd user
-    start-stop-daemon --start --pidfile $kmsgpidfile --exec /bin/dd -b -m -- bs=1 if=/proc/kmsg of=$kmsgpipe
- 
-    # start klogd as non-root with reading from kmsgpipe
-    start-stop-daemon --start --quiet --chuid klog --exec $binpath -- $KLOGD
+    start-stop-daemon --start --quiet --pidfile $pidfile --name klogd --startas $binpath -- $KLOGD
     log_end_msg $?
+    test -d /lib/init/rw/sendsigs.omit.d || mkdir -p /lib/init/rw/sendsigs.omit.d
+    test ! -f /lib/init/rw/sendsigs.omit.d/klogd || rm -f /lib/init/rw/sendsigs.omit.d/klogd
+    ln -s $pidfile /lib/init/rw/sendsigs.omit.d/klogd
     ;;
   stop)
     log_begin_msg "Stopping kernel log daemon..."
-    start-stop-daemon --stop --quiet --retry 3 --oknodo --exec $binpath --pidfile $pidfile
-    # stop kmsgpipe
-    start-stop-daemon --stop --quiet --oknodo --pidfile $kmsgpidfile
-    rm -f $kmsgpidfile $kmsgpipe
+    start-stop-daemon --stop --quiet --retry 3 --exec $binpath --pidfile $pidfile
     log_end_msg $?
     ;;
   restart|force-reload)
-    $0 stop
-    sleep 1
-    $0 start
-    ;;
-  status)
-    status_of_proc -p $pidfile $binpath klogd && exit 0 || exit $?
+    log_begin_msg "Reloading kernel log daemon..."
+    start-stop-daemon --stop --quiet --retry 3 --exec $binpath --pidfile $pidfile
+    start-stop-daemon --start --quiet --pidfile $pidfile --name klogd --startas $binpath -- $KLOGD
+    log_end_msg $?
     ;;
   *)
-    log_success_msg "Usage: /etc/init.d/klogd {start|stop|restart|force-reload|status}"
+    log_success_msg "Usage: /etc/init.d/klogd {start|stop|restart|force-reload}"
     exit 1
 esac
 
diff -urN sysklogd-1.5-6.1/debian/rules sysklogd-1.5/debian/rules
--- sysklogd-1.5-6.1/debian/rules	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/debian/rules	2011-12-13 18:46:38.755170262 +0000
@@ -39,7 +39,7 @@
 build:
 	$(MAKE) DEB="-DDEBRELEASE=\\\"$(revision)\\\"" \
 		SKFLAGS="$(CFLAGS) -DSYSV -fomit-frame-pointer -fno-strength-reduce" \
-		LDFLAGS="" KLOGD_DEFINES='-DPIDFILE_DIR=\"/var/run/klogd/\"'
+		LDFLAGS=""
 	pod2man --section=8 --lax --center="Debian GNU/Linux" \
 	  --release="Debian Project" debian/syslog-facility.pod \
 	  > syslog-facility.8
diff -urN sysklogd-1.5-6.1/klogd.8 sysklogd-1.5/klogd.8
--- sysklogd-1.5-6.1/klogd.8	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/klogd.8	2011-12-13 18:46:38.755170262 +0000
@@ -18,9 +18,6 @@
 .RB [ " \-n " ]
 .RB [ " \-o " ]
 .RB [ " \-p " ]
-.RB [ " \-P "
-.I path
-]
 .RB [ " \-s " ]
 .RB [ " \-k "
 .I fname
@@ -67,11 +64,6 @@
 symbol information whenever an Oops string is detected in the kernel message
 stream.
 .TP
-.B "\-P " path
-Use \fIpath\fR instead of /proc/kmsg as the source of the kernel message.
-Specify "-" to read from standard input.  This allows klogd to run entirely
-without root privileges.
-.TP
 .B "\-s"
 Force \fBklogd\fP to use the system call interface to the kernel message
 buffers.
@@ -102,15 +94,10 @@
 .I /proc
 file system and the syscall (sys_syslog) interface, although
 ultimately they are one and the same.  Klogd is designed to choose
-whichever source of information is the most appropriate.  If the
-.B \-P
-switch is used,
-.B klogd
-opens the specified path as the source of kernel log information.  Otherwise
-.B klogd
-checks for the presence of a mounted 
+whichever source of information is the most appropriate.  It does this
+by first checking for the presence of a mounted 
 .I /proc
-file system and if this is found the 
+file system.  If this is found the 
 .I /proc/kmsg
 file is used as the source of kernel log
 information.  If the proc file system is not mounted 
diff -urN sysklogd-1.5-6.1/klogd.c sysklogd-1.5/klogd.c
--- sysklogd-1.5-6.1/klogd.c	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/klogd.c	2011-12-13 18:46:38.755170262 +0000
@@ -20,13 +20,6 @@
 */
 
 /*
- * Thu Nov 25 16:48:39 CET 2004:  Martin Pitt
- *      Added option -P to give alternative location of /proc/kmsg ("-" for
- *      stdin). This allows to run klogd entirely without root privileges.
- *
- *      Added support for macro PIDFILE_DIR which is used as pid file directory
- *      instead of _PATH_VARRUN.
- *
  * Steve Lord (lord@cray.com) 7th Nov 92
  *
  * Modified to check for kernel info by Dr. G.W. Wettstein 02/17/93.
@@ -296,9 +289,7 @@
 #define LOG_LINE_LENGTH 1000
 
 #ifndef TESTING
-#if defined(PIDFILE_DIR)
-static char	*PidFile = PIDFILE_DIR "klogd.pid";
-#elif defined(FSSTND)
+#if defined(FSSTND)
 static char	*PidFile = _PATH_VARRUN "klogd.pid";
 #else
 static char	*PidFile = "/etc/klogd.pid";
@@ -322,8 +313,6 @@
 
 static FILE *output_file = (FILE *) 0;
 
-static char     *kmsg_file = NULL; /* NULL means default /proc/kmsg */
-
 static enum LOGSRC {none, proc, kernel} logsrc;
 
 int debugging = 0;
@@ -554,22 +543,6 @@
 		       "console output.");
 	}
 
-        /* Do we read kernel messages from a pipe? */
-        if ( kmsg_file ) {
-                if ( !strcmp(kmsg_file, "-") )
-                        kmsg = fileno(stdin);
-                else {
-                        if ( (kmsg = open(kmsg_file, O_RDONLY)) < 0 )
-                        {
-                                fprintf(stderr, "klogd: Cannot open kmsg file, " \
-                                        "%d - %s.\n", errno, strerror(errno));
-                                ksyslog(7, NULL, 0);
-                                exit(1);
-                        }
-                }
-                return proc;
-        }
-
 	/*
 	 * First do a stat to determine whether or not the proc based
 	 * file system is available to get kernel messages from.
@@ -1017,7 +990,7 @@
 	chdir ("/");
 #endif
 	/* Parse the command-line. */
-	while ((ch = getopt(argc, argv, "c:df:iIk:nopP:svx2")) != EOF)
+	while ((ch = getopt(argc, argv, "c:df:iIk:nopsvx2")) != EOF)
 		switch((char)ch)
 		{
 		    case '2':		/* Print lines with symbols twice. */
@@ -1051,9 +1024,6 @@
 		    case 'p':
 			SetParanoiaLevel(1);	/* Load symbols on oops. */
 			break;	
-                    case 'P':           /* Alternative kmsg file path */
-                        kmsg_file = strdup(optarg);
-                        break;
 		    case 's':		/* Use syscall interface. */
 			use_syscall = 1;
 			break;
@@ -1065,6 +1035,7 @@
 			break;
 		}
 
+
 	/* Set console logging level. */
 	if ( log_level != (char *) 0 )
 	{
diff -urN sysklogd-1.5-6.1/Makefile sysklogd-1.5/Makefile
--- sysklogd-1.5-6.1/Makefile	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/Makefile	2011-12-13 18:46:38.755170262 +0000
@@ -70,7 +70,7 @@
 SYSLOGD_FLAGS= -DSYSLOG_INET -DSYSLOG_UNIXAF -DNO_SCCS ${FSSTND} \
 	${SYSLOGD_PIDNAME}
 SYSLOG_FLAGS= -DALLOW_KERNEL_LOGGING
-KLOGD_FLAGS = ${FSSTND} ${KLOGD_START_DELAY} ${KLOGD_DEFINES}
+KLOGD_FLAGS = ${FSSTND} ${KLOGD_START_DELAY}
 DEB =
 
 all: syslogd klogd
@@ -102,7 +102,7 @@
 	${CC} ${SKFLAGS} ${SYSLOG_FLAGS} -c syslog.c
 
 klogd.o: klogd.c klogd.h version.h
-	${CC} -U_FORTIFY_SOURCE ${SKFLAGS} ${KLOGD_FLAGS} $(DEB) -c klogd.c
+	${CC} ${SKFLAGS} ${KLOGD_FLAGS} $(DEB) -c klogd.c
 
 ksym.o: ksym.c klogd.h ksyms.h module.h
 	${CC} ${SKFLAGS} ${KLOGD_FLAGS} -c ksym.c
diff -urN sysklogd-1.5-6.1/sysklogd.8 sysklogd-1.5/sysklogd.8
--- sysklogd-1.5-6.1/sysklogd.8	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/sysklogd.8	2011-12-13 18:46:38.755170262 +0000
@@ -29,9 +29,6 @@
 .RB [ " \-s "
 .I domainlist
 ]
-.RB [ " \-u"
-.IB user
-]
 .RB [ " \-v " ]
 .SH DESCRIPTION
 .B Sysklogd
@@ -153,26 +150,6 @@
 no domain would be cut, you will have to specify two domains like:
 .BR "\-s north.de:infodrom.north.de" .
 .TP
-.BI "\-u" " user"
-The
-.B syslogd
-daemon runs with full root privileges by default. If you specify this
-option, the daemon will drop its privileges to the given user (and the
-primary group of this user) before starting up logging. This
-greatly reduces the potential impact of exploitable security holes in
-syslogd.
-
-.B syslogd
-will still open all log files as root at startup.
-However, after receiving a
-.B SIGHUP
-signal (which causes the daemon to restart) the log files will be
-reopened as the non-privileged user which fails if the log files are
-only writeable by root. If you need to restart the daemon using the
-signal, then you have to adapt the permissions of your log files to be
-writeable by the specified user (or its primary group).
-
-.TP
 .B "\-v"
 Print version and exit.
 .SH SIGNALS
diff -urN sysklogd-1.5-6.1/syslogd.c sysklogd-1.5/syslogd.c
--- sysklogd-1.5-6.1/syslogd.c	2011-12-13 18:42:17.000000000 +0000
+++ sysklogd-1.5/syslogd.c	2011-12-13 18:46:38.755170262 +0000
@@ -46,10 +46,6 @@
  * extensive changes by Ralph Campbell
  * more extensive changes by Eric Allman (again)
  *
- * Wed Nov 24 2004 14:02:48 CET 2004: Martin Pitt
- *      Added option "-u <user>" to drop privileges to given user after
- *      initialisation.
- *
  * Steve Lord:	Fix UNIX domain socket code, added linux kernel logging
  *		change defines to
  *		SYSLOG_INET	- listen on a UDP socket
@@ -557,9 +553,6 @@
 #include <paths.h>
 #endif
 
-#include <pwd.h>
-#include <grp.h>
-
 #ifndef UTMP_FILE
 #ifdef UTMP_FILENAME
 #define UTMP_FILE UTMP_FILENAME
@@ -885,11 +878,6 @@
 	extern char *optarg;
 	int maxfds;
 
-        /* user and group id to drop to */
-        uid_t uid = 0;
-        gid_t gid = 0;
-        const char* username = NULL;
-
 #ifndef TESTING
 	chdir ("/");
 #endif
@@ -898,7 +886,7 @@
 		funix[i]  = -1;
 	}
 
-	while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:vu:")) != EOF)	
+	while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
 		switch((char)ch) {
 		case 'a':
 			if (nfunix < MAXFUNIX)
@@ -946,21 +934,6 @@
 		case 'v':
 			printf("syslogd %s.%s\n", VERSION, PATCHLEVEL);
 			exit (0);
-		case 'u':
-                        if (optarg) {
-                                username = strdup (optarg);
-                                struct passwd *pw = getpwnam (username);
-                                if (!pw) {
-                                        fprintf (stderr, "User %s does not exist, aborting.\n", username);
-                                        exit (1);
-                                }
-                                uid = pw->pw_uid;
-                                gid = pw->pw_gid;
-                        } else {
-                                fputs ("Internal error: -u optarg == NULL!\n", stderr);
-                                exit (1);
-                        }
-			break;
 		case '?':
 		default:
 			usage();
@@ -1114,19 +1087,6 @@
 		kill (ppid, SIGTERM);
 #endif
 
-        /*
-         * Drop privileges if -u was specified
-         */
-	if (username) {
-                if (initgroups (username, gid) || 
-                    setgid (gid) || setuid (uid)) {
-                        perror ("Could not drop to specified user privileges");
-                        exit (1);
-                }
-                free (username);
-                username = NULL;
-        }
-
 	/* Main loop begins here. */
 	for (;;) {
 		int nfds;
@@ -1279,7 +1239,7 @@
 int usage()
 {
 	fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
-		" [-s domainlist] [-f conffile] [-u user]\n");
+		" [-s domainlist] [-f conffile]\n");
 	exit(1);
 }
 
@@ -1643,10 +1603,10 @@
 	int msglen;
 	char *timestamp;
 #ifdef __gnu_linux__
-        sigset_t mask;
+	sigset_t mask;
 #else
 #ifndef SYSV
-        sigset_t omask;
+	sigset_t omask;
 #endif
 #endif
 
@@ -1658,9 +1618,9 @@
 	sigaddset(&mask, SIGALRM);
 	sigprocmask(SIG_BLOCK, &mask, NULL);
 #else
-#  ifndef SYSV
+#ifndef SYSV
 	omask = sigblock(sigmask(SIGHUP)|sigmask(SIGALRM));
-#  endif
+#endif
 #endif
 
 	/*
@@ -1700,11 +1660,11 @@
 			f->f_file = -1;
 		}
 #ifdef __gnu_linux__
-	sigprocmask(SIG_UNBLOCK, &mask, NULL);
+		sigprocmask(SIG_UNBLOCK, &mask, NULL);
 #else
-#  ifndef SYSV
+#ifndef SYSV
 		(void) sigsetmask(omask);
-#  endif
+#endif
 #endif
 		return;
 	}
@@ -1771,9 +1731,9 @@
 #ifdef __gnu_linux__
 	sigprocmask(SIG_UNBLOCK, &mask, NULL);
 #else
-#  ifndef SYSV
+#ifndef SYSV
 	(void) sigsetmask(omask);
-#  endif
+#endif
 #endif
 }
 #if FALSE

Reply to: