From b4b7c6b51555fb1e93fa365fb3359165319b9c56 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 18 May 2007 10:51:42 +0000 Subject: [PATCH 1/8] Initialize branch F-7 for util-linux --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..c48525c --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-7 From 7dd321303cd20828532e1f455db64e0de58308c0 Mon Sep 17 00:00:00 2001 From: kzak Date: Tue, 10 Jul 2007 09:55:56 +0000 Subject: [PATCH 2/8] - fix #245578 - login's PAM configuration inits the keyring at an inconvenient time - fix #231532 - "pamconsole" not documented in mount(8) - fix #243930 - translation files exist, but are not being used - fix #228731 - sfdisk doesn't support DM-MP device (add default heads and sectors) - fix #231192 - ipcs is not printing correct values on pLinux - fix #245912 - mount doesn't write the 'loop=...' option in /etc/mtab when mounting a loop device - fix #213253 - "cal -3" generates improperly formatted output --- util-linux-2.13-cal-3.patch | 109 +++++++++++++++++++++++++++++++ util-linux-2.13-ipcs-32bit.patch | 68 +++++++++++++++++++ util-linux-2.13-localedir.patch | 16 +++++ util-linux-2.13-mount-loop.patch | 34 ++++++++++ util-linux-2.13-sfdisk-geo.patch | 13 ++++ util-linux-login.pamd | 2 +- util-linux-remote.pamd | 3 +- util-linux.spec | 27 +++++++- 8 files changed, 268 insertions(+), 4 deletions(-) create mode 100644 util-linux-2.13-cal-3.patch create mode 100644 util-linux-2.13-ipcs-32bit.patch create mode 100644 util-linux-2.13-localedir.patch create mode 100644 util-linux-2.13-mount-loop.patch create mode 100644 util-linux-2.13-sfdisk-geo.patch diff --git a/util-linux-2.13-cal-3.patch b/util-linux-2.13-cal-3.patch new file mode 100644 index 0000000..f7f7916 --- /dev/null +++ b/util-linux-2.13-cal-3.patch @@ -0,0 +1,109 @@ +--- util-linux-2.13-pre7/misc-utils/cal.c.kzak 2007-07-09 14:54:39.000000000 +0200 ++++ util-linux-2.13-pre7/misc-utils/cal.c 2007-07-09 14:54:39.000000000 +0200 +@@ -87,9 +87,13 @@ + putp(s); + } + +-static char * ++static const char * + my_tgetstr(char *s, char *ss) { +- return tigetstr(ss); ++ const char* ret = tigetstr(ss); ++ if (!ret || ret==(char*)-1) ++ return ""; ++ else ++ return ret; + } + + #elif defined(HAVE_LIBTERMCAP) +@@ -110,14 +114,20 @@ + tputs (s, 1, putchar); + } + +-static char * ++static const char * + my_tgetstr(char *s, char *ss) { +- return tgetstr(s, &strbuf); ++ const char* ret = tgetstr(s, &strbuf); ++ if (!ret) ++ return ""; ++ else ++ return ret; + } + + #endif + const char *term=""; + const char *Senter="", *Sexit="";/* enter and exit standout mode */ ++int Slen; /* strlen of Senter+Sexit */ ++char *Hrow; /* pointer to highlighted row in month */ + + #ifdef HAVE_LANGINFO_H + # include +@@ -262,6 +272,7 @@ + if (ret > 0) { + Senter = my_tgetstr("so","smso"); + Sexit = my_tgetstr("se","rmso"); ++ Slen = strlen(Senter) + strlen(Sexit); + } + } + #endif +@@ -437,11 +448,18 @@ + sprintf(out->s[1],"%s", + julian ? j_day_headings : day_headings); + for (row = 0; row < 6; row++) { +- for (col = 0, p = lineout; col < 7; col++) +- p = ascii_day(p, days[row * 7 + col]); ++ int has_hl = 0; ++ for (col = 0, p = lineout; col < 7; col++) { ++ int xd = days[row * 7 + col]; ++ if (xd != SPACE && (xd & TODAY_FLAG)) ++ has_hl = 1; ++ p = ascii_day(p, xd); ++ } + *p = '\0'; + trim_trailing_spaces(lineout); + sprintf(out->s[row+2], "%s", lineout); ++ if (has_hl) ++ Hrow = out->s[row+2]; + } + } + +@@ -489,14 +507,25 @@ + do_monthly(day, prev_month, prev_year, &out_prev); + do_monthly(day, month, year, &out_curm); + do_monthly(day, next_month, next_year, &out_next); ++ + width = (julian ? J_WEEK_LEN : WEEK_LEN) -1; + for (i = 0; i < 2; i++) + printf("%s %s %s\n", out_prev.s[i], out_curm.s[i], out_next.s[i]); + for (i = 2; i < FMT_ST_LINES; i++) { ++ int w1, w2, w3; ++ w1 = w2 = w3 = width; ++ ++#if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP) ++ /* adjust width to allow for non printable characters */ ++ w1 += (out_prev.s[i] == Hrow ? Slen : 0); ++ w2 += (out_curm.s[i] == Hrow ? Slen : 0); ++ w3 += (out_next.s[i] == Hrow ? Slen : 0); ++#endif + snprintf(lineout, SIZE(lineout), "%-*s %-*s %-*s\n", +- width, out_prev.s[i], +- width, out_curm.s[i], +- width, out_next.s[i]); ++ w1, out_prev.s[i], ++ w2, out_curm.s[i], ++ w3, out_next.s[i]); ++ + #if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP) + my_putstring(lineout); + #else +--- util-linux-2.13-pre7/configure.ac.kzak 2007-07-09 14:54:48.000000000 +0200 ++++ util-linux-2.13-pre7/configure.ac 2007-07-09 14:55:11.000000000 +0200 +@@ -71,6 +71,7 @@ + if test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes; then + have_ncurses=yes + AC_MSG_NOTICE([you have ncurses]) ++ AC_DEFINE(HAVE_NCURSES, 1, [Do we have -lncurses?]) + else + AC_MSG_NOTICE([you do not have ncurses]) + fi diff --git a/util-linux-2.13-ipcs-32bit.patch b/util-linux-2.13-ipcs-32bit.patch new file mode 100644 index 0000000..99942eb --- /dev/null +++ b/util-linux-2.13-ipcs-32bit.patch @@ -0,0 +1,68 @@ + +The compat (32bit) version of sys_shmctl on 64bit kernel returns incorrect +information. In this case is better to read data from /proc/sys/kernel/shm*. + +--- util-linux-2.13-pre7/sys-utils/ipcs.c.kzak 2007-06-25 10:25:31.000000000 +0200 ++++ util-linux-2.13-pre7/sys-utils/ipcs.c 2007-06-25 10:14:06.000000000 +0200 +@@ -253,6 +253,26 @@ + printf(" %-10d\n", ipcp->gid); + } + ++static unsigned long long ++shminfo_from_proc(const char *name, unsigned long def) ++{ ++ char path[256]; ++ char buf[64]; ++ FILE *f; ++ unsigned long long res = def; ++ ++ if (!name) ++ return res; ++ ++ snprintf(path, sizeof(path), "/proc/sys/kernel/%s", name); ++ ++ if (!(f = fopen(path, "r"))) ++ return res; ++ if (fgets(buf, sizeof(buf), f)) ++ res = atoll(buf); ++ fclose(f); ++ return res; ++} + + void do_shm (char format) + { +@@ -268,7 +288,7 @@ + printf (_("kernel not configured for shared memory\n")); + return; + } +- ++ + switch (format) { + case LIMITS: + printf (_("------ Shared Memory Limits --------\n")); +@@ -276,18 +296,15 @@ + return; + /* glibc 2.1.3 and all earlier libc's have ints as fields + of struct shminfo; glibc 2.1.91 has unsigned long; ach */ +- printf (_("max number of segments = %lu\n"), +- (unsigned long) shminfo.shmmni); +- printf (_("max seg size (kbytes) = %lu\n"), +- (unsigned long) (shminfo.shmmax >> 10)); +- ++ printf (_("max number of segments = %llu\n"), ++ shminfo_from_proc("shmmni", shminfo.shmmni)); ++ printf (_("max seg size (kbytes) = %llu\n"), ++ (shminfo_from_proc("shmmax", shminfo.shmmax) >> 10)); ++ + /* max shmem = pagesize * shminfo.shmall / 1024 +- * +- * note: that "shminfo.shmall * getpagesize()" is greater than ULONG_MAX (32bit) +- * it means that better is "/" before "*" or use "long long" + */ +- printf (_("max total shared memory (kbytes) = %lu\n"), +- getpagesize()/1024 * (unsigned long) shminfo.shmall); ++ printf (_("max total shared memory (kbytes) = %llu\n"), ++ getpagesize()/1024 * shminfo_from_proc("shmall", shminfo.shmall)); + printf (_("min seg size (bytes) = %lu\n"), + (unsigned long) shminfo.shmmin); + return; diff --git a/util-linux-2.13-localedir.patch b/util-linux-2.13-localedir.patch new file mode 100644 index 0000000..97be1e7 --- /dev/null +++ b/util-linux-2.13-localedir.patch @@ -0,0 +1,16 @@ +--- util-linux-2.13-pre7/config/include-Makefile.am.kzak 2007-06-25 11:15:40.000000000 +0200 ++++ util-linux-2.13-pre7/config/include-Makefile.am 2007-06-25 11:16:39.000000000 +0200 +@@ -3,10 +3,10 @@ + datadir = $(prefix)/usr/share + infodir = $(datadir)/info + mandir = $(datadir)/man ++localedir = $(datadir)/locale + +-AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include ++AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \ ++ -DLOCALEDIR=\"$(localedir)\" + + DEFAULT_INCLUDES = + +-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ +- diff --git a/util-linux-2.13-mount-loop.patch b/util-linux-2.13-mount-loop.patch new file mode 100644 index 0000000..27db35c --- /dev/null +++ b/util-linux-2.13-mount-loop.patch @@ -0,0 +1,34 @@ +commit 2e039577c5eb895fab35aed136345a0c07d7a587 +Author: Karel Zak +Date: Mon Jul 2 23:35:08 2007 +0200 + + mount: use loop= option when mounting by /sbin/mount. + + The mount(8) calls external mount programs (/sbin/mount.) + without the loop=/dev/loopN option. This patch fix this bug. + + Signed-off-by: Karel Zak + +diff --git a/mount/mount.c b/mount/mount.c +index c27c5e5..50089a9 100644 +--- a/mount/mount.c ++++ b/mount/mount.c +@@ -1057,6 +1057,9 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, + goto out; + } + ++ if (loop) ++ opt_loopdev = loopdev; ++ + /* + * Call mount.TYPE for types that require a separate mount program. + * For the moment these types are ncpfs and smbfs. Maybe also vxfs. +@@ -1082,8 +1085,6 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, + + if (fake || mnt5_res == 0) { + /* Mount succeeded, report this (if verbose) and write mtab entry. */ +- if (loop) +- opt_loopdev = loopdev; + + if (!(mounttype & MS_PROPAGATION)) { + update_mtab_entry(loop ? loopfile : spec, diff --git a/util-linux-2.13-sfdisk-geo.patch b/util-linux-2.13-sfdisk-geo.patch new file mode 100644 index 0000000..52b5b9f --- /dev/null +++ b/util-linux-2.13-sfdisk-geo.patch @@ -0,0 +1,13 @@ +--- util-linux-2.13-pre7/fdisk/sfdisk.c.kzak 2007-06-25 09:13:31.000000000 +0200 ++++ util-linux-2.13-pre7/fdisk/sfdisk.c 2007-06-25 09:12:42.000000000 +0200 +@@ -469,8 +469,8 @@ + + R = get_geometry(dev, fd, silent); + +- B.heads = (U.heads ? U.heads : R.heads); +- B.sectors = (U.sectors ? U.sectors : R.sectors); ++ B.heads = (U.heads ? U.heads : (R.heads ? R.heads : 255)); ++ B.sectors = (U.sectors ? U.sectors : (R.sectors ? R.sectors : 63)); + B.cylinders = (U.cylinders ? U.cylinders : R.cylinders); + + B.cylindersize = B.heads * B.sectors; diff --git a/util-linux-login.pamd b/util-linux-login.pamd index 04195f7..9e8ca3b 100644 --- a/util-linux-login.pamd +++ b/util-linux-login.pamd @@ -6,10 +6,10 @@ account include system-auth password include system-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close +session optional pam_keyinit.so force revoke session include system-auth session required pam_loginuid.so session optional pam_console.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open -session optional pam_keyinit.so force revoke session optional pam_ck_connector.so diff --git a/util-linux-remote.pamd b/util-linux-remote.pamd index 4cf49ea..705203e 100644 --- a/util-linux-remote.pamd +++ b/util-linux-remote.pamd @@ -6,9 +6,10 @@ account include system-auth password include system-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close +session optional pam_keyinit.so force revoke session include system-auth session required pam_loginuid.so session optional pam_console.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open -session optional pam_keyinit.so force revoke + diff --git a/util-linux.spec b/util-linux.spec index e3500e6..f55afb5 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -9,7 +9,7 @@ Summary: A collection of basic system utilities. Name: util-linux Version: 2.13 -Release: 0.51%{?dist} +Release: 0.52%{?dist} License: distributable Group: System Environment/Base @@ -247,7 +247,16 @@ Patch262: util-linux-2.13-partx-man.patch Patch263: util-linux-2.13-hwclock-systohc.patch # 227903 - mount -f does not work with NFS-mounted Patch264: util-linux-2.13-mount-fake.patch - +# 243930 - Translation files exist, but are not being used +Patch265: util-linux-2.13-localedir.patch +# 228731 - sfdisk doesn't support DM-MP device (add default heads and sectors) +Patch266: util-linux-2.13-sfdisk-geo.patch +# 231192 - ipcs is not printing correct values on pLinux +Patch267: util-linux-2.13-ipcs-32bit.patch +# 245912: mount doesn't write the 'loop=...' option in /etc/mtab when mounting a loop device +Patch268: util-linux-2.13-mount-loop.patch +# 213253: "cal -3" generates improperly formatted output +Patch269: util-linux-2.13-cal-3.patch # When adding patches, please make sure that it is easy to find out what bug # the # patch fixes. @@ -351,6 +360,11 @@ cp %{SOURCE8} %{SOURCE9} . %patch262 -p1 %patch263 -p1 %patch264 -p1 +%patch265 -p1 +%patch266 -p1 +%patch267 -p1 +%patch268 -p1 +%patch269 -p1 %build unset LINGUAS || : @@ -764,6 +778,15 @@ exit 0 /sbin/losetup %changelog +* Mon Jul 9 2007 Karel Zak 2.13-0.52 +- fix #245578 - login's PAM configuration inits the keyring at an inconvenient time +- fix #231532 - "pamconsole" not documented in mount(8) +- fix #243930 - translation files exist, but are not being used +- fix #228731 - sfdisk doesn't support DM-MP device (add default heads and sectors) +- fix #231192 - ipcs is not printing correct values on pLinux +- fix #245912 - mount doesn't write the 'loop=...' option in /etc/mtab when mounting a loop device +- fix #213253 - "cal -3" generates improperly formatted output + * Fri Apr 6 2007 Karel Zak 2.13-0.51 - fix #150493 - hwclock --systohc sets clock 0.5 seconds slow - fix #220873 - starting RPC idmapd: Error: RPC MTAB does not exist. From ccf8f112a65260830641680c1ea390dfb61fa6d5 Mon Sep 17 00:00:00 2001 From: kzak Date: Thu, 2 Aug 2007 09:22:19 +0000 Subject: [PATCH 3/8] - fix #236848 - mount/fstab.c:lock_mtab() should open with proper permissions --- util-linux-2.12a-mount-lockperm.patch | 21 +++++++++++++++++++++ util-linux.spec | 11 +++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 util-linux-2.12a-mount-lockperm.patch diff --git a/util-linux-2.12a-mount-lockperm.patch b/util-linux-2.12a-mount-lockperm.patch new file mode 100644 index 0000000..d60538c --- /dev/null +++ b/util-linux-2.12a-mount-lockperm.patch @@ -0,0 +1,21 @@ + +From: Flávio Leitner +Subject: mount should set proper permissions on locktime + +When creating the "/etc/mtab~" lockfile (specifically 'linktargetfile' in the +lock_mtab function), the file is created with incorrect permissions ('000') +which necessitates root to leverage CAP_DAC_OVERRIDE. If proper file modes (it +would appear 0600 would be sufficient) were used in the open this would +function properly with CAP_DAC_OVERRIDE revoked. + +--- util-linux-2.12a/mount/fstab.c.kzak 2007-07-31 12:13:26.000000000 +0200 ++++ util-linux-2.12a/mount/fstab.c 2007-07-31 12:13:11.000000000 +0200 +@@ -433,7 +433,7 @@ + linktargetfile = xmalloc(strlen(MOUNTLOCK_LINKTARGET) + 20); + sprintf(linktargetfile, MOUNTLOCK_LINKTARGET, getpid ()); + +- i = open (linktargetfile, O_WRONLY|O_CREAT, 0); ++ i = open (linktargetfile, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR); + if (i < 0) { + int errsv = errno; + /* linktargetfile does not exist (as a file) diff --git a/util-linux.spec b/util-linux.spec index f55afb5..e6b26c4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -9,7 +9,7 @@ Summary: A collection of basic system utilities. Name: util-linux Version: 2.13 -Release: 0.52%{?dist} +Release: 0.53%{?dist} License: distributable Group: System Environment/Base @@ -257,10 +257,9 @@ Patch267: util-linux-2.13-ipcs-32bit.patch Patch268: util-linux-2.13-mount-loop.patch # 213253: "cal -3" generates improperly formatted output Patch269: util-linux-2.13-cal-3.patch +# 236848 - mount/fstab.c:lock_mtab() should open with proper permissions +Patch270: util-linux-2.12a-mount-lockperm.patch -# When adding patches, please make sure that it is easy to find out what bug # the -# patch fixes. -########### END upstreamable %description The util-linux package contains a large variety of low-level system @@ -365,6 +364,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch267 -p1 %patch268 -p1 %patch269 -p1 +%patch270 -p1 %build unset LINGUAS || : @@ -778,6 +778,9 @@ exit 0 /sbin/losetup %changelog +* Thu Aug 2 2007 Karel Zak 2.13-0.53 +- fix #236848 - mount/fstab.c:lock_mtab() should open with proper permissions + * Mon Jul 9 2007 Karel Zak 2.13-0.52 - fix #245578 - login's PAM configuration inits the keyring at an inconvenient time - fix #231532 - "pamconsole" not documented in mount(8) From 6d879ad042ae1703f38000d00c3ed43a492e9624 Mon Sep 17 00:00:00 2001 From: kzak Date: Thu, 2 Aug 2007 11:31:02 +0000 Subject: [PATCH 4/8] add blockdev patches --- util-linux-2.13-blockdev-errno.patch | 36 +++++++++++++ util-linux-2.13-blockdev-unsigned.patch | 69 +++++++++++++++++++++++++ util-linux.spec | 11 +++- 3 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 util-linux-2.13-blockdev-errno.patch create mode 100644 util-linux-2.13-blockdev-unsigned.patch diff --git a/util-linux-2.13-blockdev-errno.patch b/util-linux-2.13-blockdev-errno.patch new file mode 100644 index 0000000..0ccdd60 --- /dev/null +++ b/util-linux-2.13-blockdev-errno.patch @@ -0,0 +1,36 @@ +commit 3281d4268a192cbd1951347a4a857b94428dc958 +Author: Karel Zak +Date: Wed Aug 1 15:06:18 2007 +0200 + + blockdev: fix "blockdev --getsz" for large devices + + The "blockdev --getsz" command doesn't try to use BLKGETSIZE64 when + previous BLKGETSIZE failed with EFBIG. This patch fixes this problem. + + Signed-off-by: Karel Zak + +diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c +index 46b7fa7..0dd531c 100644 +--- a/disk-utils/blockdev.c ++++ b/disk-utils/blockdev.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + #include "nls.h" + +@@ -148,8 +149,10 @@ getsize(int fd, long long *sectors) { + long long b; + + err = ioctl (fd, BLKGETSIZE, &sz); +- if (err) +- return err; ++ if (err) { ++ if (errno != EFBIG) ++ return err; ++ } + err = ioctl(fd, BLKGETSIZE64, &b); + if (err || b == 0 || b == sz) + *sectors = sz; diff --git a/util-linux-2.13-blockdev-unsigned.patch b/util-linux-2.13-blockdev-unsigned.patch new file mode 100644 index 0000000..4f46083 --- /dev/null +++ b/util-linux-2.13-blockdev-unsigned.patch @@ -0,0 +1,69 @@ +--- util-linux-2.13-pre7/disk-utils/blockdev.c.kzak 2007-08-02 13:24:45.000000000 +0200 ++++ util-linux-2.13-pre7/disk-utils/blockdev.c 2007-08-02 13:24:45.000000000 +0200 +@@ -77,6 +77,8 @@ + #define ARGINTG 4 + #define ARGLINTG 5 + #define ARGLLINTG 6 ++#define ARGLU 7 ++#define ARGLLU 8 + long argval; + char *argname; + char *help; +@@ -98,10 +100,10 @@ + { "--setbsz", "BLKBSZSET", BLKBSZSET, ARGINTAP, 0, "BLOCKSIZE", N_("set blocksize") }, + #endif + #ifdef BLKGETSIZE +- { "--getsize", "BLKGETSIZE", BLKGETSIZE, ARGLINTG, -1, NULL, N_("get 32-bit sector count") }, ++ { "--getsize", "BLKGETSIZE", BLKGETSIZE, ARGLU, -1, NULL, N_("get 32-bit sector count") }, + #endif + #ifdef BLKGETSIZE64 +- { "--getsize64", "BLKGETSIZE64", BLKGETSIZE64, ARGLLINTG, -1, NULL, N_("get size in bytes") }, ++ { "--getsize64", "BLKGETSIZE64", BLKGETSIZE64, ARGLLU, -1, NULL, N_("get size in bytes") }, + #endif + #ifdef BLKRASET + { "--setra", "BLKRASET", BLKRASET, ARGINTA, 0, "READAHEAD", N_("set readahead") }, +@@ -286,6 +288,8 @@ + int iarg; + long larg; + long long llarg; ++ unsigned long lu; ++ unsigned long long llu; + int verbose = 0; + + for (i = 1; i < d; i++) { +@@ -363,6 +367,15 @@ + llarg = bdcms[j].argval; + res = ioctl(fd, bdcms[j].ioc, &llarg); + break; ++ case ARGLU: ++ lu = bdcms[j].argval; ++ res = ioctl(fd, bdcms[j].ioc, &lu); ++ break; ++ case ARGLLU: ++ llu = bdcms[j].argval; ++ res = ioctl(fd, bdcms[j].ioc, &llu); ++ break; ++ + } + if (res == -1) { + perror(bdcms[j].iocname); +@@ -389,6 +402,19 @@ + else + printf("%lld\n", llarg); + break; ++ case ARGLU: ++ if (verbose) ++ printf("%s: %lu\n", _(bdcms[j].help), lu); ++ else ++ printf("%lu\n", lu); ++ break; ++ case ARGLLU: ++ if (verbose) ++ printf("%s: %llu\n", _(bdcms[j].help), llu); ++ else ++ printf("%llu\n", llu); ++ break; ++ + default: + if (verbose) + printf(_("%s succeeded.\n"), _(bdcms[j].help)); diff --git a/util-linux.spec b/util-linux.spec index e6b26c4..56c710a 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -253,12 +253,16 @@ Patch265: util-linux-2.13-localedir.patch Patch266: util-linux-2.13-sfdisk-geo.patch # 231192 - ipcs is not printing correct values on pLinux Patch267: util-linux-2.13-ipcs-32bit.patch -# 245912: mount doesn't write the 'loop=...' option in /etc/mtab when mounting a loop device +# 245912 - mount doesn't write the 'loop=...' option in /etc/mtab when mounting a loop device Patch268: util-linux-2.13-mount-loop.patch -# 213253: "cal -3" generates improperly formatted output +# 213253 - "cal -3" generates improperly formatted output Patch269: util-linux-2.13-cal-3.patch # 236848 - mount/fstab.c:lock_mtab() should open with proper permissions Patch270: util-linux-2.12a-mount-lockperm.patch +# 238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors +Patch271: util-linux-2.13-blockdev-errno.patch +Patch272: util-linux-2.13-blockdev-unsigned.patch + %description @@ -365,6 +369,8 @@ cp %{SOURCE8} %{SOURCE9} . %patch268 -p1 %patch269 -p1 %patch270 -p1 +%patch271 -p1 +%patch272 -p1 %build unset LINGUAS || : @@ -780,6 +786,7 @@ exit 0 %changelog * Thu Aug 2 2007 Karel Zak 2.13-0.53 - fix #236848 - mount/fstab.c:lock_mtab() should open with proper permissions +- fix #238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors * Mon Jul 9 2007 Karel Zak 2.13-0.52 - fix #245578 - login's PAM configuration inits the keyring at an inconvenient time From 030432aac2f8b5710e8d6d1859c042d5760e7450 Mon Sep 17 00:00:00 2001 From: kzak Date: Wed, 8 Aug 2007 14:58:29 +0000 Subject: [PATCH 5/8] - backport mount relatime patch --- util-linux-2.13-mount-relatime.patch | 44 ++++++++++++++++++++++++++++ util-linux.spec | 10 +++++-- 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 util-linux-2.13-mount-relatime.patch diff --git a/util-linux-2.13-mount-relatime.patch b/util-linux-2.13-mount-relatime.patch new file mode 100644 index 0000000..edae73b --- /dev/null +++ b/util-linux-2.13-mount-relatime.patch @@ -0,0 +1,44 @@ +--- util-linux-2.13-pre7/mount/mount_constants.h.kzak 2007-08-08 16:48:29.000000000 +0200 ++++ util-linux-2.13-pre7/mount/mount_constants.h 2007-08-08 16:48:30.000000000 +0200 +@@ -57,6 +57,10 @@ + #ifndef MS_VERBOSE + #define MS_VERBOSE 0x8000 /* 32768 */ + #endif ++#ifndef MS_RELATIME ++#define MS_RELATIME 0x200000 /* 200000: Update access times relative ++ to mtime/ctime */ ++#endif + #ifndef MS_UNBINDABLE + #define MS_UNBINDABLE (1<<17) /* 131072 unbindable*/ + #endif +--- util-linux-2.13-pre7/mount/mount.8.kzak 2007-08-08 16:48:29.000000000 +0200 ++++ util-linux-2.13-pre7/mount/mount.8 2007-08-08 16:48:30.000000000 +0200 +@@ -623,6 +623,13 @@ + .B nodiratime + Do not update directory inode access times on this filesystem. + .TP ++.B relatime ++Update inode access times relative to modify or change time. Access ++time is only updated if the previous access time was earlier than the ++current modify or change time. (Similar to noatime, but doesn't break ++mutt or other applications that need to know if a file has been read ++since the last time it was modified.) ++.TP + .B noauto + Can only be mounted explicitly (i.e., the + .B \-a +--- util-linux-2.13-pre7/mount/mount.c.kzak 2007-08-08 16:48:30.000000000 +0200 ++++ util-linux-2.13-pre7/mount/mount.c 2007-08-08 16:53:02.000000000 +0200 +@@ -177,6 +177,12 @@ + { "diratime", 0, 1, MS_NODIRATIME }, /* Update dir access times */ + { "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */ + #endif ++#ifdef MS_RELATIME ++ { "relatime", 0, 0, MS_RELATIME }, /* Update access times relative to ++ mtime/ctime */ ++ { "norelatime", 0, 1, MS_RELATIME }, /* Update access time without regard ++ to mtime/ctime */ ++#endif + { "kudzu", 0, 0, MS_COMMENT }, /* Silently remove this option (backwards compat use only - deprecated) */ + { "managed", 0, 0, MS_COMMENT }, /* Silently remove this option */ + { NULL, 0, 0, 0 } diff --git a/util-linux.spec b/util-linux.spec index 56c710a..e4d1f7f 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -9,7 +9,7 @@ Summary: A collection of basic system utilities. Name: util-linux Version: 2.13 -Release: 0.53%{?dist} +Release: 0.54%{?dist} License: distributable Group: System Environment/Base @@ -262,8 +262,8 @@ Patch270: util-linux-2.12a-mount-lockperm.patch # 238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors Patch271: util-linux-2.13-blockdev-errno.patch Patch272: util-linux-2.13-blockdev-unsigned.patch - - +# backport MS_RELATIME +Patch273: util-linux-2.13-mount-relatime.patch %description The util-linux package contains a large variety of low-level system @@ -371,6 +371,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch270 -p1 %patch271 -p1 %patch272 -p1 +%patch273 -p1 %build unset LINGUAS || : @@ -784,6 +785,9 @@ exit 0 /sbin/losetup %changelog +* Wed Aug 8 2007 Karel Zak 2.13-0.54 +- backport mount relatime patch + * Thu Aug 2 2007 Karel Zak 2.13-0.53 - fix #236848 - mount/fstab.c:lock_mtab() should open with proper permissions - fix #238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors From 4c6b28ff2ae24de4345178bcfe5377e89f0bccee Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 8 Oct 2007 13:30:28 +0000 Subject: [PATCH 6/8] - fix #320131 - CVE-2007-5191 util-linux (u)mount doesn't drop privileges properly when calling helpers [F7] --- util-linux-2.13-mount-setuid.patch | 36 ++++++++++++++++++++++++++++++ util-linux.spec | 8 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 util-linux-2.13-mount-setuid.patch diff --git a/util-linux-2.13-mount-setuid.patch b/util-linux-2.13-mount-setuid.patch new file mode 100644 index 0000000..dbc62a2 --- /dev/null +++ b/util-linux-2.13-mount-setuid.patch @@ -0,0 +1,36 @@ +diff -up util-linux-2.13-pre7/mount/umount.c.kzak util-linux-2.13-pre7/mount/umount.c +--- util-linux-2.13-pre7/mount/umount.c.kzak 2007-10-08 15:22:38.000000000 +0200 ++++ util-linux-2.13-pre7/mount/umount.c 2007-10-08 15:24:01.000000000 +0200 +@@ -102,8 +102,12 @@ check_special_umountprog(const char *spe + char *umountargs[8]; + int i = 0; + +- setuid(getuid()); +- setgid(getgid()); ++ if(setgid(getgid()) < 0) ++ die(EX_FAIL, _("umount: cannot set group id: %s"), strerror(errno)); ++ ++ if(setuid(getuid()) < 0) ++ die(EX_FAIL, _("umount: cannot set user id: %s"), strerror(errno)); ++ + umountargs[i++] = umountprog; + umountargs[i++] = xstrdup(node); + if (nomtab) +diff -up util-linux-2.13-pre7/mount/mount.c.kzak util-linux-2.13-pre7/mount/mount.c +--- util-linux-2.13-pre7/mount/mount.c.kzak 2007-10-08 15:22:38.000000000 +0200 ++++ util-linux-2.13-pre7/mount/mount.c 2007-10-08 15:24:01.000000000 +0200 +@@ -600,8 +600,12 @@ check_special_mountprog(const char *spec + char *oo, *mountargs[11]; + int i = 0; + +- setuid(getuid()); +- setgid(getgid()); ++ if(setgid(getgid()) < 0) ++ die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno)); ++ ++ if(setuid(getuid()) < 0) ++ die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno)); ++ + oo = fix_opts_string (flags, extra_opts, NULL); + mountargs[i++] = mountprog; + mountargs[i++] = spec; diff --git a/util-linux.spec b/util-linux.spec index e4d1f7f..fab1952 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -9,7 +9,7 @@ Summary: A collection of basic system utilities. Name: util-linux Version: 2.13 -Release: 0.54%{?dist} +Release: 0.55%{?dist} License: distributable Group: System Environment/Base @@ -264,6 +264,8 @@ Patch271: util-linux-2.13-blockdev-errno.patch Patch272: util-linux-2.13-blockdev-unsigned.patch # backport MS_RELATIME Patch273: util-linux-2.13-mount-relatime.patch +# 320131 - CVE-2007-5191 util-linux (u)mount doesn't drop privileges properly when calling helpers [F7] +Patch274: util-linux-2.13-mount-setuid.patch %description The util-linux package contains a large variety of low-level system @@ -372,6 +374,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch271 -p1 %patch272 -p1 %patch273 -p1 +%patch274 -p1 %build unset LINGUAS || : @@ -785,6 +788,9 @@ exit 0 /sbin/losetup %changelog +* Mon Oct 8 2007 Karel Zak 2.13-0.55 +- fix #320131 - CVE-2007-5191 util-linux (u)mount doesn't drop privileges properly when calling helpers [F7] + * Wed Aug 8 2007 Karel Zak 2.13-0.54 - backport mount relatime patch From 28313427b239271f1da08947961083344b665d47 Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 8 Oct 2007 13:35:25 +0000 Subject: [PATCH 7/8] fix release number --- util-linux.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index fab1952..01be400 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -9,7 +9,7 @@ Summary: A collection of basic system utilities. Name: util-linux Version: 2.13 -Release: 0.55%{?dist} +Release: 0.54.1%{?dist} License: distributable Group: System Environment/Base @@ -788,7 +788,7 @@ exit 0 /sbin/losetup %changelog -* Mon Oct 8 2007 Karel Zak 2.13-0.55 +* Mon Oct 8 2007 Karel Zak 2.13-0.54.1 - fix #320131 - CVE-2007-5191 util-linux (u)mount doesn't drop privileges properly when calling helpers [F7] * Wed Aug 8 2007 Karel Zak 2.13-0.54 From 2bdca0356111df65515c9ffe6f4b4c4f2640a74b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 14:49:40 +0000 Subject: [PATCH 8/8] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 6 ------ branch | 1 - 3 files changed, 7 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 4ec2b9c..0000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# Makefile for source rpm: util-linux -# $Id$ -NAME := util-linux -SPECFILE = $(firstword $(wildcard *.spec)) - -include ../common/Makefile.common diff --git a/branch b/branch deleted file mode 100644 index c48525c..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-7