SOURCES: util-linux-audit-hwclock.patch (NEW), util-linux-audit-lo...

baggins baggins at pld-linux.org
Sat Mar 24 22:20:43 CET 2007


Author: baggins                      Date: Sat Mar 24 21:20:43 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- patches from fedora (details in patches if not obvious)

---- Files affected:
SOURCES:
   util-linux-audit-hwclock.patch (NONE -> 1.1)  (NEW), util-linux-audit-login.patch (NONE -> 1.1)  (NEW), util-linux-chsh.patch (NONE -> 1.1)  (NEW), util-linux-col-EILSEQ.patch (NONE -> 1.1)  (NEW), util-linux-cramfs-maxentries.patch (NONE -> 1.1)  (NEW), util-linux-cramfs-zerofiles.patch (NONE -> 1.1)  (NEW), util-linux-ctrlaltdel-man.patch (NONE -> 1.1)  (NEW), util-linux-ctty3.patch (NONE -> 1.1)  (NEW), util-linux-execl.patch (NONE -> 1.1)  (NEW), util-linux-fdformat-ide.patch (NONE -> 1.1)  (NEW), util-linux-fdisk-b-4096.patch (NONE -> 1.1)  (NEW), util-linux-fdisk-gpt.patch (NONE -> 1.1)  (NEW), util-linux-fdisk-isfull.patch (NONE -> 1.1)  (NEW), util-linux-fdisk-sectors.patch (NONE -> 1.1)  (NEW), util-linux-fdisksegv.patch (NONE -> 1.1)  (NEW), util-linux-hexdump-gcc.patch (NONE -> 1.1)  (NEW), util-linux-hotkeys.patch (NONE -> 1.1)  (NEW), util-linux-ipcs-shmax.patch (NONE -> 1.1)  (NEW), util-linux-ipcs-typo.patch (NONE -> 1.1)  (NEW), util-linux-login-hang.patch 
 (NONE -> 1.1)  (NEW), util-linux-login-ipv6.patch (NONE -> 1.1)  (NEW), util-linux-login-lastlog.patch (NONE -> 1.1)  (NEW), util-linux-login-pam-acct.patch (NONE -> 1.1)  (NEW), util-linux-login-timeval.patch (NONE -> 1.1)  (NEW), util-linux-look-separator.patch (NONE -> 1.1)  (NEW), util-linux-losetup-all.patch (NONE -> 1.1)  (NEW), util-linux-losetup-deprecated.patch (NONE -> 1.1)  (NEW), util-linux-losetup-rdonly.patch (NONE -> 1.1)  (NEW), util-linux-lvm2dupes.patch (NONE -> 1.1)  (NEW), util-linux-mkswap-mounted.patch (NONE -> 1.1)  (NEW), util-linux-mkswap-selinux.patch (NONE -> 1.1)  (NEW), util-linux-more-CLOEXEC.patch (NONE -> 1.1)  (NEW), util-linux-mount-context.patch (NONE -> 1.1)  (NEW), util-linux-mount-man-bugs.patch (NONE -> 1.1)  (NEW), util-linux-mount-man-cifs.patch (NONE -> 1.1)  (NEW), util-linux-mount-man-nfs.patch (NONE -> 1.1)  (NEW), util-linux-mount-man-nfs4.patch (NONE -> 1.1)  (NEW), util-linux-mount-nonfs.patch (NONE -> 1.1)  (NEW), util-linux-m
 ount-sloppy.patch (NONE -> 1.1)  (NEW), util-linux-mount-subtree.patch (NONE -> 1.1)  (NEW), util-linux-mount-twiceloop.patch (NONE -> 1.1)  (NEW), util-linux-mount-uhelper.patch (NONE -> 1.1)  (NEW), util-linux-mount-uuid.patch (NONE -> 1.1)  (NEW), util-linux-mountbylabel-dm.patch (NONE -> 1.1)  (NEW), util-linux-mtab-lock.patch (NONE -> 1.1)  (NEW), util-linux-multibyte.patch (NONE -> 1.1)  (NEW), util-linux-namei-logic.patch (NONE -> 1.1)  (NEW), util-linux-pamsession.patch (NONE -> 1.1)  (NEW), util-linux-partx-man.patch (NONE -> 1.1)  (NEW), util-linux-procpartitions.patch (NONE -> 1.1)  (NEW), util-linux-raw-handle-nonpresent-devs.patch (NONE -> 1.1)  (NEW), util-linux-raw-man.patch (NONE -> 1.1)  (NEW), util-linux-raw-raw0.patch (NONE -> 1.1)  (NEW), util-linux-rdev-man.patch (NONE -> 1.1)  (NEW), util-linux-rmparts.patch (NONE -> 1.1)  (NEW), util-linux-schedutils-SCHED_BATCH.patch (NONE -> 1.1)  (NEW), util-linux-schedutils-man.patch (NONE -> 1.1)  (NEW), util-linu
 x-skipraid2.patch (NONE -> 1.1)  (NEW), util-linux-swap-page.patch (NONE -> 1.1)  (NEW), util-linux-swapon-suspend.patch (NONE -> 1.1)  (NEW), util-linux-swaponsymlink.patch (NONE -> 1.1)  (NEW), util-linux-umount-sysfs.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/util-linux-audit-hwclock.patch
