sysvinit/sysvinit-last-ipv6-heuristic.patch

41 lines
1.3 KiB
Diff
Raw Normal View History

- Add patch to make last(1) knowing latest IPv6 specs - 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 - 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 <utmp.h> 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. OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=40
2010-04-15 12:39:52 +02:00
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;