Hello community,
here is the log from the commit of package sysvinit for openSUSE:Factory
checked in at Sun Apr 25 18:42:17 CEST 2010.
--------
--- sysvinit/sysvinit.changes 2010-04-14 09:51:40.000000000 +0200
+++ /mounts/work_src_done/STABLE/sysvinit/sysvinit.changes 2010-04-14 09:49:45.000000000 +0200
@@ -1,0 +2,5 @@
+Tue Apr 13 18:27:02 CEST 2010 - werner@suse.de
+
+- Add patch to make last(1) knowing latest IPv6 specs
+
+-------------------------------------------------------------------
@@ -9,0 +15,88 @@
+- Update to sysvinit (2.88dsf) world; urgency=low
+
+ * Mention new home on Savannah in README.
+ * Revert change from Fedora/RedHat where the now obsolete command
+ INIT_CMD_CHANGECONS was introduced. Based on feedback and patch
+ from Bill Nottingham.
+ * Adjust makefile to make sure the install directories are created
+ before files are copied into them.
+ * Simplify build rules, based on patch from Mike Frysinger and Gentoo.
+ * Fix minor bug in optimizing of argument parsing. Based on
+ report from jakemus on freshmeat.
+ * Add casts to get rid of compiler warning about signed/unsigned issues.
+ * Change tty handling in init to make sure the UTF-8 flag is not cleared
+ on boot. Patch from Samuel Thibault.
+ * Add Makefile in toplevel directory.
+ * Print usage information when shutdown is used by non-root user.
+ Patch from Mike Frysinger and Gentoo.
+ * Sync shutdown manual page and usage information. Patch from Mike
+ Frysinger and Gentoo.
+ * Fix race condition in utmp writing. Patch from Gil Kloepfer via
+ Mike Frysinger and Gentoo.
+ * Rewrite findtty() in bootlogd to recursively search /dev/ for the
+ correct device, to handle terminal devices for example in /dev/pty/.
+ Patch from Debian.
+ * Make sure bootlogd findpty() returns an error value when it fails to
+ find a usable pty. Patch from Rob Leslie via Debian.
+ * Make sure bootlogd fflush() every line, even if asked not to flush
+ to disk using fdatasync(). Patch from Scott Gifford via Debian.
+ * Add compatibility code to handle old path "/etc/powerstatus" for a
+ while.
+ * Incude definition for MNT_DETACH which is missing in older GNU libc
+ headers.
+ * Do not strip binaries before installing them, to make it easier to
+ get binaries with debug information installed.
+ * Add the comment from Andrea Arcangeli about the correct
+ place of setting the default childhandler within spawn().
+ * Make sure that newline is printed out for last(1) even
+ if an utmp record entry is truncated.
+ * Check if utmp not only exists but also is writable and delay
+ writing out of the utmp runlevel record if utmp is not writable.
+ * Be able to find libcrypt also on 64 bit based architectures.
+ * Add option -w to the last command to display the full user and
+ domain names in the output. Patch from Petr Lautrbach.
+ * Add a manual page for utmpdump as this tool is sometimes
+ very useful even if not intended for normal use.
+ * Use paths.h macros for wall
+ * Change path "/etc/powerstatus" to "/var/run/powerstatus"
+ * Detected also removable block devices at halt/reboot to be able
+ to flush data and send them the ATA standby command. This should
+ avoid data loss on USB sticks and other removable block devices.
+ * Flush block devices on halt/reboot if not done by the kernel.
+ * Set SHELL to /bin/sh in the environmant of shutdown.
+ * Retry to write out shutdown messages if interrupted.
+ * pidof/killall5 - make omit pid list a dynamic one.
+ * pidof - provide '-n' to skip stat(2) syscall on network based FS.
+ * init - avoid compiler warnings
+ * init - initialize console by using the macros from ttydefaults.h
+ * init - add the possiblity to ignore further interrupts from keyboard
+ * init - add the possiblity to set sane terminal line settings
+ * sulogin - add the possibility to reset the terminal io
+ * Fix some minor problems
+ * init - enable is_selinux_enabled() to detect selinuxfs
+ * Add fix for Debian bug #536574 -- Can be enabled by -DACCTON_OFF
+ * Add helper program fstab-decode to make it easier to handle
+ /etc/mtab content. Patch by Miloslav Trmac and Fedora.
+ * Add fix for Debian bug #335023 - Make sure TERM is set on FreeBSD.
+ * Add fix for Debian bug #374038 - Make it clear that shutdown -c can
+ only cancel a waiting shutdown, not an active one.
+ * Add note to pidof manual page about the use of readlink(2). Patch by
+ Bill Nottingham and Fedora.
+ * Add PAM patch contrib/notify-pam-dead.patch based on Debian bug
+ #68621, which will add PAM support for programs spawned by init on
+ the console like sulogin. Based on patch by Topi Miettinen. This
+ patch is not applied by default yet while we review its
+ usefullness. It is only helpful for session handling, as sulogin
+ do not use and will not use a PAM conv() function. The current
+ sulogin is able to handle DES as well as MD5, SHA, and Blowfish
+ encrypted passwords due using getpwnam(3).
+ * Move utmp/wtmp before the execvp() in spawn() to be sure to
+ use the correct pid even on a controlling tty
+ * Remaining problem is that the pid of the second fork() for
+ getting a controlling tty isn't that reported by spawn()
+ * Re-enable writting utmp/wtmp for boot scripts
+ * Extend sulogin to support additional encryption algorithms
+ * Re-enable maintenance message of sulogin
+ * Enable the sulogin fallback password check to handle MD5, SHA, and
+ Blowfish encrypted passwords in case of getpwnam(3) fails.
+ * sulogin picking the SELinux context was broken. Patch by Daniel Walsh
@@ -14,0 +108,67 @@
+
+-------------------------------------------------------------------
+Tue Mar 23 17:21:06 CET 2010 - werner@suse.de
+
+- Test out sysvinit (2.88dsf) UNRELEASED; urgency=low
+- Update to sysvinit (2.87dsf) world; urgency=low
+
+ * Document -e and -t options for telinit in init(8).
+ * Document in halt(8) that -n might not disable all syncing.
+ Patch by Bill Nottingham and Fedora
+ * Adjust output from "last -x". In reboot lines, print endpoint
+ of uptime too. In shutdown lines print downtimes rather than
+ the time between downs. Fix typo in string compare in last.c.
+ Patch by Thomas Hood.
+ * Improve handling of IPv6 addresses in last. Patch from Fedora.
+ * Add new option -F to last, to output full date string instead
+ of the short form provided by default. Patch from Olaf Dabrunz
+ and SuSe.
+ * Fix utmp/wtmp updating on 64-bit platforms. Patch by Bill
+ Nottingham and Fedora.
+ * Avoid unchecked return value from malloc() in utmpdump.
+ Patch from Christian 'Dr. Disk' Hechelmann and Fedora.
+ * Make sure to use execle and no execl when passing environment to
+ the new process. Patch from RedHat.
+ * Correct init to make sure the waiting status is preserved across
+ re-exec. Patch from RedHat.
+ * Correct init to avoid race condition when starting programs during
+ boot. Patch from SuSe.
+ * Allow 'telinit u' in runlevels 0 and 6. Patch from Thomas Hood.
+ * Improve error message from init if fork() fail. Patch found in Suse.
+ * Add support for SE Linux capability handling. Patch from Manoj
+ Srivastava, adjusted to avoid aborting if SE policy was loaded in
+ the initrd with patch from Bill Nottingham and Fedora.
+ * Add -c option to pidof for only matching processes with the same
+ process root. Ignore -c when not running as root. Patch from
+ Thomas Woerner and Fedora.
+ * Add usleep in killall5 after killing processes, to force the kernel
+ to reschedule. Patch from SuSe.
+ * Modify pidof to not print empty line if no pid was found.
+ * Modify init and sulogin to fix emergency mode's tty, making sure ^C
+ and ^Z work when booting with 'emergency' kernel option. Patch from
+ Samuel Thibault.
+ * Modify init to allow some time for failed opens to resolve themselves.
+ Patch from Bill Nottingham and Fedora.
+ * Modify init to shut down IDE, SCSI and SATA disks properly. Patches
+ from Sebastian Reichelt, Werner Fink and SuSe.
+ * Modify wall to use UT_LINESIZE from instead of hardcoded
+ string lengths. Patch from SuSe.
+ * Change wall to make halt include hostname in output.
+ * Change killall to avoid killing init by mistake. Patch from SuSe.
+ * Change killall5 to use the exit value to report if it found any
+ processes to kill. Patch from Debian.
+ * Add option -o opmitpid to killall5, to make it possible to skip
+ some pids during shutdown. Based on patch from Colin Watson and
+ Ubuntu.
+ * Modify killall to work better with user space file system, by
+ changing cwd to /proc when stopping and killing processes, and
+ avoiding stat() when the value isn't used. Also, lock process
+ pages in memory to avoid paging when user processes are stopped.
+ Patch from Debian and Goswin von Brederlow with changes by Kel
+ Modderman.
+ * Change shutdown to only accept flags -H and -P with the -h flag,
+ and document this requirement in the manual page.
+ * Change reboot/halt to work properly when used as a login shell.
+ Patch by Dale R. Worley and Fedora.
+ * Let sulogin fall back to the staticly linked /bin/sash if both roots
+ shell and /bin/sh fail to execute.
calling whatdependson for head-i586
Old:
----
sysvinit-2.82-multiline.patch
sysvinit-2.85-paths.patch
sysvinit-2.85-suse.patch
sysvinit-2.86-full-time.patch
sysvinit-2.86-fuse-no-kill.patch
sysvinit-2.86-hddown.patch
sysvinit-2.86-lib64.patch
sysvinit-2.86-mdmon-no-kill.patch
sysvinit-2.86-nfs4pidof.patch
sysvinit-2.86-race.patch
sysvinit-2.86-selinux.patch
sysvinit-2.86-sulogin.patch
sysvinit-2.86-usage-message.patch
sysvinit-2.86-utmp.patch
sysvinit-2.86.dif
sysvinit-2.86.tar.bz2
New:
----
notify-pam-dead.patch
sysvinit-2.88dsf-no-kill.patch
sysvinit-2.88dsf-suse.patch
sysvinit-2.88dsf.dif
sysvinit-2.88dsf.tar.bz2
sysvinit-last-ipv6-heuristic.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ sysvinit.spec ++++++
--- /var/tmp/diff_new_pack.ohPIpK/_old 2010-04-25 18:42:06.000000000 +0200
+++ /var/tmp/diff_new_pack.ohPIpK/_new 2010-04-25 18:42:06.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package sysvinit (Version 2.86)
+# spec file for package sysvinit (Version 2.88)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -23,17 +23,17 @@
%define PDVER 2.0.2
%define KPVER 2.16
%define SCVER 1.10
-%define SIVER 2.86
+%define SIVER 2.88
%define START 0.54
License: GPLv2+
Group: System/Base
AutoReqProv: on
-Version: 2.86
-Release: 223
+Version: 2.88
+Release: 1
Summary: SysV-Style init
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: libselinux-devel libsepol-devel
-Source: sysvinit-2.86.tar.bz2
+BuildRequires: audit-devel libselinux-devel libsepol-devel pam-devel
+Source: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-2.88dsf.tar.bz2
Source2: killproc-2.16.tar.bz2
Source3: powerd-2.0.2.tar.bz2
Source4: showconsole-1.10.tar.bz2
@@ -43,26 +43,16 @@
Source8: mkinitrd-boot.sh
Source9: mkinitrd-kill1.sh
Source10: mkinitrd-kill2.sh
-Patch: sysvinit-2.86.dif
-Patch1: sysvinit-2.86-nfs4pidof.patch
-Patch2: powerd-2.0.2.dif
-Patch3: killproc-2.16.dif
-Patch5: sysvinit-2.86-sulogin.patch
-Patch6: sysvinit-2.82-startstop.patch
-Patch7: sysvinit-2.85-suse.patch
-Patch8: sysvinit-2.85-paths.patch
-Patch9: sysvinit-2.86-utmp.patch
-Patch10: showconsole-1.10.dif
-Patch11: sysvinit-2.86-race.patch
-Patch12: sysvinit-2.86-lib64.patch
-Patch13: sysvinit-2.82-multiline.patch
-Patch14: startpar-0.54.dif
-Patch15: sysvinit-2.86-usage-message.patch
-Patch16: sysvinit-2.86-full-time.patch
-Patch17: sysvinit-2.86-hddown.patch
-Patch18: sysvinit-2.86-selinux.patch
-Patch19: sysvinit-2.86-fuse-no-kill.patch
-Patch20: sysvinit-2.86-mdmon-no-kill.patch
+Patch: sysvinit-2.88dsf.dif
+Patch1: sysvinit-2.82-startstop.patch
+Patch2: sysvinit-2.88dsf-suse.patch
+Patch3: sysvinit-2.88dsf-no-kill.patch
+Patch4: notify-pam-dead.patch
+Patch5: sysvinit-last-ipv6-heuristic.patch
+Patch20: powerd-2.0.2.dif
+Patch30: killproc-2.16.dif
+Patch40: showconsole-1.10.dif
+Patch50: startpar-0.54.dif
Requires: sysvinit-tools
Provides: sbin_init
@@ -93,45 +83,34 @@
sysvinit package.
%prep
-%setup -q -b 2 -b 3 -b 4 -b 5
-%patch -P 1 -b .nfs4pidof
-%patch -P 5 -b .sulogin
-%patch -P 6 -b .ststdmn
-%patch -P 7 -b .suse
-%patch -P 8 -b .paths
-%patch -P 9 -b .utmp
-%patch -P 11 -b .race
-%patch -P 12 -b .lib64
-%patch -P 13 -b .multiline
-%patch -P 15 -b .usage
-%patch -P 16 -b .fulltime
-%patch -P 17 -b .hddown
-%patch -P 18 -b .selinux
-%patch -P 19 -b .fuse
-%patch -P 20 -b .mdmon
+%setup -n sysvinit-%{SIVER}dsf -q -b 2 -b 3 -b 4 -b 5
+%patch1 -p0 -b .startstop
+%patch2 -p0 -b .suse
+%patch3 -p0 -b .no-kill
+%patch4 -p0 -b .pam
+%patch5 -p2 -b .ipv6
%patch
pushd ../powerd-%{PDVER}
-%patch -P 2
+%patch20
popd
pushd ../killproc-%{KPVER}
-%patch -P 3
+%patch30
popd
pushd ../showconsole-%{SCVER}
-%patch -P 10
+%patch40
popd
pushd ../startpar-%{START}
-%patch -P 14
+%patch50
popd
%_fixowner .
%_fixgroup .
/bin/chmod -Rf a+rX,g-w,o-w .
%build
- RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -D_FILE_OFFSET_BITS=64"
- export RPM_OPT_FLAGS
- CFLAGS="-Wall ${RPM_OPT_FLAGS} -D_GNU_SOURCE -D__NO_STRING_INLINES -pipe"
+ RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -D_FILE_OFFSET_BITS=64 -pipe"
CC=gcc
- make %{?jobs:-j%jobs} -C src CFLAGS="$CFLAGS" CC="$CC"
+ export RPM_OPT_FLAGS CC
+ make %{?_smp_mflags} WITH_SELINUX=yes DISTRO=SuSE
pushd ../showconsole-%{SCVER}
make %{?_smp_mflags}
popd
@@ -143,7 +122,7 @@
./configure --prefix= --bindir='$(DESTDIR)/sbin' \
--mandir='$(DESTDIR)%{_mandir}' \
--sbindir='$(DESTDIR)/sbin'
- make %{?_smp_mflags} CFLAGS="-I../sysvinit-%{version}/src $CFLAGS"
+ make %{?_smp_mflags} CFLAGS="-I../sysvinit-%{SIVER}dsf/src $RPM_OPT_FLAGS "
%endif
popd
pushd ../startpar-%{START}
@@ -162,7 +141,7 @@
mkdir -m 755 -p ${RPM_BUILD_ROOT}%{_mandir}/man1
mkdir -m 755 -p ${RPM_BUILD_ROOT}%{_mandir}/man5
mkdir -m 755 -p ${RPM_BUILD_ROOT}%{_mandir}/man8
- make install -C src MANPATH=%{_mandir} ROOT=${RPM_BUILD_ROOT}
+ make install -C src MANPATH=%{_mandir} ROOT=${RPM_BUILD_ROOT} WITH_SELINUX=yes DISTRO=SuSE
test -p ${RPM_BUILD_ROOT}/dev/initctl || {
rm -f ${RPM_BUILD_ROOT}/dev/initctl
mknod ${RPM_BUILD_ROOT}/dev/initctl p
@@ -237,6 +216,7 @@
%files
%defattr (-,root,root,755)
+%config /etc/pam.d/init
/sbin/halt
/sbin/init
/sbin/poweroff
@@ -282,6 +262,7 @@
# /sbin/intr
/sbin/blogger
/sbin/blogd
+/sbin/fstab-decode
/sbin/showconsole
/sbin/setconsole
/sbin/isserial
@@ -304,16 +285,14 @@
%doc %{_mandir}/man1/lastb.1.gz
%doc %{_mandir}/man1/usleep.1.gz
%doc %{_mandir}/man1/fsync.1.gz
-%ifnarch s390 s390x
-%doc %{_mandir}/man8/powerd.8.gz
-%doc %{_mandir}/man8/detectups.8.gz
-%endif
# /usr/include/libblogger.h
# /usr/lib/libblogger.a
%doc %{_mandir}/man1/mountpoint.1.gz
+%doc %{_mandir}/man1/utmpdump.1.gz
# %doc %{_mandir}/man8/bootlogd.8.gz
%doc %{_mandir}/man8/blogger.8.gz
%doc %{_mandir}/man8/blogd.8.gz
+%doc %{_mandir}/man8/fstab-decode.8.gz
%doc %{_mandir}/man8/showconsole.8.gz
%doc %{_mandir}/man8/setconsole.8.gz
%doc %{_mandir}/man8/isserial.8.gz
@@ -323,6 +302,10 @@
%doc %{_mandir}/man8/killall5.8.gz
%doc %{_mandir}/man8/killproc.8.gz
%doc %{_mandir}/man8/pidof.8.gz
+%ifnarch s390 s390x
+%doc %{_mandir}/man8/powerd.8.gz
+%doc %{_mandir}/man8/detectups.8.gz
+%endif
%doc %{_mandir}/man8/startproc.8.gz
%doc %{_mandir}/man8/start_daemon.8.gz
%doc %{_mandir}/man8/startpar.8.gz
++++++ notify-pam-dead.patch ++++++
--- src/Makefile
+++ src/Makefile 2010-04-13 00:00:00.000000000 +0000
@@ -8,7 +8,7 @@
# Version: @(#)Makefile 2.85-13 23-Mar-2004 miquels@cistron.nl
#
-CPPFLAGS =
+CPPFLAGS = -DUSE_PAM
CFLAGS ?= -ansi -O2 -fomit-frame-pointer
override CFLAGS += -W -Wall -D_GNU_SOURCE
STATIC =
@@ -78,6 +78,13 @@ else
endif
# Additional libs for GNU libc.
+ifneq ($(findstring -DUSE_PAM,$(CPPFLAGS)),)
+ INITLIBS += -lpam
+ PAMDOTD = /etc/pam.d
+ PAMINIT = $(PAMDOTD)/init
+endif
+
+# Additional libs for GNU libc.
ifneq ($(wildcard /usr/lib*/libcrypt.a),)
SULOGINLIBS += -lcrypt
endif
@@ -149,6 +156,11 @@ install:
for i in $(USRBIN); do \
$(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
done
+ifneq ($(findstring -DUSE_PAM,$(CPPFLAGS)),)
+ $(INSTALL_DIR) $(ROOT)$(PAMDOTD)
+ test -s $(ROOT)$(PAMINIT) || \
+ $(INSTALL_DATA) init.sample $(ROOT)$(PAMINIT)
+endif
# $(INSTALL_DIR) $(ROOT)/etc/
# $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
ln -sf halt $(ROOT)/sbin/reboot
--- src/init.c
+++ src/init.c 2010-04-13 00:00:00.000000000 +0000
@@ -79,6 +79,10 @@
#include "reboot.h"
#include "set.h"
+#ifdef USE_PAM
+extern void notify_pam_dead_session(const char *id);
+#endif
+
#ifndef SIGPWR
# define SIGPWR SIGUSR2
#endif
@@ -1132,6 +1136,9 @@ pid_t spawn(CHILD *ch, int *res)
}
dup(f);
dup(f);
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
}
/*
@@ -1551,6 +1558,9 @@ void read_inittab(void)
INITDBG(L_VB, "Updating utmp for pid %d [id %s]",
ch->pid, ch->id);
ch->flags &= ~RUNNING;
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
if (ch->process[0] != '+')
write_utmp_wtmp("", ch->id, ch->pid, DEAD_PROCESS, NULL);
}
@@ -2012,6 +2022,9 @@ void re_exec(void)
if (ch->flags & ZOMBIE) {
INITDBG(L_VB, "Child died, PID= %d", ch->pid);
ch->flags &= ~(RUNNING|ZOMBIE|WAITING);
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
if (ch->process[0] != '+')
write_utmp_wtmp("", ch->id, ch->pid, DEAD_PROCESS, NULL);
}
@@ -2465,6 +2478,9 @@ void process_signals()
if (ch->flags & ZOMBIE) {
INITDBG(L_VB, "Child died, PID= %d", ch->pid);
ch->flags &= ~(RUNNING|ZOMBIE|WAITING);
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
if (ch->process[0] != '+')
write_utmp_wtmp("", ch->id, ch->pid, DEAD_PROCESS, NULL);
}
--- src/init.sample
+++ src/init.sample 2010-04-13 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+#%PAM-1.0
+#
+# The PAM configuration file for /sbin/init
+# Used for updating the lastlog logging file
+#
+auth sufficient pam_rootok.so
+account include common-account
+session include common-session
+session requisite pam_lastlog.so silent
--- src/utmp.c
+++ src/utmp.c 2010-04-13 00:00:00.000000000 +0000
@@ -34,10 +34,18 @@
#include
#include
+#if defined(USE_PAM) && defined(INIT_MAIN)
+# include
+# include
+#endif
+
#include "init.h"
#include "initreq.h"
#include "paths.h"
+#ifndef _PATH_DEV
+# define _PATH_DEV "/dev/"
+#endif
#if defined(__GLIBC__)
# if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) && defined(__powerpc__)
@@ -127,9 +135,9 @@ char *line) /* Which line is this */
strncpy(utmp.ut_name, user, sizeof(utmp.ut_name));
strncpy(utmp.ut_id , id , sizeof(utmp.ut_id ));
strncpy(utmp.ut_line, line, sizeof(utmp.ut_line));
-
- /* Put the OS version in place of the hostname */
- if (uname(&uname_buf) == 0)
+
+ /* Put the OS version in place of the hostname */
+ if (uname(&uname_buf) == 0)
strncpy(utmp.ut_host, uname_buf.release, sizeof(utmp.ut_host));
#if HAVE_UPDWTMP
@@ -262,3 +270,75 @@ char *line) /* LINE if used. */
write_wtmp(user, id, pid, type, line && line[0] ? line : oldline);
}
+#if defined(USE_PAM) && defined(INIT_MAIN)
+static pam_handle_t *pamh = NULL;
+# ifdef __GNUC__
+static int
+null_conv(int num_msg, const struct pam_message **msgm,
+ struct pam_response **response __attribute__((unused)),
+ void *appdata_ptr __attribute__((unused)))
+# else
+static int
+null_conv(int num_msg, const struct pam_message **msgm,
+ struct pam_response **response, void *appdata_ptr)
+# endif
+{
+ int i;
+ for (i = 0; i < num_msg; i++) {
+ const struct pam_message *msg = msgm[i];
+ if (msg == (const struct pam_message*)0)
+ continue;
+ if (msg->msg == (char*)0)
+ continue;
+ switch (msg->msg_style) {
+ case PAM_ERROR_MSG:
+ case PAM_TEXT_INFO:
+ initlog(L_VB, "pam_message %s", msg->msg);
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+static const struct pam_conv conv = { null_conv, NULL };
+# define PAM_FAIL_CHECK(func, args...) \
+ { \
+ if ((pam_ret = (func)(args)) != PAM_SUCCESS) { \
+ initlog(L_VB, "%s", pam_strerror(pamh, pam_ret)); \
+ goto pam_error; \
+ } \
+ }
+
+void notify_pam_dead_session(const char *id)
+{
+ struct utmp *oldut, ut;
+
+ setutent();
+
+ memset(&ut, 0, sizeof(ut));
+ ut.ut_type = DEAD_PROCESS;
+ strncpy(ut.ut_id, id, sizeof(ut.ut_id));
+
+ if ((oldut = getutid(&ut)) && (oldut->ut_type == USER_PROCESS)) {
+ int pam_ret;
+ char tty[UT_LINESIZE+ strlen(_PATH_DEV) + 1];
+
+ if (strncmp(oldut->ut_line, _PATH_DEV, strlen(_PATH_DEV)))
+ snprintf(tty, sizeof(tty), _PATH_DEV "%.*s",
+ UT_LINESIZE, oldut->ut_line);
+ else
+ snprintf(tty, sizeof(tty), "%.*s",
+ UT_LINESIZE, oldut->ut_line);
+
+ PAM_FAIL_CHECK(pam_start, "init", oldut->ut_user, &conv, &pamh);
+ PAM_FAIL_CHECK(pam_set_item, pamh, PAM_TTY, tty);
+ PAM_FAIL_CHECK(pam_set_item, pamh, PAM_RHOST, oldut->ut_host);
+ PAM_FAIL_CHECK(pam_close_session, pamh, PAM_SILENT);
+ pam_error:
+ pam_end(pamh, pam_ret);
+ }
+
+ endutent();
+}
+#endif /* USE_PAM && INIT_MAIN */
+
++++++ sysvinit-2.88dsf-no-kill.patch ++++++
--- src/killall5.c
+++ src/killall5.c 2010-03-19 14:29:44.000000000 +0000
@@ -444,6 +444,38 @@ int readarg(FILE *fp, char *buf, int sz)
}
/*
+ * Scan the filedescriptors of pid for /dev/fuse
+ */
+int is_fuse(const char *pid) {
+ DIR *dir;
+ char path[256];
+ char buf[256];
+ struct dirent *d;
+ ssize_t len;
+
+ /* Open /proc/pid/fd/ */
+ snprintf(path, sizeof(path), "/proc/%s/fd", pid);
+ if ((dir = opendir(path)) != NULL) {
+ int dfd = dirfd(dir);
+ /* Walk through the directory. */
+ while ((d = readdir(dir)) != NULL) {
+ if (*d->d_name == '.')
+ continue;
+ /* check for /dev/fuse */
+ if ((len = readlinkat(dfd, d->d_name, buf, sizeof(buf))) > 0) {
+ buf[len] = '\0';
+ if (strcmp("/dev/fuse", buf) == 0)
+ return 1; /* Fuse filesystem */
+ }
+ }
+ closedir(dir);
+ }
+
+ /* Not a fuse filesystem */
+ return 0;
+}
+
+/*
* Read the proc filesystem.
* CWD must be /proc to avoid problems if / is affected by the killing (ie depend on fuse).
*/
@@ -458,6 +490,7 @@ int readproc(int do_stat)
char buf[PATH_MAX+1];
char *s, *q;
unsigned long startcode, endcode;
+ ssize_t len;
int pid, f;
/* Open the /proc directory. */
@@ -608,6 +641,26 @@ int readproc(int do_stat)
p->nfs = 0;
switch (do_stat) {
+ case NO_STAT:
+ if ((len = readlink(path, buf, PATH_MAX)) < 0)
+ break;
+ buf[len] = '\0';
+
+ /* Check for uevent handler, mdmon, and for providers
+ of FUSE filesystems */
+ if ((strncmp(buf, "/sbin/udevd", 11) == 0) ||
+ (strncmp(buf, "/sbin/mdmon", 11) == 0) ||
+ (is_fuse(d->d_name))) {
+ OMIT *restrict optr;
+
+ xmemalign((void*)&optr, sizeof(void*), alignof(OMIT));
+ optr->next = omit;
+ optr->prev = (OMIT*)0;
+ optr->pid = pid;
+ omit = optr;
+ }
+
+ break;
case DO_NETFS:
if ((p->nfs = check4nfs(path, buf)))
break;
++++++ sysvinit-2.88dsf-suse.patch ++++++
--- man/init.8
+++ man/init.8 2010-03-19 14:44:16.000000000 +0000
@@ -261,7 +261,7 @@ It activates the \fIkbrequest\fP action.
.SH CONFORMING TO
\fBInit\fP is compatible with the System V init. It works closely
together with the scripts in the directories
-\fI/etc/init.d\fP and \fI/etc/rc{runlevel}.d\fP.
+\fI/etc/init.d\fP and \fI/etc/init.d/rc{runlevel}.d\fP.
If your system uses this convention, there should be a \fIREADME\fP
file in the directory \fI/etc/init.d\fP explaining how these scripts work.
.\"}}}
@@ -301,6 +301,7 @@ page by Michael Haardt (u31b3hs@pool.inf
.\"}}}
.\"{{{ See also
.SH "SEE ALSO"
+.BR init.d (7),
.BR getty (1),
.BR login (1),
.BR sh (1),
--- man/inittab.5
+++ man/inittab.5 2004-03-12 12:33:05.000000000 +0000
@@ -197,7 +197,7 @@ rc::bootwait:/etc/rc
.fi
.sp
.RE
-This inittab file executes \fB/etc/rc\fP during boot and starts gettys
+This inittab file executes \fB/etc/rc\fP during boot and starts mingettys
on tty1\-tty4.
.PP
A more elaborate \fBinittab\fP with different runlevels (see the comments
@@ -205,23 +205,20 @@ inside):
.RS
.sp
.nf
-.ne 19
+.ne 41
# Level to run in
id:2:initdefault:
# Boot-time system configuration/initialization script.
-si::sysinit:/etc/init.d/rcS
+si:I:bootwait:/etc/init.d/boot
-# What to do in single-user mode.
-~:S:wait:/sbin/sulogin
-
-# /etc/init.d executes the S and K scripts upon change
-# of runlevel.
-#
-# Runlevel 0 is halt.
-# Runlevel 1 is single-user.
-# Runlevels 2-5 are multi-user.
-# Runlevel 6 is reboot.
+# Runlevel 0 is System halt (Never use this as initdefault!)
+# Runlevel 1 is Single user mode
+# Runlevel 2 is Local multiuser without remote network (e.g. NFS)
+# Runlevel 3 is Full multiuser with network
+# Runlevel 4 is Not used
+# Runlevel 5 is Full multiuser with network and xdm
+# Runlevel 6 is System reboot (Never use this as initdefault!)
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
@@ -231,17 +228,27 @@ l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
+# What to do in single-user mode
+ls:S:wait:/etc/init.d/rc S
+~~:S:respawn:/sbin/sulogin
+
# What to do at the "3 finger salute".
-ca::ctrlaltdel:/sbin/shutdown -t1 -h now
+ca::ctrlaltdel:/sbin/shutdown -t5 -h now
-# Runlevel 2,3: getty on virtual consoles
-# Runlevel 3: getty on terminal (ttyS0) and modem (ttyS1)
-1:23:respawn:/sbin/getty tty1 VC linux
-2:23:respawn:/sbin/getty tty2 VC linux
-3:23:respawn:/sbin/getty tty3 VC linux
-4:23:respawn:/sbin/getty tty4 VC linux
-S0:3:respawn:/sbin/getty -L 9600 ttyS0 vt320
-S1:3:respawn:/sbin/mgetty -x0 -D ttyS1
+# Runlevel 2 upto 5: mingetty on console.
+# level 2, 3, and 5 also getty on serial port S0.
+1:2345:respawn:/sbin/mingetty --noclear tty1
+2:2345:respawn:/sbin/mingetty tty2
+3:2345:respawn:/sbin/mingetty tty3
+4:2345:respawn:/sbin/mingetty tty4
+5:2345:respawn:/sbin/mingetty tty5
+6:2345:respawn:/sbin/mingetty tty6
+S0:235:respawn:/sbin/agetty -L 9600 ttyS0 vt102
+
+# modem getty(s),
+# /dev/modem is a link to the modem device.
+#mo:235:respawn:/usr/sbin/mgetty -s 38400 modem
+mo:235:respawn:/sbin/uugetty modem M19200
.fi
.sp
@@ -261,5 +268,8 @@ by Michael Haardt (u31b3hs@pool.informat
.\"{{{ See also
.SH "SEE ALSO"
.BR init (8),
-.BR telinit (8)
+.BR telinit (8),
+.BR init.d (7),
+.BR agetty (8),
+.BR mgetty (8)
.\"}}}
--- man/killall5.8
+++ man/killall5.8 2010-03-19 14:43:25.000000000 +0000
@@ -44,6 +44,7 @@ process were killed, and 1 if it was una
.SH SEE ALSO
.BR halt (8),
.BR reboot (8),
-.BR pidof (8)
+.BR pidof (8),
+.BR killproc (8)
.SH AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
--- man/pidof.8
+++ man/pidof.8 2004-03-12 12:26:35.000000000 +0000
@@ -83,6 +83,7 @@ that the executable name of running proc
so symbolic links to executables will also match.
.SH SEE ALSO
+.BR pidofproc (8),
.BR shutdown (8),
.BR init (8),
.BR halt (8),
--- man/sulogin.8
+++ man/sulogin.8 2004-03-12 12:26:35.000000000 +0000
@@ -35,7 +35,7 @@ passes it the \fB\-b\fP option.
.PP
The user is prompted
.IP "" .5i
-Give root password for system maintenance
+Give root password for system login
.br
(or type Control\-D for normal startup):
.PP
++++++ sysvinit-2.88dsf.dif ++++++
--- src/Makefile
+++ src/Makefile 2010-03-23 15:11:12.000000000 +0000
@@ -9,16 +9,16 @@
#
CPPFLAGS = -DUSE_PAM
-CFLAGS ?= -ansi -O2 -fomit-frame-pointer
+CFLAGS ?= $(RPM_OPT_FLAGS)
override CFLAGS += -W -Wall -D_GNU_SOURCE
STATIC =
# For some known distributions we do not build all programs, otherwise we do.
BIN =
SBIN = init halt shutdown runlevel killall5 fstab-decode
-USRBIN = last mesg
+USRBIN = last
-MAN1 = last.1 lastb.1 mesg.1
+MAN1 = last.1 lastb.1
MAN5 = initscript.5 inittab.5
MAN8 = halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8
MAN8 += shutdown.8 telinit.8 fstab-decode.8
@@ -170,7 +170,8 @@ endif
ln -sf halt $(ROOT)/sbin/reboot
ln -sf halt $(ROOT)/sbin/poweroff
ln -sf init $(ROOT)/sbin/telinit
- ln -sf /sbin/killall5 $(ROOT)/bin/pidof
+ ln -sf killall5 $(ROOT)/sbin/pidof
+ ln -sf ../sbin/killall5 $(ROOT)/bin/pidof
if [ ! -f $(ROOT)/usr/bin/lastb ]; then \
ln -sf last $(ROOT)/usr/bin/lastb; \
fi
--- src/bootlogd.c
+++ src/bootlogd.c 2006-08-18 12:45:28.000000000 +0000
@@ -241,7 +241,7 @@ int isconsole(char *s, char *res, int rl
int consolename(char *res, int rlen)
{
#ifdef TIOCGDEV
- unsigned int kdev;
+ kdev_t kdev;
#endif
struct stat st, st2;
char buf[256];
@@ -555,7 +555,7 @@ int main(int argc, char **argv)
}
(void)ioctl(0, TIOCCONS, NULL);
-#if 1
+#if 0
/* Work around bug in 2.1/2.2 kernels. Fixed in 2.2.13 and 2.3.18 */
if ((n = open("/dev/tty0", O_RDWR)) >= 0) {
(void)ioctl(n, TIOCCONS, NULL);
++++++ sysvinit-last-ipv6-heuristic.patch ++++++
diff --git a/trunk/src/last.c b/trunk/src/last.c
index 5003c7c..02103e0 100644
--- a/trunk/src/last.c
+++ b/trunk/src/last.c
@@ -318,30 +318,22 @@ int dns_lookup(char *result, int size, int useip, int32_t *a)
struct sockaddr_in6 sin6;
struct sockaddr *sa;
int salen, flags;
- unsigned int topnibble;
- unsigned int azero = 0, sitelocal = 0;
int mapped = 0;
flags = useip ? NI_NUMERICHOST : 0;
/*
- * IPv4 or IPv6 ? We use 2 heuristics:
- * 1. Current IPv6 range uses 2000-3fff or fec0-feff.
- * Outside of that is illegal and must be IPv4.
- * 2. If last 3 bytes are 0, must be IPv4
- * 3. If IPv6 in IPv4, handle as IPv4
+ * IPv4 or IPv6 ?
+ * 1. If last 3 4bytes are 0, must be IPv4
+ * 2. If IPv6 in IPv4, handle as IPv4
+ * 3. Anything else is IPv6
*
* Ugly.
*/
if (a[0] == 0 && a[1] == 0 && a[2] == (int32_t)htonl (0xffff))
mapped = 1;
- topnibble = ntohl((unsigned int)a[0]) >> 28;
- azero = ntohl((unsigned int)a[0]) >> 16;
- sitelocal = (azero >= 0xfec0 && azero <= 0xfeff) ? 1 : 0;
-
- if (((topnibble < 2 || topnibble > 3) && (!sitelocal)) || mapped ||
- (a[1] == 0 && a[2] == 0 && a[3] == 0)) {
+ if (mapped || (a[1] == 0 && a[2] == 0 && a[3] == 0)) {
/* IPv4 */
sin.sin_family = AF_INET;
sin.sin_port = 0;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org