diff -u /dev/null SOURCES/util-linux-audit-hwclock.patch:1.1
--- /dev/null	Sat Mar 24 22:20:43 2007
+++ SOURCES/util-linux-audit-hwclock.patch	Sat Mar 24 22:20:37 2007
@@ -0,0 +1,316 @@
+- util-linux updates for new audit system
+
+diff -urN util-linux-2.13-pre5.orig/hwclock/audit.c util-linux-2.13-pre5/hwclock/audit.c
+--- util-linux-2.13-pre5.orig/hwclock/audit.c	1969-12-31 19:00:00.000000000 -0500
++++ util-linux-2.13-pre5/hwclock/audit.c	2005-10-25 17:14:46.000000000 -0400
+@@ -0,0 +1,50 @@
++/* audit.c -- This file contains the audit system extensions
++ *
++ * Copyright 2005 Red Hat Inc., Durham, North Carolina.
++ * All Rights Reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ *
++ * Authors:
++ *     Steve Grubb <sgrubb at redhat.com>
++ */
++
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <libaudit.h>
++#include "audit.h"
++
++int audit_fd = -1;
++static int audit_this = 0;
++
++
++void auditable_event(int i)
++{
++	audit_this = i;
++}
++
++
++void audit_exit(int status)
++{
++	if (audit_this) {
++		audit_log_user_message(audit_fd, AUDIT_USYS_CONFIG, 
++			"changing system time", NULL, NULL, NULL, status ? 0 : 1);
++		close(audit_fd);
++	}
++	exit(status);
++}
++
+diff -urN util-linux-2.13-pre5.orig/hwclock/audit.h util-linux-2.13-pre5/hwclock/audit.h
+--- util-linux-2.13-pre5.orig/hwclock/audit.h	1969-12-31 19:00:00.000000000 -0500
++++ util-linux-2.13-pre5/hwclock/audit.h	2005-10-25 17:09:40.000000000 -0400
+@@ -0,0 +1,34 @@
++/* audit.h -- This file contains the function prototypes for audit calls
++ * Copyright 2005 Red Hat Inc., Durham, North Carolina.
++ * All Rights Reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ *
++ * Author:
++ *   Steve Grubb <sgrubb at redhat.com>
++ *
++ */
++
++#ifndef HW_AUDIT_H
++#define HW_AUDIT_H
++
++/* This is the file descriptor used by the audit system */
++extern int audit_fd;
++
++/* This is the logging functions */
++void auditable_event(int i);
++void audit_exit(int status);
++
++#endif
+diff -urN util-linux-2.13-pre5.orig/hwclock/clock.h util-linux-2.13-pre5/hwclock/clock.h
+--- util-linux-2.13-pre5.orig/hwclock/clock.h	2005-10-25 17:08:26.000000000 -0400
++++ util-linux-2.13-pre5/hwclock/clock.h	2005-10-25 17:09:40.000000000 -0400
+@@ -24,7 +24,12 @@
+ extern char *progname;
+ extern int debug;
+ extern int epoch_option;
+-extern void outsyserr(char *msg, ...);
++extern void outsyserr(char *msg, ...)
++#ifdef __GNUC__
++        __attribute__ ((format (printf, 1, 2)));
++#else
++        ;
++#endif
+ 
+ /* cmos.c */
+ extern void set_cmos_epoch(int ARCconsole, int SRM);
+diff -urN util-linux-2.13-pre5.orig/hwclock/hwclock.c util-linux-2.13-pre5/hwclock/hwclock.c
+--- util-linux-2.13-pre5.orig/hwclock/hwclock.c	2005-10-25 17:08:26.000000000 -0400
++++ util-linux-2.13-pre5/hwclock/hwclock.c	2005-10-25 17:09:40.000000000 -0400
+@@ -81,9 +81,11 @@
+ #include <stdarg.h>
+ #include <getopt.h>
+ #include <sysexits.h>
++#include <libaudit.h>
+ 
+ #include "clock.h"
+ #include "nls.h"
++#include "audit.h"
+ 
+ #define MYNAME "hwclock"
+ 
+@@ -1234,7 +1236,7 @@
+     va_end(ap);
+   }
+  
+-  exit(fmt ? EX_USAGE : 0);
++  audit_exit(fmt ? EX_USAGE : 0);
+ }
+ 
+ static const struct option longopts[] = {
+@@ -1298,6 +1300,15 @@
+ 	/* Remember what time we were invoked */
+ 	gettimeofday(&startup_time, NULL);
+ 
++	audit_fd = audit_open();
++	if (audit_fd < 0 && !(errno == EINVAL || errno == EPROTONOSUPPORT ||
++				errno == EAFNOSUPPORT)) {
++		/* You get these error codes only when the kernel doesn't have
++	   	 * audit compiled in. */
++		fprintf(stderr, "Error - unable to connect to audit system\n");
++		return EX_NOPERM;
++	}
++
+ 	setlocale(LC_ALL, "");
+ #ifdef LC_NUMERIC
+ 	/* We need LC_CTYPE and LC_TIME and LC_MESSAGES, but must avoid
+@@ -1393,6 +1404,13 @@
+ 	argc -= optind;
+ 	argv += optind;
+ 
++	if (testing != TRUE) {
++		if (adjust == TRUE || hctosys == TRUE || systohc == TRUE ||
++			set == TRUE || setepoch == TRUE) {
++			auditable_event(1);
++		}
++	}
++
+ 	if (argc > 0) {
+ 		usage(_("%s takes no non-option arguments.  "
+ 			"You supplied %d.\n"),
+@@ -1403,27 +1421,27 @@
+ 		fprintf(stderr, _("You have specified multiple functions.\n"
+ 				  "You can only perform one function "
+ 				  "at a time.\n"));
+-		exit(EX_USAGE);
++		audit_exit(EX_USAGE);
+ 	}
+ 
+ 	if (utc && local_opt) {
+ 		fprintf(stderr, _("%s: The --utc and --localtime options "
+ 				  "are mutually exclusive.  You specified "
+ 				  "both.\n"), MYNAME);
+-		exit(EX_USAGE);
++		audit_exit(EX_USAGE);
+ 	}
+ 
+ 	if (adjust && noadjfile) {
+ 		fprintf(stderr, _("%s: The --adjust and --noadjfile options "
+ 				  "are mutually exclusive.  You specified "
+ 				  "both.\n"), MYNAME);
+-		exit(EX_USAGE);
++		audit_exit(EX_USAGE);
+ 	}
+ 
+ 	if (noadjfile && !(utc || local_opt)) {
+ 		fprintf(stderr, _("%s: With --noadjfile, you must specify "
+ 				  "either --utc or --localtime\n"), MYNAME);
+-		exit(EX_USAGE);
++		audit_exit(EX_USAGE);
+ 	}
+ 
+ #ifdef __alpha__
+@@ -1437,7 +1455,7 @@
+ 		if (rc != 0) {
+ 			fprintf(stderr, _("No usable set-to time.  "
+ 					  "Cannot set clock.\n"));
+-			exit(EX_USAGE);
++			audit_exit(EX_USAGE);
+ 		}
+ 	}
+ 
+@@ -1469,11 +1487,11 @@
+ 	}
+ 
+ 	if (!permitted)
+-		exit(EX_NOPERM);
++		audit_exit(EX_NOPERM);
+ 
+ 	if (getepoch || setepoch) {
+ 		manipulate_epoch(getepoch, setepoch, epoch_option, testing);
+-		return 0;
++		audit_exit(0);
+ 	}
+ 
+ 	if (debug)
+@@ -1487,12 +1505,14 @@
+ 			fprintf(stderr,
+ 				_("Use the --debug option to see the details "
+ 				  "of our search for an access method.\n"));
+-		exit(1);
++		audit_exit(1);
+ 	}
+ 
+-	return manipulate_clock(show, adjust, noadjfile, set, set_time,
++	rc = manipulate_clock(show, adjust, noadjfile, set, set_time,
+ 				hctosys, systohc, startup_time, utc,
+ 				local_opt, testing);
++	audit_exit(rc);
++	return rc;	/* Not reached */
+ }
+ 
+ /* A single routine for greater uniformity */
+diff -urN util-linux-2.13-pre5.orig/hwclock/kd.c util-linux-2.13-pre5/hwclock/kd.c
+--- util-linux-2.13-pre5.orig/hwclock/kd.c	2005-10-25 17:08:26.000000000 -0400
++++ util-linux-2.13-pre5/hwclock/kd.c	2005-10-25 17:09:40.000000000 -0400
+@@ -19,6 +19,7 @@
+ 
+ #include "clock.h"
+ #include "nls.h"
++#include "audit.h"
+ 
+ static int con_fd = -1;		/* opened by probe_for_kd_clock() */
+ 				/* never closed */
+@@ -103,7 +104,7 @@
+ 
+   if (ioctl(con_fd, KDGHWCLK, &t) == -1) {
+     outsyserr(_("ioctl() failed to read time from %s"), con_fd_filename);
+-    exit(EX_IOERR);
++    audit_exit(EX_IOERR);
+   }
+ 
+   tm->tm_sec  = t.sec;
+@@ -139,7 +140,7 @@
+ 
+   if (ioctl(con_fd, KDSHWCLK, &t ) == -1) {
+     outsyserr(_("ioctl KDSHWCLK failed"));
+-    exit(1);
++    audit_exit(1);
+   }
+   return 0;
+ }
+diff -urN util-linux-2.13-pre5.orig/hwclock/Makefile.am util-linux-2.13-pre5/hwclock/Makefile.am
+--- util-linux-2.13-pre5.orig/hwclock/Makefile.am	2005-10-25 17:08:26.000000000 -0400
++++ util-linux-2.13-pre5/hwclock/Makefile.am	2005-10-25 17:09:40.000000000 -0400
+@@ -4,4 +4,5 @@
+ 
+ sbin_PROGRAMS = hwclock
+ 
+-hwclock_SOURCES = hwclock.c cmos.c rtc.c kd.c
+\ No newline at end of file
++hwclock_SOURCES = hwclock.c cmos.c rtc.c kd.c audit.c
++hwclock_LDADD = -laudit
+\ No newline at end of file
+diff -urN util-linux-2.13-pre5.orig/hwclock/rtc.c util-linux-2.13-pre5/hwclock/rtc.c
+--- util-linux-2.13-pre5.orig/hwclock/rtc.c	2005-10-25 17:08:26.000000000 -0400
++++ util-linux-2.13-pre5/hwclock/rtc.c	2005-10-25 17:09:40.000000000 -0400
+@@ -8,6 +8,7 @@
+ 
+ #include "clock.h"
+ #include "nls.h"
++#include "audit.h"
+ 
+ /*
+  * Get defines for rtc stuff.
+@@ -114,7 +115,7 @@
+ 
+ 	if (rtc_fd < 0) {
+ 		outsyserr(_("open() of %s failed"), rtc_dev_name);
+-		exit(EX_OSFILE);
++		audit_exit(EX_OSFILE);
+ 	}
+ 	return rtc_fd;
+ }
+@@ -149,7 +150,7 @@
+ 		perror(ioctlname);
+ 		fprintf(stderr, _("ioctl() to %s to read the time failed.\n"),
+ 			rtc_dev_name);
+-		exit(EX_IOERR);
++		audit_exit(EX_IOERR);
+ 	}
+ 
+ 	tm->tm_isdst = -1;          /* don't know whether it's dst */
+@@ -329,7 +330,7 @@
+ 		perror(ioctlname);
+ 		fprintf(stderr, _("ioctl() to %s to set the time failed.\n"),
+ 			rtc_dev_name);
+-		exit(EX_IOERR);
++		audit_exit(EX_IOERR);
+ 	}
+ 
+ 	if (debug)

