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 c0f296d..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: util-linux-ng -# $Id$ -NAME := util-linux-ng -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/util-linux-ng-2.14-fdisk-cylinder.patch b/util-linux-ng-2.14-fdisk-cylinder.patch new file mode 100644 index 0000000..98891f3 --- /dev/null +++ b/util-linux-ng-2.14-fdisk-cylinder.patch @@ -0,0 +1,30 @@ + + Upstream patch: + + commit 5ea8931c95b2e0b1663f28591d2c721f07a88181 + Author: Karel Zak + Date: Thu Nov 13 23:08:34 2008 +0100 + +diff -up util-linux-ng-2.14.1/fdisk/fdisk.c.kzak util-linux-ng-2.14.1/fdisk/fdisk.c +--- util-linux-ng-2.14.1/fdisk/fdisk.c.kzak 2008-11-21 14:27:19.000000000 +0100 ++++ util-linux-ng-2.14.1/fdisk/fdisk.c 2008-11-21 15:10:07.000000000 +0100 +@@ -1193,7 +1193,8 @@ read_int(unsigned int low, unsigned int + */ + if (!display_in_cyl_units) + i *= heads * sectors; +- } else if (*(line_ptr + 1) == 'B' && ++ } else if (*line_ptr && ++ *(line_ptr + 1) == 'B' && + *(line_ptr + 2) == '\0') { + /* + * 10^N +@@ -1206,7 +1207,8 @@ read_int(unsigned int low, unsigned int + absolute = 1000000000; + else + absolute = -1; +- } else if (*(line_ptr + 1) == '\0') { ++ } else if (*line_ptr && ++ *(line_ptr + 1) == '\0') { + /* + * 2^N + */ diff --git a/util-linux-ng-2.14-flock-segfault.patch b/util-linux-ng-2.14-flock-segfault.patch new file mode 100644 index 0000000..4cf9d17 --- /dev/null +++ b/util-linux-ng-2.14-flock-segfault.patch @@ -0,0 +1,34 @@ +Based on upstream patch: + + commit 841f86dbc2e35166fd43341c8eb144680b0c7ece + Author: Karel Zak + Date: Wed Mar 11 12:49:50 2009 +0100 + +diff -up util-linux-ng-2.14.1/sys-utils/flock.c.kzak util-linux-ng-2.14.1/sys-utils/flock.c +--- util-linux-ng-2.14.1/sys-utils/flock.c.kzak 2008-09-10 11:02:43.000000000 +0200 ++++ util-linux-ng-2.14.1/sys-utils/flock.c 2009-06-01 12:49:22.000000000 +0200 +@@ -213,7 +213,7 @@ int main(int argc, char *argv[]) + EX_NOINPUT); + } + +- } else { ++ } else if (optind < argc) { + /* Use provided file descriptor */ + + fd = (int)strtol(argv[optind], &eon, 10); +@@ -222,8 +222,15 @@ int main(int argc, char *argv[]) + exit(EX_USAGE); + } + ++ } else { ++ /* Bad options */ ++ ++ fprintf(stderr, "%s: requires file descriptor, file or directory\n", ++ program); ++ exit(EX_USAGE); + } + ++ + if ( have_timeout ) { + if ( timeout.it_value.tv_sec == 0 && + timeout.it_value.tv_usec == 0 ) { diff --git a/util-linux-ng-2.14-mount-canonicalize.patch b/util-linux-ng-2.14-mount-canonicalize.patch new file mode 100644 index 0000000..53c8f36 --- /dev/null +++ b/util-linux-ng-2.14-mount-canonicalize.patch @@ -0,0 +1,232 @@ + + Based on upstream patch: + + From f1b3f066f7cbeee0864317fb85e8bb622da34917 Mon Sep 17 00:00:00 2001 + From: Karel Zak + Date: Sat, 13 Dec 2008 02:47:42 +0100 + Subject: [PATCH] mount: clean up SPEC canonicalization + + The SPEC (fsname) field in fstab/mtab could be: + + - devname + - NAME=value (e.g LABEL, UUID) + - directory (MS_MOVE, MS_BIND, ..) + - pseudo-fs keyword (tmpfs, proc, sysfs, ...) + + the pseudo-fs keywords shouldn't be canonicalized to absolute path. It + means we have to differ between SPEC and mountpoint (fs_dir). + + Unfortunately, the keywords was checked on wrong place. This patch + move this check to the new function canonicalize_spec(). + + The fsname in mtab entry is canonicalized when the FS type is not + pseudo filesystem. + + Signed-off-by: Karel Zak + --- + mount/fsprobe.c | 5 +++++ + mount/fstab.c | 13 +++++++------ + mount/mount.c | 18 ++++++++++++------ + mount/realpath.c | 22 ++++++++++++++++------ + mount/realpath.h | 3 ++- + 5 files changed, 42 insertions(+), 19 deletions(-) + +diff -up util-linux-ng-2.14.1/mount/fsprobe.c.kzak util-linux-ng-2.14.1/mount/fsprobe.c +--- util-linux-ng-2.14.1/mount/fsprobe.c.kzak 2008-05-29 01:01:02.000000000 +0200 ++++ util-linux-ng-2.14.1/mount/fsprobe.c 2009-06-01 11:20:32.000000000 +0200 +@@ -170,6 +170,9 @@ fsprobe_get_devname_for_mounting(const c + if (!spec) + return NULL; + ++ if (is_pseudo_fs(spec)) ++ return xstrdup(spec); ++ + if (parse_spec(spec, &name, &value) != 0) + return NULL; /* parse error */ + +@@ -203,6 +206,8 @@ fsprobe_get_devname(const char *spec) + + if (!spec) + return NULL; ++ if (is_pseudo_fs(spec)) ++ return xstrdup(spec); + + if (parse_spec(spec, &name, &value) != 0) + return NULL; /* parse error */ +diff -up util-linux-ng-2.14.1/mount/fstab.c.kzak util-linux-ng-2.14.1/mount/fstab.c +--- util-linux-ng-2.14.1/mount/fstab.c.kzak 2008-05-29 01:01:02.000000000 +0200 ++++ util-linux-ng-2.14.1/mount/fstab.c 2009-06-01 11:20:32.000000000 +0200 +@@ -323,7 +323,7 @@ getfs_by_specdir (const char *spec, cons + for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) { + /* dir */ + if (!streq(mc->m.mnt_dir, dir)) { +- char *dr = canonicalize_mountpoint(mc->m.mnt_dir); ++ char *dr = canonicalize(mc->m.mnt_dir); + int ok = 0; + + if (streq(dr, dir)) +@@ -335,7 +335,7 @@ getfs_by_specdir (const char *spec, cons + + /* spec */ + if (!streq(mc->m.mnt_fsname, spec)) { +- char *fs = canonicalize(mc->m.mnt_fsname); ++ char *fs = canonicalize_spec(mc->m.mnt_fsname); + int ok = 0; + + if (streq(fs, spec)) +@@ -369,7 +369,7 @@ getfs_by_dir (const char *dir) { + if (streq(mc->m.mnt_dir, dir)) + return mc; + +- cdir = canonicalize_mountpoint(dir); ++ cdir = canonicalize(dir); + for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) { + if (streq(mc->m.mnt_dir, cdir)) { + free(cdir); +@@ -402,7 +402,7 @@ getfs_by_spec (const char *spec) { + return mc; + } + +- cspec = canonicalize(spec); ++ cspec = canonicalize_spec(spec); + mc = getfs_by_devname(cspec); + free(cspec); + +@@ -433,7 +433,7 @@ getfs_by_devname (const char *devname) { + strncmp(mc->m.mnt_fsname, "UUID=", 5) == 0) + continue; + +- fs = canonicalize(mc->m.mnt_fsname); ++ fs = canonicalize_spec(mc->m.mnt_fsname); + if (streq(fs, devname)) { + free(fs); + return mc; +@@ -919,7 +919,8 @@ void my_endmntent (mntFILE *mfp) { } + int my_addmntent (mntFILE *mfp, struct my_mntent *mnt) { return 0; } + + char *canonicalize (const char *path) { return NULL; } +-char *canonicalize_mountpoint (const char *path) { return NULL; } ++char *canonicalize_spec (const char *path) { return NULL; } ++int is_pseudo_fs(const char *type) { return 0; }; + + int + main(int argc, char **argv) +diff -up util-linux-ng-2.14.1/mount/mount.c.kzak util-linux-ng-2.14.1/mount/mount.c +--- util-linux-ng-2.14.1/mount/mount.c.kzak 2009-06-01 10:22:19.000000000 +0200 ++++ util-linux-ng-2.14.1/mount/mount.c 2009-06-01 11:20:32.000000000 +0200 +@@ -240,7 +240,7 @@ print_one (const struct my_mntent *me) { + printf (" type %s", me->mnt_type); + if (me->mnt_opts != NULL) + printf (" (%s)", me->mnt_opts); +- if (list_with_volumelabel) { ++ if (list_with_volumelabel && is_pseudo_fs(me->mnt_type) == 0) { + const char *devname = fsprobe_get_devname(me->mnt_fsname); + + if (devname) { +@@ -498,9 +498,11 @@ fix_opts_string (int flags, const char * + } + + static int +-already (const char *spec, const char *node) { ++already (const char *spec0, const char *node0) { + struct mntentchn *mc; + int ret = 1; ++ char *spec = canonicalize_spec(spec0); ++ char *node = canonicalize(node0); + + if ((mc = getmntfile(node)) != NULL) + error (_("mount: according to mtab, " +@@ -512,6 +514,10 @@ already (const char *spec, const char *n + spec, mc->m.mnt_dir); + else + ret = 0; ++ ++ free(spec); ++ free(node); ++ + return ret; + } + +@@ -839,7 +845,7 @@ is_mounted_same_loopfile(const char *nod + char *node; + int res = 0; + +- node = canonicalize_mountpoint(node0); ++ node = canonicalize(node0); + + /* Search for mountpoint node in mtab, + * procceed if any of these has the loop option set or +@@ -979,8 +985,8 @@ update_mtab_entry(const char *spec, cons + const char *opts, int flags, int freq, int pass) { + struct my_mntent mnt; + +- mnt.mnt_fsname = canonicalize (spec); +- mnt.mnt_dir = canonicalize_mountpoint (node); ++ mnt.mnt_fsname = is_pseudo_fs(type) ? xstrdup(spec) : canonicalize(spec); ++ mnt.mnt_dir = canonicalize (node); + mnt.mnt_type = type; + mnt.mnt_opts = opts; + mnt.mnt_freq = freq; +@@ -1496,7 +1502,7 @@ mounted (const char *spec0, const char * + if (!spec) + return ret; + +- node = canonicalize_mountpoint(node0); ++ node = canonicalize(node0); + + mc0 = mtab_head(); + for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) +diff -up util-linux-ng-2.14.1/mount/realpath.c.kzak util-linux-ng-2.14.1/mount/realpath.c +--- util-linux-ng-2.14.1/mount/realpath.c.kzak 2008-05-29 01:01:02.000000000 +0200 ++++ util-linux-ng-2.14.1/mount/realpath.c 2009-06-01 11:20:32.000000000 +0200 +@@ -29,6 +29,19 @@ + # define MAXSYMLINKS 256 + #endif + ++int ++is_pseudo_fs(const char *type) ++{ ++ if (type == NULL || *type == '/') ++ return 0; ++ if (streq(type, "none") || ++ streq(type, "proc") || ++ streq(type, "tmpfs") || ++ streq(type, "sysfs") || ++ streq(type, "devpts")) ++ return 1; ++ return 0; ++} + + /* Make a canonical pathname from PATH. Returns a freshly malloced string. + It is up the *caller* to ensure that the PATH is sensible. i.e. +@@ -36,15 +49,12 @@ + is not a legal pathname for ``/dev/fd0''. Anything we cannot parse + we return unmodified. */ + char * +-canonicalize_mountpoint (const char *path) { ++canonicalize_spec (const char *path) ++{ + if (path == NULL) + return NULL; +- +- if (streq(path, "none") || +- streq(path, "proc") || +- streq(path, "devpts")) ++ if (is_pseudo_fs(path)) + return xstrdup(path); +- + return canonicalize(path); + } + +diff -up util-linux-ng-2.14.1/mount/realpath.h.kzak util-linux-ng-2.14.1/mount/realpath.h +--- util-linux-ng-2.14.1/mount/realpath.h.kzak 2008-05-29 01:01:02.000000000 +0200 ++++ util-linux-ng-2.14.1/mount/realpath.h 2009-06-01 11:20:32.000000000 +0200 +@@ -8,6 +8,7 @@ + + extern char *myrealpath(const char *path, char *resolved_path, int m); + extern char *canonicalize (const char *path); +-extern char *canonicalize_mountpoint (const char *path); ++extern char *canonicalize_spec (const char *path); ++extern int is_pseudo_fs(const char *type); + + #endif /* REALPATH_H */ diff --git a/util-linux-ng-2.14-setterm-man-blank.patch b/util-linux-ng-2.14-setterm-man-blank.patch new file mode 100644 index 0000000..e2636ca --- /dev/null +++ b/util-linux-ng-2.14-setterm-man-blank.patch @@ -0,0 +1,37 @@ +From e273df94bab7785df778de7eaeacfa729ee7d56e Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Fri, 5 Dec 2008 11:41:28 +0100 +Subject: [PATCH] setterm: fix -blank man page + +Signed-off-by: Karel Zak +--- + misc-utils/setterm.1 | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/misc-utils/setterm.1 b/misc-utils/setterm.1 +index ec4b6a8..ed05dc1 100644 +--- a/misc-utils/setterm.1 ++++ b/misc-utils/setterm.1 +@@ -135,8 +135,8 @@ every specified number of positions. Without an argument, defaults to 8. + .TP + .BR \-blank " [0-60|force|poke] (virtual consoles only)" + Sets the interval of inactivity, in minutes, after which the screen will be +-automatically blanked (using APM if available). Without an argument, +-defaults to 0 (disable console blanking). ++automatically blanked (using APM if available). Without an argument, gets the ++blank status (returns which vt was blanked or zero for unblanked vt). + + The + .B force +@@ -144,7 +144,7 @@ option keeps screen blank even if a key is pressed. + + The + .B poke +-option returns which vt was blanked. ++option unblank the screen. + .TP + .BR \-dump " [1-NR_CONS]" + Writes a snapshot of the given virtual console (with attributes) to the file +-- +1.6.0.6 + diff --git a/util-linux-ng.spec b/util-linux-ng.spec index b7ce91c..661351c 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.14.1 -Release: 3%{?dist} +Release: 3.3%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -101,6 +101,14 @@ Patch10: util-linux-ng-2.14-blockdev-rmpart.patch Patch11: util-linux-ng-2.14-mount-file_t.patch # 465761: mount manpage is missing uid/gid mount options for tmpfs (upstream patch) Patch12: util-linux-ng-2.14-mount-man-tmpfs.patch +# 472502: Problem with fdisk and use +sectors for the end of partition (upstream patch) +Patch13: util-linux-ng-2.14-fdisk-cylinder.patch +# 489672 - flock segfaults when file name is not given +Patch14: util-linux-ng-2.14-flock-segfault.patch +# 503266 - mountpoint named tmpfs confuses the mount command +Patch15: util-linux-ng-2.14-mount-canonicalize.patch +# 474628 - setterm -blank no longer works as documented +Patch16: util-linux-ng-2.14-setterm-man-blank.patch %description The util-linux-ng package contains a large variety of low-level system @@ -124,6 +132,10 @@ cp %{SOURCE8} %{SOURCE9} . %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 %build unset LINGUAS || : @@ -239,13 +251,13 @@ rm -f $RPM_BUILD_ROOT/usr/{bin,sbin}/{fdformat,tunelp,floppy} $RPM_BUILD_ROOT%{_ # deprecated commands for I in /sbin/fsck.minix /sbin/mkfs.{bfs,minix} /sbin/sln \ /usr/bin/chkdupexe %{_bindir}/line %{_bindir}/pg %{_bindir}/newgrp \ - /sbin/shutdown %{_bindir}/scriptreplay /usr/sbin/vipw /usr/sbin/vigr; do + /sbin/shutdown /usr/sbin/vipw /usr/sbin/vigr; do rm -f $RPM_BUILD_ROOT$I done # deprecated man pages for I in man1/chkdupexe.1 man1/line.1 man1/pg.1 man1/newgrp.1 \ - man8/fsck.minix.8 man8/mkfs.minix.8 man8/mkfs.bfs.8 man1/scriptreplay.1 \ + man8/fsck.minix.8 man8/mkfs.minix.8 man8/mkfs.bfs.8 \ man8/vipw.8 man8/vigr; do rm -rf $RPM_BUILD_ROOT%{_mandir}/${I}* done @@ -425,6 +437,7 @@ exit 0 %{_bindir}/renice %{_bindir}/rev %{_bindir}/script +%{_bindir}/scriptreplay %{_bindir}/setarch %{_bindir}/setsid %{_bindir}/setterm @@ -467,6 +480,7 @@ exit 0 %{_mandir}/man1/rename.1* %{_mandir}/man1/rev.1* %{_mandir}/man1/script.1* +%{_mandir}/man1/scriptreplay.1* %{_mandir}/man1/setterm.1* %{_mandir}/man1/tailf.1* %{_mandir}/man1/ul.1* @@ -516,6 +530,17 @@ exit 0 /sbin/losetup %changelog +* Mon Jun 1 2009 Karel Zak 2.14.1-3.3 +- fix #489672 - flock segfaults when file name is not given +- fix #503266 - mountpoint named tmpfs confuses the mount command +- fix #474628 - setterm -blank no longer works as documented + +* Thu Jan 22 2009 Karel Zak 2.14.1-3.2 +- fix #480413 - util-linux-ng doesn't include scriptreplay + +* Fri Nov 21 2008 Karel Zak 2.14.1-3.1 +- fix #472502 - problem with fdisk and use +sectors for the end of partition + * Mon Oct 6 2008 Karel Zak 2.14.1-3 - fix #465761 - mount manpage is missing uid/gid mount options for tmpfs - refresh util-linux-ng-2.14-mount-file_t.patch (fuzz=0)