From 20d9cb6488fa541376e90d425c2c72b1ad477a71 Mon Sep 17 00:00:00 2001 From: Michal Luscon Date: Thu, 1 Mar 2012 16:04:52 +0100 Subject: [PATCH 1/7] 2.21-2: fix #797216 fix #797438 canonicalize targets from fstab use mount. -s for NFS only Signed-off-by: Michal Luscon --- util-linux-2.21-canonicalize-slash.patch | 37 ++++++++++++++++ util-linux-2.21-libmount-NFS.patch | 34 +++++++++++++++ util-linux-2.21-libmount-empty.patch | 48 +++++++++++++++++++++ util-linux-2.21-libmount-fstab.patch | 27 ++++++++++++ util-linux-2.21-mount-a.patch | 55 ++++++++++++++++++++++++ util-linux.spec | 23 +++++++++- 6 files changed, 223 insertions(+), 1 deletion(-) create mode 100644 util-linux-2.21-canonicalize-slash.patch create mode 100644 util-linux-2.21-libmount-NFS.patch create mode 100644 util-linux-2.21-libmount-empty.patch create mode 100644 util-linux-2.21-libmount-fstab.patch create mode 100644 util-linux-2.21-mount-a.patch diff --git a/util-linux-2.21-canonicalize-slash.patch b/util-linux-2.21-canonicalize-slash.patch new file mode 100644 index 0000000..c14e0d0 --- /dev/null +++ b/util-linux-2.21-canonicalize-slash.patch @@ -0,0 +1,37 @@ +From 28074a0952469aebf021821d95238cfb964d13ff Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Fri, 24 Feb 2012 21:26:11 +0100 +Subject: [PATCH] lib/canonicalize: always remove tailing slash + +Signed-off-by: Karel Zak +--- + lib/canonicalize.c | 13 ++++++++++--- + 1 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/lib/canonicalize.c b/lib/canonicalize.c +index ab32c10..fd18af4 100644 +--- a/lib/canonicalize.c ++++ b/lib/canonicalize.c +@@ -174,9 +174,16 @@ canonicalize_path(const char *path) + if (path == NULL) + return NULL; + +- if (!myrealpath(path, canonical, PATH_MAX+1)) +- return strdup(path); +- ++ if (!myrealpath(path, canonical, PATH_MAX+1)) { ++ char *res = strdup(path); ++ if (res) { ++ p = strrchr(res, '/'); ++ /* delete trailing slash */ ++ if (p && p > res && *(p + 1) == '\0') ++ *p = '\0'; ++ } ++ return res; ++ } + + p = strrchr(canonical, '/'); + if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) { +-- +1.7.7.6 + diff --git a/util-linux-2.21-libmount-NFS.patch b/util-linux-2.21-libmount-NFS.patch new file mode 100644 index 0000000..346f7aa --- /dev/null +++ b/util-linux-2.21-libmount-NFS.patch @@ -0,0 +1,34 @@ +From 9bf9690114b7432144caf815e149e35640bc3ad0 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 27 Feb 2012 16:43:12 +0100 +Subject: [PATCH] libmount: use mount. -s for NFS only + +Unfortunately, it seems that for example mount.cifs don't care about +the API, so we need exception like the original mount(8). + +Signed-off-by: Karel Zak +--- + libmount/src/context_mount.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c +index 8cbc25b..a0c5951 100644 +--- a/libmount/src/context_mount.c ++++ b/libmount/src/context_mount.c +@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt) + args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */ + args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */ + +- if (mnt_context_is_sloppy(cxt)) ++ /* ++ * TODO: remove the exception for "nfs", -s is documented ++ * for years should be usable everywhere. ++ */ ++ if (mnt_context_is_sloppy(cxt) && ++ type && startswith(type, "nfs")) + args[i++] = "-s"; /* 4 */ + if (mnt_context_is_fake(cxt)) + args[i++] = "-f"; /* 5 */ +-- +1.7.7.6 + diff --git a/util-linux-2.21-libmount-empty.patch b/util-linux-2.21-libmount-empty.patch new file mode 100644 index 0000000..6b0d41d --- /dev/null +++ b/util-linux-2.21-libmount-empty.patch @@ -0,0 +1,48 @@ +From 772cce373f693096c2ae6f156306acf9e20c09e8 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 28 Feb 2012 00:02:30 +0100 +Subject: [PATCH] libmount: allow empty source for mount(2) syscall + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797438 +Signed-off-by: Karel Zak +--- + libmount/src/context_mount.c | 4 +++- + sys-utils/mount.c | 6 +++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c +index a0c5951..098243b 100644 +--- a/libmount/src/context_mount.c ++++ b/libmount/src/context_mount.c +@@ -451,8 +451,10 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type) + src = mnt_fs_get_srcpath(cxt->fs); + target = mnt_fs_get_target(cxt->fs); + +- if (!src || !target) ++ if (!target) + return -EINVAL; ++ if (!src) ++ src = "none"; + + type = try_type ? : mnt_fs_get_fstype(cxt->fs); + +diff --git a/sys-utils/mount.c b/sys-utils/mount.c +index 3fbac04..23abc91 100644 +--- a/sys-utils/mount.c ++++ b/sys-utils/mount.c +@@ -347,7 +347,11 @@ try_readonly: + return MOUNT_EX_USAGE; + } + +- if (src == NULL || tgt == NULL) { ++ /* ++ * TODO: add mnt_context_fstab_applied() to check if we found ++ * target/source in the file. ++ */ ++ if (!tgt) { + if (mflags & MS_REMOUNT) + warnx(_("%s not mounted"), src ? src : tgt); + else +-- +1.7.7.6 + diff --git a/util-linux-2.21-libmount-fstab.patch b/util-linux-2.21-libmount-fstab.patch new file mode 100644 index 0000000..05870da --- /dev/null +++ b/util-linux-2.21-libmount-fstab.patch @@ -0,0 +1,27 @@ +From 59e32a1f240c5f6a1d64d5e71a4a357245c34eaf Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Fri, 24 Feb 2012 20:25:43 +0100 +Subject: [PATCH] libmount: canonicalize all paths from (fs)tab + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797216 +Signed-off-by: Karel Zak +--- + libmount/src/tab.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libmount/src/tab.c b/libmount/src/tab.c +index 37f47bd..f10c1de 100644 +--- a/libmount/src/tab.c ++++ b/libmount/src/tab.c +@@ -456,7 +456,7 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat + while(mnt_table_next_fs(tb, &itr, &fs) == 0) { + char *p; + +- if (!fs->target || !mnt_fs_is_swaparea(fs) || ++ if (!fs->target || mnt_fs_is_swaparea(fs) || + (*fs->target == '/' && *(fs->target + 1) == '\0')) + continue; + +-- +1.7.7.6 + diff --git a/util-linux-2.21-mount-a.patch b/util-linux-2.21-mount-a.patch new file mode 100644 index 0000000..103d59b --- /dev/null +++ b/util-linux-2.21-mount-a.patch @@ -0,0 +1,55 @@ +From 6eba938376c2c870d9258ef9d7b6a3690cfa78dd Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Fri, 24 Feb 2012 22:52:45 +0100 +Subject: [PATCH] libmount: canonicalize targets from fstab on mount -a + +Signed-off-by: Karel Zak +--- + libmount/src/tab.c | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/libmount/src/tab.c b/libmount/src/tab.c +index 66a9e4d..21b05c7 100644 +--- a/libmount/src/tab.c ++++ b/libmount/src/tab.c +@@ -830,8 +830,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) + { + char *root = NULL; + struct libmnt_fs *src_fs; +- const char *src, *tgt; +- char *xsrc = NULL; ++ const char *src; ++ char *xsrc = NULL, *tgt; + int flags = 0, rc = 0; + + assert(tb); +@@ -852,7 +852,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) + src = xsrc = mnt_resolve_spec(mnt_fs_get_source(fstab_fs), + tb->cache); + +- tgt = mnt_fs_get_target(fstab_fs); ++ tgt = mnt_resolve_path(mnt_fs_get_target(fstab_fs), tb->cache); + + if (tgt && src && root) { + struct libmnt_iter itr; +@@ -870,7 +870,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) + * network filesystem source paths. + */ + if (t && s && r && +- strcmp(t, tgt) == 0 && ++ streq_except_trailing_slash(t, tgt) && + streq_except_trailing_slash(s, src) && + strcmp(r, root) == 0) + break; +@@ -881,6 +881,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) + + if (xsrc && !tb->cache) + free(xsrc); ++ if (!tb->cache) ++ free(tgt); + + free(root); + return rc; +-- +1.7.7.6 + diff --git a/util-linux.spec b/util-linux.spec index cc2fc64..cc43da2 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.21 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://kernel.org/~kzak/util-linux/ @@ -77,6 +77,16 @@ Patch3: util-linux-ng-2.21-login-lastlog.patch # 231192 - ipcs is not printing correct values on pLinux Patch4: util-linux-2.21-ipcs-32bit.patch +# 797216 - f17 cannot mount filesystem at boot time systemd refuses +Patch5: util-linux-2.21-libmount-fstab.patch +Patch6: util-linux-2.21-canonicalize-slash.patch + +Patch7: util-linux-2.21-mount-a.patch +Patch8: util-linux-2.21-libmount-NFS.patch +# 797438 - systemd always fails systemd-remount-api-vfs.service +Patch9: util-linux-2.21-libmount-empty.patch + + %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among @@ -192,6 +202,11 @@ cp %{SOURCE8} %{SOURCE9} . %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build unset LINGUAS || : @@ -707,6 +722,12 @@ fi %changelog +* Thu Mar 01 2012 Michal Luscon 2.21-2 +- fix #797216 - cannot mount filesystem at boot time systemd refuses +- fix #797438 - systemd always fails systemd-remount-api-vfs.service +- canonicalize targets from fstab on mount -a +- use mount. -s for NFS only + * Fri Feb 24 2012 Karel Zak 2.21-1 - upgrade to release 2.21 From 1fbd38ec35010f2011a37b32659f19e088f6a202 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 30 Mar 2012 13:48:09 +0200 Subject: [PATCH 2/7] 2.21.1-1: upgrade to stable release Signed-off-by: Karel Zak --- .gitignore | 1 + sources | 2 +- util-linux-2.21-canonicalize-slash.patch | 37 ---------------- util-linux-2.21-libmount-NFS.patch | 34 --------------- util-linux-2.21-libmount-empty.patch | 48 --------------------- util-linux-2.21-libmount-fstab.patch | 27 ------------ util-linux-2.21-mount-a.patch | 55 ------------------------ util-linux.spec | 22 +++------- 8 files changed, 7 insertions(+), 219 deletions(-) delete mode 100644 util-linux-2.21-canonicalize-slash.patch delete mode 100644 util-linux-2.21-libmount-NFS.patch delete mode 100644 util-linux-2.21-libmount-empty.patch delete mode 100644 util-linux-2.21-libmount-fstab.patch delete mode 100644 util-linux-2.21-mount-a.patch diff --git a/.gitignore b/.gitignore index 3e7f767..e27a90a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /util-linux-2.20.1.tar.bz2 /util-linux-2.21-rc2.tar.xz /util-linux-2.21.tar.xz +/util-linux-2.21.1.tar.xz diff --git a/sources b/sources index 75b605a..d4c2bff 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ a02aac97c74259ca1b24972c89147ca4 floppy-0.18.tar.bz2 -208aa058f4117759d2939d1be7d662fc util-linux-2.21.tar.xz +ad602dcd528f340b1329cfa6200d8f80 util-linux-2.21.1.tar.xz diff --git a/util-linux-2.21-canonicalize-slash.patch b/util-linux-2.21-canonicalize-slash.patch deleted file mode 100644 index c14e0d0..0000000 --- a/util-linux-2.21-canonicalize-slash.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 28074a0952469aebf021821d95238cfb964d13ff Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Fri, 24 Feb 2012 21:26:11 +0100 -Subject: [PATCH] lib/canonicalize: always remove tailing slash - -Signed-off-by: Karel Zak ---- - lib/canonicalize.c | 13 ++++++++++--- - 1 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/lib/canonicalize.c b/lib/canonicalize.c -index ab32c10..fd18af4 100644 ---- a/lib/canonicalize.c -+++ b/lib/canonicalize.c -@@ -174,9 +174,16 @@ canonicalize_path(const char *path) - if (path == NULL) - return NULL; - -- if (!myrealpath(path, canonical, PATH_MAX+1)) -- return strdup(path); -- -+ if (!myrealpath(path, canonical, PATH_MAX+1)) { -+ char *res = strdup(path); -+ if (res) { -+ p = strrchr(res, '/'); -+ /* delete trailing slash */ -+ if (p && p > res && *(p + 1) == '\0') -+ *p = '\0'; -+ } -+ return res; -+ } - - p = strrchr(canonical, '/'); - if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) { --- -1.7.7.6 - diff --git a/util-linux-2.21-libmount-NFS.patch b/util-linux-2.21-libmount-NFS.patch deleted file mode 100644 index 346f7aa..0000000 --- a/util-linux-2.21-libmount-NFS.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9bf9690114b7432144caf815e149e35640bc3ad0 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Mon, 27 Feb 2012 16:43:12 +0100 -Subject: [PATCH] libmount: use mount. -s for NFS only - -Unfortunately, it seems that for example mount.cifs don't care about -the API, so we need exception like the original mount(8). - -Signed-off-by: Karel Zak ---- - libmount/src/context_mount.c | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c -index 8cbc25b..a0c5951 100644 ---- a/libmount/src/context_mount.c -+++ b/libmount/src/context_mount.c -@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt) - args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */ - args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */ - -- if (mnt_context_is_sloppy(cxt)) -+ /* -+ * TODO: remove the exception for "nfs", -s is documented -+ * for years should be usable everywhere. -+ */ -+ if (mnt_context_is_sloppy(cxt) && -+ type && startswith(type, "nfs")) - args[i++] = "-s"; /* 4 */ - if (mnt_context_is_fake(cxt)) - args[i++] = "-f"; /* 5 */ --- -1.7.7.6 - diff --git a/util-linux-2.21-libmount-empty.patch b/util-linux-2.21-libmount-empty.patch deleted file mode 100644 index 6b0d41d..0000000 --- a/util-linux-2.21-libmount-empty.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 772cce373f693096c2ae6f156306acf9e20c09e8 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Tue, 28 Feb 2012 00:02:30 +0100 -Subject: [PATCH] libmount: allow empty source for mount(2) syscall - -Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797438 -Signed-off-by: Karel Zak ---- - libmount/src/context_mount.c | 4 +++- - sys-utils/mount.c | 6 +++++- - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c -index a0c5951..098243b 100644 ---- a/libmount/src/context_mount.c -+++ b/libmount/src/context_mount.c -@@ -451,8 +451,10 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type) - src = mnt_fs_get_srcpath(cxt->fs); - target = mnt_fs_get_target(cxt->fs); - -- if (!src || !target) -+ if (!target) - return -EINVAL; -+ if (!src) -+ src = "none"; - - type = try_type ? : mnt_fs_get_fstype(cxt->fs); - -diff --git a/sys-utils/mount.c b/sys-utils/mount.c -index 3fbac04..23abc91 100644 ---- a/sys-utils/mount.c -+++ b/sys-utils/mount.c -@@ -347,7 +347,11 @@ try_readonly: - return MOUNT_EX_USAGE; - } - -- if (src == NULL || tgt == NULL) { -+ /* -+ * TODO: add mnt_context_fstab_applied() to check if we found -+ * target/source in the file. -+ */ -+ if (!tgt) { - if (mflags & MS_REMOUNT) - warnx(_("%s not mounted"), src ? src : tgt); - else --- -1.7.7.6 - diff --git a/util-linux-2.21-libmount-fstab.patch b/util-linux-2.21-libmount-fstab.patch deleted file mode 100644 index 05870da..0000000 --- a/util-linux-2.21-libmount-fstab.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 59e32a1f240c5f6a1d64d5e71a4a357245c34eaf Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Fri, 24 Feb 2012 20:25:43 +0100 -Subject: [PATCH] libmount: canonicalize all paths from (fs)tab - -Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797216 -Signed-off-by: Karel Zak ---- - libmount/src/tab.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/libmount/src/tab.c b/libmount/src/tab.c -index 37f47bd..f10c1de 100644 ---- a/libmount/src/tab.c -+++ b/libmount/src/tab.c -@@ -456,7 +456,7 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat - while(mnt_table_next_fs(tb, &itr, &fs) == 0) { - char *p; - -- if (!fs->target || !mnt_fs_is_swaparea(fs) || -+ if (!fs->target || mnt_fs_is_swaparea(fs) || - (*fs->target == '/' && *(fs->target + 1) == '\0')) - continue; - --- -1.7.7.6 - diff --git a/util-linux-2.21-mount-a.patch b/util-linux-2.21-mount-a.patch deleted file mode 100644 index 103d59b..0000000 --- a/util-linux-2.21-mount-a.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 6eba938376c2c870d9258ef9d7b6a3690cfa78dd Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Fri, 24 Feb 2012 22:52:45 +0100 -Subject: [PATCH] libmount: canonicalize targets from fstab on mount -a - -Signed-off-by: Karel Zak ---- - libmount/src/tab.c | 10 ++++++---- - 1 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/libmount/src/tab.c b/libmount/src/tab.c -index 66a9e4d..21b05c7 100644 ---- a/libmount/src/tab.c -+++ b/libmount/src/tab.c -@@ -830,8 +830,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) - { - char *root = NULL; - struct libmnt_fs *src_fs; -- const char *src, *tgt; -- char *xsrc = NULL; -+ const char *src; -+ char *xsrc = NULL, *tgt; - int flags = 0, rc = 0; - - assert(tb); -@@ -852,7 +852,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) - src = xsrc = mnt_resolve_spec(mnt_fs_get_source(fstab_fs), - tb->cache); - -- tgt = mnt_fs_get_target(fstab_fs); -+ tgt = mnt_resolve_path(mnt_fs_get_target(fstab_fs), tb->cache); - - if (tgt && src && root) { - struct libmnt_iter itr; -@@ -870,7 +870,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) - * network filesystem source paths. - */ - if (t && s && r && -- strcmp(t, tgt) == 0 && -+ streq_except_trailing_slash(t, tgt) && - streq_except_trailing_slash(s, src) && - strcmp(r, root) == 0) - break; -@@ -881,6 +881,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) - - if (xsrc && !tb->cache) - free(xsrc); -+ if (!tb->cache) -+ free(tgt); - - free(root); - return rc; --- -1.7.7.6 - diff --git a/util-linux.spec b/util-linux.spec index cc43da2..38d6bca 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,8 +1,8 @@ ### Header Summary: A collection of basic system utilities Name: util-linux -Version: 2.21 -Release: 2%{?dist} +Version: 2.21.1 +Release: 1%{?dist} License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://kernel.org/~kzak/util-linux/ @@ -77,16 +77,6 @@ Patch3: util-linux-ng-2.21-login-lastlog.patch # 231192 - ipcs is not printing correct values on pLinux Patch4: util-linux-2.21-ipcs-32bit.patch -# 797216 - f17 cannot mount filesystem at boot time systemd refuses -Patch5: util-linux-2.21-libmount-fstab.patch -Patch6: util-linux-2.21-canonicalize-slash.patch - -Patch7: util-linux-2.21-mount-a.patch -Patch8: util-linux-2.21-libmount-NFS.patch -# 797438 - systemd always fails systemd-remount-api-vfs.service -Patch9: util-linux-2.21-libmount-empty.patch - - %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among @@ -202,11 +192,6 @@ cp %{SOURCE8} %{SOURCE9} . %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 %build unset LINGUAS || : @@ -722,6 +707,9 @@ fi %changelog +* Fri Mar 30 2012 Karel Zak 2.21.1-1 +- upgrade to bugfix release 2.21.1 + * Thu Mar 01 2012 Michal Luscon 2.21-2 - fix #797216 - cannot mount filesystem at boot time systemd refuses - fix #797438 - systemd always fails systemd-remount-api-vfs.service From 2093f601bb1c78c944d61cbe2774a50ad029a99b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 25 May 2012 13:27:38 +0200 Subject: [PATCH 3/7] 2.21.2-1: upgrade to bugfix release 2.21.1 - fix #814699 - namei(1) incorrectly resolves relative symlinks - fix #820707 - Impossible to unmount nfsv4/krb5 mounts after network disconnect - fix #816877 - libmount does not close device fd before mount(2) - fix #822705 - unable to login after installing Signed-off-by: Karel Zak --- .gitignore | 1 + sources | 2 +- util-linux.spec | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e27a90a..2402478 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /util-linux-2.21-rc2.tar.xz /util-linux-2.21.tar.xz /util-linux-2.21.1.tar.xz +/util-linux-2.21.2.tar.xz diff --git a/sources b/sources index d4c2bff..dee478b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ +10d940dec87902bff7e6f9f2adcd0236 util-linux-2.21.2.tar.xz a02aac97c74259ca1b24972c89147ca4 floppy-0.18.tar.bz2 -ad602dcd528f340b1329cfa6200d8f80 util-linux-2.21.1.tar.xz diff --git a/util-linux.spec b/util-linux.spec index 38d6bca..cee41ce 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,7 +1,7 @@ ### Header Summary: A collection of basic system utilities Name: util-linux -Version: 2.21.1 +Version: 2.21.2 Release: 1%{?dist} License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base @@ -707,6 +707,13 @@ fi %changelog +* Fri May 25 2012 Karel Zak 2.21.2-1 +- upgrade to bugfix release 2.21.1 +- fix #814699 - namei(1) incorrectly resolves relative symlinks +- fix #820707 - Impossible to unmount nfsv4/krb5 mounts after network disconnect +- fix #816877 - libmount does not close device fd before mount(2) +- fix #822705 - unable to login after installing + * Fri Mar 30 2012 Karel Zak 2.21.1-1 - upgrade to bugfix release 2.21.1 From caa3318d49f2fa4036fef2ba588bb961b9406ff0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 19 Jun 2012 11:46:21 +0200 Subject: [PATCH 4/7] 2.21.2-2: fix uuidd start, and mount -s Signed-off-by: Karel Zak --- util-linux-2.21-mount-sloppy.patch | 27 +++++++++++++++++++++++++++ util-linux-2.21-uuidd-rundir.patch | 26 ++++++++++++++++++++++++++ util-linux.spec | 28 ++++++++++++++++++++-------- uuidd.tmpfiles | 1 + 4 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 util-linux-2.21-mount-sloppy.patch create mode 100644 util-linux-2.21-uuidd-rundir.patch create mode 100644 uuidd.tmpfiles diff --git a/util-linux-2.21-mount-sloppy.patch b/util-linux-2.21-mount-sloppy.patch new file mode 100644 index 0000000..7b7f9b9 --- /dev/null +++ b/util-linux-2.21-mount-sloppy.patch @@ -0,0 +1,27 @@ +From e26de525e21677c680d87f63e4dafbe4859365bf Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 14 Jun 2012 14:43:21 +0200 +Subject: [PATCH] mount: (new) allow sloppy for non-root + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=825836 +Signed-off-by: Karel Zak +--- + sys-utils/mount.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/sys-utils/mount.c b/sys-utils/mount.c +index 2b8843c..9cc2db3 100644 +--- a/sys-utils/mount.c ++++ b/sys-utils/mount.c +@@ -731,7 +731,7 @@ int main(int argc, char **argv) + longopts, NULL)) != -1) { + + /* only few options are allowed for non-root users */ +- if (mnt_context_is_restricted(cxt) && !strchr("hlLUVvpri", c)) ++ if (mnt_context_is_restricted(cxt) && !strchr("hlLUVvpris", c)) + exit_non_root(option_to_longopt(c, longopts)); + + switch(c) { +-- +1.7.7.6 + diff --git a/util-linux-2.21-uuidd-rundir.patch b/util-linux-2.21-uuidd-rundir.patch new file mode 100644 index 0000000..f270b0b --- /dev/null +++ b/util-linux-2.21-uuidd-rundir.patch @@ -0,0 +1,26 @@ +From 1425948c8ceaf128c9cfcf4db680be4144f89314 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 18 Jun 2012 15:46:20 +0200 +Subject: [PATCH] uuidd: move from /var/run/uuidd to /run/uuidd + +Signed-off-by: Karel Zak +--- + libuuid/src/uuidd.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libuuid/src/uuidd.h b/libuuid/src/uuidd.h +index 27b79c2..ff7e6d7 100644 +--- a/libuuid/src/uuidd.h ++++ b/libuuid/src/uuidd.h +@@ -35,7 +35,7 @@ + #ifndef _UUID_UUIDD_H + #define _UUID_UUIDD_H + +-#define UUIDD_DIR "/var/run/uuidd" ++#define UUIDD_DIR "/run/uuidd" + #define UUIDD_SOCKET_PATH UUIDD_DIR "/request" + #define UUIDD_PIDFILE_PATH UUIDD_DIR "/uuidd.pid" + #define UUIDD_PATH "/usr/sbin/uuidd" +-- +1.7.7.6 + diff --git a/util-linux.spec b/util-linux.spec index cee41ce..88c92ea 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.21.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://kernel.org/~kzak/util-linux/ @@ -34,6 +34,7 @@ Source8: nologin.c Source9: nologin.8 Source10: uuidd.init Source11: http://downloads.sourceforge.net/floppyutil/floppy-%{floppyver}.tar.bz2 +Source12: uuidd.tmpfiles ### Obsoletes & Conflicts & Provides # old versions of e2fsprogs contain fsck, uuidgen @@ -77,6 +78,12 @@ Patch3: util-linux-ng-2.21-login-lastlog.patch # 231192 - ipcs is not printing correct values on pLinux Patch4: util-linux-2.21-ipcs-32bit.patch +### Upstream patches +### 825836 - Problems with automount map using quota +Patch5: util-linux-2.21-mount-sloppy.patch +# 826122 - uuidd fails to start +Patch6: util-linux-2.21-uuidd-rundir.patch + %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among @@ -187,11 +194,9 @@ SMP systems. %setup -q -a 11 -n %{name}-%{upstream_version} cp %{SOURCE8} %{SOURCE9} . -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 +for p in %{patches}; do + %{__patch} -p1 -F%{_default_patch_fuzz} %{_default_patch_flags} -i "$p" +done %build unset LINGUAS || : @@ -264,8 +269,10 @@ mv ${RPM_BUILD_ROOT}%{_sbindir}/raw ${RPM_BUILD_ROOT}%{_bindir}/raw # Our own initscript for uuidd install -D -m 755 %{SOURCE10} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/uuidd # And a dirs uuidd needs that the makefiles don't create -install -d ${RPM_BUILD_ROOT}/var/run/uuidd +install -d ${RPM_BUILD_ROOT}/run/uuidd install -d ${RPM_BUILD_ROOT}/var/lib/libuuid +install -d ${RPM_BUILD_ROOT}/etc/tmpfiles.d +install -m 0644 %{SOURCE12} ${RPM_BUILD_ROOT}/etc/tmpfiles.d/uuidd.conf # libtool junk rm -rf ${RPM_BUILD_ROOT}%{_libdir}/*.la @@ -651,7 +658,8 @@ fi %{_mandir}/man8/uuidd.8* %attr(-, uuidd, uuidd) %{_sbindir}/uuidd %dir %attr(2775, uuidd, uuidd) /var/lib/libuuid -%dir %attr(2775, uuidd, uuidd) /var/run/uuidd +%dir %attr(0710, uuidd, uuidd) /run/uuidd +%config(noreplace) %{_sysconfdir}/tmpfiles.d/uuidd.conf %files -n libmount @@ -707,6 +715,10 @@ fi %changelog +* Mon Jun 18 2012 Karel Zak 2.21.2-2 +- fix #825836 - Problems with automount map using quota +- fix #826122 - uuidd fails to start + * Fri May 25 2012 Karel Zak 2.21.2-1 - upgrade to bugfix release 2.21.1 - fix #814699 - namei(1) incorrectly resolves relative symlinks diff --git a/uuidd.tmpfiles b/uuidd.tmpfiles new file mode 100644 index 0000000..d1721cb --- /dev/null +++ b/uuidd.tmpfiles @@ -0,0 +1 @@ +d /run/uuidd 0710 uuidd uuidd - From dfde8dec4c175179afcb79d22c63670f2eeba0bf Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 16 Nov 2012 12:32:02 +0100 Subject: [PATCH 5/7] 2.21.2-3: #873983 #875461 Signed-off-by: Karel Zak --- util-linux-2.21-lscpu-SIGFPE.patch | 36 ++++++++++++++++++++++++++++++ util-linux-2.21-mount-commas.patch | 36 ++++++++++++++++++++++++++++++ util-linux.spec | 10 ++++++++- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 util-linux-2.21-lscpu-SIGFPE.patch create mode 100644 util-linux-2.21-mount-commas.patch diff --git a/util-linux-2.21-lscpu-SIGFPE.patch b/util-linux-2.21-lscpu-SIGFPE.patch new file mode 100644 index 0000000..6afbd01 --- /dev/null +++ b/util-linux-2.21-lscpu-SIGFPE.patch @@ -0,0 +1,36 @@ +diff -up util-linux-2.21.2/sys-utils/lscpu.c.kzak util-linux-2.21.2/sys-utils/lscpu.c +--- util-linux-2.21.2/sys-utils/lscpu.c.kzak 2012-05-25 11:44:59.041195655 +0200 ++++ util-linux-2.21.2/sys-utils/lscpu.c 2012-11-16 11:50:59.350150439 +0100 +@@ -605,16 +605,26 @@ read_topology(struct lscpu_desc *desc, i + + /* threads within one core */ + nthreads = CPU_COUNT_S(setsize, thread_siblings); ++ if (!nthreads) ++ nthreads = 1; ++ + /* cores within one socket */ + ncores = CPU_COUNT_S(setsize, core_siblings) / nthreads; +- /* number of sockets within one book. +- * Because of odd / non-present cpu maps and to keep +- * calculation easy we make sure that nsockets and +- * nbooks is at least 1. ++ if (!ncores) ++ ncores = 1; ++ ++ /* number of sockets within one book. Because of odd / ++ * non-present cpu maps and to keep calculation easy we make ++ * sure that nsockets and nbooks is at least 1. + */ +- nsockets = desc->ncpus / nthreads / ncores ?: 1; ++ nsockets = desc->ncpus / nthreads / ncores; ++ if (!nsockets) ++ nsockets = 1; ++ + /* number of books */ +- nbooks = desc->ncpus / nthreads / ncores / nsockets ?: 1; ++ nbooks = desc->ncpus / nthreads / ncores / nsockets; ++ if (!nbooks) ++ nbooks = 1; + + /* all threads, see also read_basicinfo() + * -- fallback for kernels without diff --git a/util-linux-2.21-mount-commas.patch b/util-linux-2.21-mount-commas.patch new file mode 100644 index 0000000..c7a0649 --- /dev/null +++ b/util-linux-2.21-mount-commas.patch @@ -0,0 +1,36 @@ +From 5e7b834002aa0ce97a1b0104e8710664ad954595 Mon Sep 17 00:00:00 2001 +From: Dave Reisner +Date: Sun, 3 Jun 2012 12:25:47 -0400 +Subject: [PATCH] libmount: trim leading commas from each options string + +Fixes a bug in option string parsing wherein a line such as: + + ro,relatime,,nosuid,nodev + +Will be seen as only the tokens "ro" and "relatime" after the parser +encounters a zero length (and erroneously declared NULL) option. + +Signed-off-by: Dave Reisner +--- + libmount/src/optstr.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c +index af5953b..66d2a06 100644 +--- a/libmount/src/optstr.c ++++ b/libmount/src/optstr.c +@@ -62,6 +62,11 @@ static int mnt_optstr_parse_next(char **optstr, char **name, size_t *namesz, + if (valsz) + *valsz = 0; + ++ /* trim leading commas as to not invalidate option ++ * strings with multiple consecutive commas */ ++ while (optstr0 && *optstr0 == ',') ++ optstr0++; ++ + for (p = optstr0; p && *p; p++) { + if (!start) + start = p; /* begin of the option item */ +-- +1.7.11.7 + diff --git a/util-linux.spec b/util-linux.spec index 88c92ea..064d7e3 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.21.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://kernel.org/~kzak/util-linux/ @@ -83,6 +83,10 @@ Patch4: util-linux-2.21-ipcs-32bit.patch Patch5: util-linux-2.21-mount-sloppy.patch # 826122 - uuidd fails to start Patch6: util-linux-2.21-uuidd-rundir.patch +# 873983 - mount: /dev/mapper/myvg-usrlv is already mounted or /usr busy +Patch7: util-linux-2.21-mount-commas.patch +# 875461 - read_topology: Process /usr/bin/lscpu was killed by signal 8 (SIGFPE) +Patch8: util-linux-2.21-lscpu-SIGFPE.patch %description The util-linux package contains a large variety of low-level system @@ -715,6 +719,10 @@ fi %changelog +* Fri Nov 16 2012 Karel Zak 2.21.2-3 +- fix #873983 - mount: /dev/mapper/myvg-usrlv is already mounted or /usr busy +- fix #875461 - read_topology: Process /usr/bin/lscpu was killed by signal 8 (SIGFPE) + * Mon Jun 18 2012 Karel Zak 2.21.2-2 - fix #825836 - Problems with automount map using quota - fix #826122 - uuidd fails to start From fa5b149b5d2e567dc195be5d2acf13831e81ee72 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 30 Jan 2013 17:16:53 -0500 Subject: [PATCH 6/7] _default_patch_flags is undefined in f18, makes it impossible to prep tree --- util-linux.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util-linux.spec b/util-linux.spec index 064d7e3..e6b72ef 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -199,7 +199,7 @@ SMP systems. cp %{SOURCE8} %{SOURCE9} . for p in %{patches}; do - %{__patch} -p1 -F%{_default_patch_fuzz} %{_default_patch_flags} -i "$p" + %{__patch} -p1 -F%{_default_patch_fuzz} -s -i "$p" done %build From 8027d4fd80456d570e5f4065de64cbb24f957624 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Sun, 3 Feb 2013 17:38:16 +0100 Subject: [PATCH 7/7] 2.21.2-3: #885314 #864227 Signed-off-by: Karel Zak --- ...egfault-when-iterating-over-an-empty.patch | 30 +++++++ mount-add-verbose-messages.patch | 81 +++++++++++++++++++ util-linux.spec | 11 ++- 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 hexdump-do-not-segfault-when-iterating-over-an-empty.patch create mode 100644 mount-add-verbose-messages.patch diff --git a/hexdump-do-not-segfault-when-iterating-over-an-empty.patch b/hexdump-do-not-segfault-when-iterating-over-an-empty.patch new file mode 100644 index 0000000..9aebed5 --- /dev/null +++ b/hexdump-do-not-segfault-when-iterating-over-an-empty.patch @@ -0,0 +1,30 @@ +diff --git a/text-utils/parse.c b/text-utils/parse.c +index 5f1e2bd..bd96961 100644 +--- a/text-utils/parse.c ++++ b/text-utils/parse.c +@@ -421,13 +421,15 @@ isint2: switch(fu->bcnt) { + !(fu->flags&F_SETREP) && fu->bcnt) + fu->reps += (blocksize - fs->bcnt) / fu->bcnt; + if (fu->reps > 1) { +- for (pr = fu->nextpr;; pr = pr->nextpr) +- if (!pr->nextpr) +- break; +- for (p1 = pr->fmt, p2 = NULL; *p1; ++p1) +- p2 = isspace((unsigned char)*p1) ? p1 : NULL; +- if (p2) +- pr->nospace = p2; ++ if (fu->nextpr) { ++ for (pr = fu->nextpr; ; pr = pr->nextpr) ++ if (!pr->nextpr) ++ break; ++ for (p1 = pr->fmt, p2 = NULL; *p1; ++p1) ++ p2 = isspace((unsigned char)*p1) ? p1 : NULL; ++ if (p2) ++ pr->nospace = p2; ++ } + } + } + } +-- +1.8.1 + diff --git a/mount-add-verbose-messages.patch b/mount-add-verbose-messages.patch new file mode 100644 index 0000000..8cd07f3 --- /dev/null +++ b/mount-add-verbose-messages.patch @@ -0,0 +1,81 @@ +diff -up util-linux-2.21.2/sys-utils/mount.c.orig util-linux-2.21.2/sys-utils/mount.c +--- util-linux-2.21.2/sys-utils/mount.c.orig 2013-02-03 17:33:05.248888432 +0100 ++++ util-linux-2.21.2/sys-utils/mount.c 2013-02-03 17:34:31.856571865 +0100 +@@ -238,6 +238,29 @@ static int mount_all(struct libmnt_conte + return rc; + } + ++static void success_message(struct libmnt_context *cxt) ++{ ++ unsigned long mflags = 0; ++ const char *tgt, *src; ++ ++ if (mnt_context_helper_executed(cxt) ++ || mnt_context_get_status(cxt) != 1) ++ return; ++ ++ mnt_context_get_mflags(cxt, &mflags); ++ tgt = mnt_context_get_target(cxt); ++ src = mnt_context_get_source(cxt); ++ ++ if (mflags & MS_MOVE) ++ warnx(_("%s moved to %s"), src, tgt); ++ else if (mflags & MS_BIND) ++ warnx(_("%s binded on %s"), src, tgt); ++ else if (mflags & MS_PROPAGATION) ++ warnx(_("%s propagation flags changed"), tgt); ++ else ++ warnx(_("%s mounted on %s"), src, tgt); ++} ++ + /* + * Handles generic errors like ENOMEM, ... + * +@@ -913,6 +936,8 @@ int main(int argc, char **argv) + rc = mnt_context_mount(cxt); + rc = mk_exit_code(cxt, rc); + ++ if (rc == MOUNT_EX_SUCCESS && mnt_context_is_verbose(cxt)) ++ success_message(cxt); + done: + free(srcbuf); + mnt_free_context(cxt); +diff -up util-linux-2.21.2/sys-utils/umount.c.orig util-linux-2.21.2/sys-utils/umount.c +--- util-linux-2.21.2/sys-utils/umount.c.orig 2012-05-25 11:44:59.043195664 +0200 ++++ util-linux-2.21.2/sys-utils/umount.c 2013-02-03 17:33:05.266888574 +0100 +@@ -119,6 +119,25 @@ static void __attribute__((__noreturn__) + errx(MOUNT_EX_USAGE, _("only root can do that")); + } + ++static void success_message(struct libmnt_context *cxt) ++{ ++ const char *tgt, *src; ++ ++ if (mnt_context_helper_executed(cxt) ++ || mnt_context_get_status(cxt) != 1) ++ return; ++ ++ tgt = mnt_context_get_target(cxt); ++ if (!tgt) ++ return; ++ ++ src = mnt_context_get_source(cxt); ++ if (src) ++ warnx(_("%s (%s) unmounted"), tgt, src); ++ else ++ warnx(_("%s unmounted"), tgt); ++} ++ + /* + * Handles generic errors like ENOMEM, ... + * +@@ -273,6 +292,9 @@ static int umount_one(struct libmnt_cont + rc = mnt_context_umount(cxt); + rc = mk_exit_code(cxt, rc); + ++ if (rc == MOUNT_EX_SUCCESS && mnt_context_is_verbose(cxt)) ++ success_message(cxt); ++ + mnt_reset_context(cxt); + return rc; + } diff --git a/util-linux.spec b/util-linux.spec index e6b72ef..c567318 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.21.2 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://kernel.org/~kzak/util-linux/ @@ -87,6 +87,11 @@ Patch6: util-linux-2.21-uuidd-rundir.patch Patch7: util-linux-2.21-mount-commas.patch # 875461 - read_topology: Process /usr/bin/lscpu was killed by signal 8 (SIGFPE) Patch8: util-linux-2.21-lscpu-SIGFPE.patch +# 885314 - hexdump segfault +Patch9: hexdump-do-not-segfault-when-iterating-over-an-empty.patch +# 864227 - mount option -v or --verbose does not work +Patch10: mount-add-verbose-messages.patch + %description The util-linux package contains a large variety of low-level system @@ -719,6 +724,10 @@ fi %changelog +* Sun Feb 3 2013 Karel Zak 2.21.2-4 +- fix #885314 - hexdump segfault +- fix #864227 - mount option -v or --verbose does not work + * Fri Nov 16 2012 Karel Zak 2.21.2-3 - fix #873983 - mount: /dev/mapper/myvg-usrlv is already mounted or /usr busy - fix #875461 - read_topology: Process /usr/bin/lscpu was killed by signal 8 (SIGFPE)