================================================================
Index: SOURCES/util-linux-audit-login.patch
diff -u /dev/null SOURCES/util-linux-audit-login.patch:1.1
--- /dev/null	Sat Mar 24 22:20:43 2007
+++ SOURCES/util-linux-audit-login.patch	Sat Mar 24 22:20:37 2007
@@ -0,0 +1,103 @@
+- add audit message to login
+
+diff -ur util-linux-2.13-pre4.orig/login-utils/login.c util-linux-2.13-pre4/login-utils/login.c
+--- util-linux-2.13-pre4.orig/login-utils/login.c	2005-10-14 13:59:08.000000000 -0400
++++ util-linux-2.13-pre4/login-utils/login.c	2005-10-14 15:43:54.000000000 -0400
+@@ -106,6 +106,7 @@
+ #include <sys/syslog.h>
+ #include <sys/sysmacros.h>
+ #include <netdb.h>
++#include <libaudit.h>
+ #include "pathnames.h"
+ #include "my_crypt.h"
+ #include "login.h"
+@@ -329,6 +330,7 @@
+ #ifdef LOGIN_CHOWN_VCS
+     char vcsn[20], vcsan[20];
+ #endif
++    int audit_fd;
+ 
+     pid = getpid();
+ 
+@@ -545,11 +547,25 @@
+ 	       (retcode == PAM_USER_UNKNOWN) ||
+ 	       (retcode == PAM_CRED_INSUFFICIENT) ||
+ 	       (retcode == PAM_AUTHINFO_UNAVAIL))) {
++	    struct passwd *pw;
++	    char buf[64];
+ 	    pam_get_item(pamh, PAM_USER, (const void **) &username);
+ 
+ 	    syslog(LOG_NOTICE,_("FAILED LOGIN %d FROM %s FOR %s, %s"),
+ 		   failcount, hostname, username, pam_strerror(pamh, retcode));
+ 	    logbtmp(tty_name, username, hostname);
++	    audit_fd = audit_open();
++	    pw = getpwnam(username);
++	    if (pw) {
++		snprintf(buf, sizeof(buf), "uid=%d", pw->pw_uid);
++		audit_log_user_message(audit_fd, AUDIT_USER_LOGIN, 
++			buf, hostname, NULL, tty_name, 0);
++	    } else {
++		snprintf(buf, sizeof(buf), "acct=%s", username);
++		audit_log_user_message(audit_fd, AUDIT_USER_LOGIN, 
++			buf, hostname, NULL, tty_name, 0);
++	    }
++	    close(audit_fd);
+ 
+ 	    fprintf(stderr,_("Login incorrect\n\n"));
+ 	    pam_set_item(pamh,PAM_USER,NULL);
+@@ -557,6 +573,8 @@
+ 	}
+ 
+ 	if (retcode != PAM_SUCCESS) {
++	    struct passwd *pw;
++	    char buf[64];
+ 	    pam_get_item(pamh, PAM_USER, (const void **) &username);
+ 
+ 	    if (retcode == PAM_MAXTRIES)
+@@ -567,6 +585,18 @@
+ 		syslog(LOG_NOTICE,_("FAILED LOGIN SESSION FROM %s FOR %s, %s"),
+ 			hostname, username, pam_strerror(pamh, retcode));
+ 	    logbtmp(tty_name, username, hostname);
++	    audit_fd = audit_open();
++	    pw = getpwnam(username);
++	    if (pw) {
++		snprintf(buf, sizeof(buf), "uid=%d", pw->pw_uid);
++		audit_log_user_message(audit_fd, AUDIT_USER_LOGIN, 
++			buf, hostname, NULL, tty_name, 0);
++	    } else {
++		snprintf(buf, sizeof(buf), "acct=%s", username);
++		audit_log_user_message(audit_fd, AUDIT_USER_LOGIN, 
++			buf, hostname, NULL, tty_name, 0);
++	    }
++	    close(audit_fd);
+ 
+ 	    fprintf(stderr,_("\nLogin incorrect\n"));
+ 	    pam_end(pamh, retcode);
+@@ -908,6 +938,15 @@
+ #endif
+ #endif
+     }
++
++    {
++	char buf[32];
++	audit_fd = audit_open();
++	snprintf(buf, sizeof(buf), "uid=%d", pwd->pw_uid);
++	audit_log_user_message(audit_fd, AUDIT_USER_LOGIN, 
++		buf, hostname, NULL, tty_name, 1);
++	close(audit_fd);
++    }
+     
+     dolastlog(quietlog);
+     
+diff -ur util-linux-2.13-pre4.orig/login-utils/Makefile.am util-linux-2.13-pre4/login-utils/Makefile.am
+--- util-linux-2.13-pre4.orig/login-utils/Makefile.am	2005-10-14 13:59:08.000000000 -0400
++++ util-linux-2.13-pre4/login-utils/Makefile.am	2005-10-14 15:45:22.000000000 -0400
+@@ -55,7 +55,7 @@
+ if HAVE_PAM
+ chfn_LDADD += -lpam -lpam_misc
+ chsh_LDADD += -lpam -lpam_misc
+-login_LDADD += -lpam -lpam_misc
++login_LDADD += -lpam -lpam_misc -laudit
+ login_SOURCES = login.c
+ else
+ login_SOURCES = login.c checktty.c

================================================================
Index: SOURCES/util-linux-chsh.patch
diff -u /dev/null SOURCES/util-linux-chsh.patch:1.1
--- /dev/null	Sat Mar 24 22:20:43 2007
+++ SOURCES/util-linux-chsh.patch	Sat Mar 24 22:20:37 2007
@@ -0,0 +1,21 @@
+- chsh to /bin/sh leaves shell field of /etc/passwd blank
+
+--- util-linux-2.11y/login-utils/chsh.c.sopwith	Fri Sep  5 08:51:49 2003
++++ util-linux-2.11y/login-utils/chsh.c	Fri Sep  5 08:53:43 2003
+@@ -185,7 +185,6 @@
+ 	printf (_("Shell not changed.\n"));
+ 	return 0;
+     }
+-    if (!strcmp(shell, "/bin/sh")) shell = "";
+     pw->pw_shell = shell;
+     if (setpwnam (pw) < 0) {
+ 	perror ("setpwnam");
+@@ -299,6 +298,8 @@
+ check_shell (char *shell) {
+     int i, c;
+ 
++    if (! *shell) shell = "/bin/sh"; /* Fudge it */
++
+     if (*shell != '/') {
+ 	printf (_("%s: shell must be a full path name.\n"), whoami);
+ 	return (-1);

================================================================
Index: SOURCES/util-linux-col-EILSEQ.patch
diff -u /dev/null SOURCES/util-linux-col-EILSEQ.patch:1.1
--- /dev/null	Sat Mar 24 22:20:43 2007
+++ SOURCES/util-linux-col-EILSEQ.patch	Sat Mar 24 22:20:37 2007
@@ -0,0 +1,40 @@
+- col truncates data
+
+--- util-linux-2.13-pre6/text-utils/col.c.kzak	2002-03-09 00:05:12.000000000 +0100
++++ util-linux-2.13-pre6/text-utils/col.c	2006-02-21 22:25:48.000000000 +0100
+@@ -128,6 +128,7 @@
+ 	int this_line;			/* line l points to */
+ 	int nflushd_lines;		/* number of lines that were flushed */
+ 	int adjust, opt, warned;
++	int ret = 0;
+ 
+ 	setlocale(LC_ALL, "");
+ 	bindtextdomain(PACKAGE, LOCALEDIR);
+@@ -175,8 +176,16 @@
+ 	cur_line = max_line = nflushd_lines = this_line = 0;
+ 	cur_set = last_set = CS_NORMAL;
+ 	lines = l = alloc_line();
+-
+-	while ((ch = getwchar()) != WEOF) {
++	
++	while (feof(stdin)==0) {
++		errno = 0;
++		if ((ch = getwchar()) == WEOF) {
++			if (errno==EILSEQ) {
++				perror("col");
++				ret = 1;
++			}
++			break;
++		}	
+ 		if (!iswgraph(ch)) {
+ 			switch (ch) {
+ 			case BS:		/* can't go back further */
+@@ -332,7 +341,7 @@
+ 	flush_blanks();
+ 	if (ferror(stdout) || fclose(stdout))
+ 		return 1;
+-	return 0;
++	return ret;
+ }
+ 
+ void flush_lines(int nflush)

================================================================
Index: SOURCES/util-linux-cramfs-maxentries.patch
diff -u /dev/null SOURCES/util-linux-cramfs-maxentries.patch:1.1
--- /dev/null	Sat Mar 24 22:20:43 2007
+++ SOURCES/util-linux-cramfs-maxentries.patch	Sat Mar 24 22:20:37 2007
@@ -0,0 +1,49 @@
+- mkfs.cramfs dies creating Fedora installer image
+
+--- util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c.maxentries	2005-10-20 23:46:19.000000000 +0200
++++ util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c	2005-10-20 23:54:07.000000000 +0200
+@@ -471,11 +471,13 @@
+  * entries, using a stack to remember the directories
+  * we've seen.
+  */
+-#define MAXENTRIES (100)
+ static unsigned int write_directory_structure(struct entry *entry, char *base, unsigned int offset)
+ {
+ 	int stack_entries = 0;
+-	struct entry *entry_stack[MAXENTRIES];
++	int stack_size = 64;
++	struct entry **entry_stack;
++
++	entry_stack = xmalloc(stack_size * sizeof(struct entry *));
+ 
+ 	for (;;) {
+ 		int dir_start = stack_entries;
+@@ -508,13 +510,13 @@
+ 			if (verbose)
+ 				printf("  %s\n", entry->name);
+ 			if (entry->child) {
+-				if (stack_entries >= MAXENTRIES) {
+-					fprintf(stderr,
+-						_("Exceeded MAXENTRIES.  Raise"
+-						  " this value in mkcramfs.c "
+-						  "and recompile.  Exiting.\n")
+-						);
+-					exit(8);
++				if (stack_entries >= stack_size) {
++					stack_size *= 2;
++					entry_stack = realloc(entry_stack, stack_size * sizeof(struct entry *));
++					if (!entry_stack) {
++						perror(NULL);
++						exit(8);        /* out of memory */
++					}
+ 				}
+ 				entry_stack[stack_entries] = entry;
+ 				stack_entries++;
+@@ -551,6 +553,7 @@
+ 			printf("'%s':\n", entry->name);
+ 		entry = entry->child;
+ 	}
++	free(entry_stack);
+ 	return offset;
+ }
+ 

================================================================
Index: SOURCES/util-linux-cramfs-zerofiles.patch
diff -u /dev/null SOURCES/util-linux-cramfs-zerofiles.patch:1.1
--- /dev/null	Sat Mar 24 22:20:43 2007
+++ SOURCES/util-linux-cramfs-zerofiles.patch	Sat Mar 24 22:20:37 2007
@@ -0,0 +1,13 @@
+- mkfs.cramfs doesn't work correctly with empty files
+
+--- util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c.zerofiles	2005-11-07 13:05:27.000000000 +0100
++++ util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c	2005-11-07 13:06:38.000000000 +0100
+@@ -661,7 +661,7 @@
+                         if (e->same) {
+                                 set_data_offset(e, base, e->same->offset);
+                                 e->offset = e->same->offset;
+-                        } else {
++                        } else if (e->size) {
+                                 set_data_offset(e, base, offset);
+                                 e->offset = offset;
+                                 offset = do_compress(base, offset, e->name,

================================================================
Index: SOURCES/util-linux-ctrlaltdel-man.patch
diff -u /dev/null SOURCES/util-linux-ctrlaltdel-man.patch:1.1
--- /dev/null	Sat Mar 24 22:20:43 2007
+++ SOURCES/util-linux-ctrlaltdel-man.patch	Sat Mar 24 22:20:37 2007
@@ -0,0 +1,12 @@
+- Non-existant simpleinit(8) mentioned in ctrlaltdel(8)
+
+--- util-linux-2.13-pre6/sys-utils/ctrlaltdel.8.kzak	2006-08-10 12:23:53.000000000 +0200
++++ util-linux-2.13-pre6/sys-utils/ctrlaltdel.8	2006-08-10 12:24:08.000000000 +0200
+@@ -32,7 +32,6 @@
+ .SH FILES
+ .I /etc/rc.local
+ .SH "SEE ALSO"
+-.BR simpleinit (8),
+ .BR init (8)
+ .SH AUTHOR
+ Peter Orbaek (poe at daimi.aau.dk)

================================================================
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list