diff --git a/0001-libblkid-fix-NTFS-prober-on-big-endian-machines.patch b/0001-libblkid-fix-NTFS-prober-on-big-endian-machines.patch new file mode 100644 index 0000000..b469458 --- /dev/null +++ b/0001-libblkid-fix-NTFS-prober-on-big-endian-machines.patch @@ -0,0 +1,45 @@ +From 45b048b340742402695741229f01b151cce871c9 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Wed, 27 Mar 2013 11:37:57 +0100 +Subject: [PATCH] libblkid: fix NTFS prober on big-endian machines + + MFT_RECORD_ATTR_VOLUME_NAME = cpu_to_le32(0x60), + ^ +./include/bitops.h:94:36: error: braced-group within expression +allowed only inside a function + +Signed-off-by: Karel Zak +--- + libblkid/src/superblocks/ntfs.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libblkid/src/superblocks/ntfs.c b/libblkid/src/superblocks/ntfs.c +index 41c6b9c..c60a151 100644 +--- a/libblkid/src/superblocks/ntfs.c ++++ b/libblkid/src/superblocks/ntfs.c +@@ -75,8 +75,8 @@ struct file_attribute { + #define NTFS_MAX_CLUSTER_SIZE (64 * 1024) + + enum { +- MFT_RECORD_ATTR_VOLUME_NAME = cpu_to_le32(0x60), +- MFT_RECORD_ATTR_END = cpu_to_le32(0xffffffff) ++ MFT_RECORD_ATTR_VOLUME_NAME = 0x60, ++ MFT_RECORD_ATTR_END = 0xffffffff + }; + + static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag) +@@ -186,9 +186,9 @@ static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag) + if (!attr_len) + break; + +- if (attr->type == MFT_RECORD_ATTR_END) ++ if (le32_to_cpu(attr->type) == MFT_RECORD_ATTR_END) + break; +- if (attr->type == MFT_RECORD_ATTR_VOLUME_NAME) { ++ if (le32_to_cpu(attr->type) == MFT_RECORD_ATTR_VOLUME_NAME) { + unsigned int val_off = le16_to_cpu(attr->value_offset); + unsigned int val_len = le32_to_cpu(attr->value_len); + unsigned char *val = ((uint8_t *) attr) + val_off; +-- +1.8.1.4 + diff --git a/0001-libmount-fix-user-mount-by-root-for-mount.-type-help.patch b/0001-libmount-fix-user-mount-by-root-for-mount.-type-help.patch new file mode 100644 index 0000000..f6523b5 --- /dev/null +++ b/0001-libmount-fix-user-mount-by-root-for-mount.-type-help.patch @@ -0,0 +1,50 @@ +From 17206c059dc2e42e7081079b76eafda68cc9a5b8 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 26 Mar 2013 16:05:07 +0100 +Subject: [PATCH] libmount: fix user-mount by root for mount. helpers + +Append options like "exec" "suid" and "dev" to mount. helpers +command line if the options are in fstab. This is relevant for root +user who calls mount(8) for fstab entries with "user,exec" etc. + +Signed-off-by: Karel Zak +--- + libmount/src/context_mount.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c +index 00738b4..3b280ab 100644 +--- a/libmount/src/context_mount.c ++++ b/libmount/src/context_mount.c +@@ -275,6 +275,28 @@ static int generate_helper_optstr(struct libmnt_context *cxt, char **optstr) + if (!*optstr) + return -ENOMEM; + ++ if (cxt->user_mountflags & MNT_MS_USER) { ++ /* ++ * This is unnecessary for real user-mounts as mount. ++ * helpers have to always follow fstab rather than mount ++ * options on command line. ++ * ++ * But if you call mount. as root then the helper follows ++ * command line. If there is (for example) "user,exec" in fstab ++ * then we have to manually append the "exec" back to the options ++ * string, bacause there is nothing like MS_EXEC (we have only ++ * MS_NOEXEC in mount flags and we don't care about the original ++ * mount string in libmount for VFS options). ++ */ ++ if (!(cxt->mountflags & MS_NOEXEC)) ++ mnt_optstr_append_option(optstr, "exec", NULL); ++ if (!(cxt->mountflags & MS_NOSUID)) ++ mnt_optstr_append_option(optstr, "suid", NULL); ++ if (!(cxt->mountflags & MS_NODEV)) ++ mnt_optstr_append_option(optstr, "dev", NULL); ++ } ++ ++ + if (cxt->flags & MNT_FL_SAVED_USER) + rc = mnt_optstr_set_option(optstr, "user", cxt->orig_user); + if (rc) +-- +1.8.1.4 + diff --git a/0001-libmount-umount-crashes-when-trying-to-umount-a-non-.patch b/0001-libmount-umount-crashes-when-trying-to-umount-a-non-.patch new file mode 100644 index 0000000..ed498b6 --- /dev/null +++ b/0001-libmount-umount-crashes-when-trying-to-umount-a-non-.patch @@ -0,0 +1,69 @@ +From 52a285bf4e8d3a78d7211694977f5894a748bdac Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 25 Mar 2013 09:17:52 +0100 +Subject: [PATCH] libmount: umount crashes when trying to umount a + non-mountpoint +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Reported-by: Mantas Mikulėnas +Signed-off-by: Karel Zak +--- + libmount/src/context_umount.c | 4 ++-- + libmount/src/fs.c | 3 +++ + libmount/src/libmount.h.in | 2 +- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c +index 113c53e..96ae87a 100644 +--- a/libmount/src/context_umount.c ++++ b/libmount/src/context_umount.c +@@ -183,7 +183,7 @@ err: + static int lookup_umount_fs(struct libmnt_context *cxt) + { + const char *tgt; +- struct libmnt_fs *fs; ++ struct libmnt_fs *fs = NULL; + int rc; + + assert(cxt); +@@ -198,7 +198,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt) + rc = mnt_context_find_umount_fs(cxt, tgt, &fs); + if (rc < 0) + return rc; +- if (!fs) { ++ if (rc == 1 || !fs) { + DBG(CXT, mnt_debug_h(cxt, "umount: cannot find %s in mtab", tgt)); + return 0; + } +diff --git a/libmount/src/fs.c b/libmount/src/fs.c +index 96c13d3..bb9006d 100644 +--- a/libmount/src/fs.c ++++ b/libmount/src/fs.c +@@ -129,6 +129,9 @@ struct libmnt_fs *mnt_copy_fs(struct libmnt_fs *dest, + { + const struct libmnt_fs *org = dest; + ++ if (!src) ++ return NULL; ++ + if (!dest) { + dest = mnt_new_fs(); + if (!dest) +diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in +index ccd260d..bb18ba1 100644 +--- a/libmount/src/libmount.h.in ++++ b/libmount/src/libmount.h.in +@@ -318,7 +318,7 @@ extern void mnt_reset_fs(struct libmnt_fs *fs) + __ul_attribute__((nonnull)); + extern struct libmnt_fs *mnt_copy_fs(struct libmnt_fs *dest, + const struct libmnt_fs *src) +- __ul_attribute__((nonnull(2), warn_unused_result)); ++ __ul_attribute__((warn_unused_result)); + extern void *mnt_fs_get_userdata(struct libmnt_fs *fs) + __ul_attribute__((nonnull)); + extern int mnt_fs_set_userdata(struct libmnt_fs *fs, void *data); +-- +1.8.1.4 + diff --git a/util-linux.spec b/util-linux.spec index d6af783..eb49d56 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.23 -Release: 0.1%{?dist} +Release: 0.3%{?dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://en.wikipedia.org/wiki/Util-linux @@ -86,6 +86,13 @@ Patch2: util-linux-2.19-floppy-generic.patch # 151635 - makeing /var/log/lastlog Patch3: util-linux-ng-2.22-login-lastlog.patch +### Upstream patches for v2.23-rc2 +### +Patch100: 0001-libmount-fix-user-mount-by-root-for-mount.-type-help.patch +Patch101: 0001-libmount-umount-crashes-when-trying-to-umount-a-non-.patch +Patch102: 0001-libblkid-fix-NTFS-prober-on-big-endian-machines.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 @@ -745,6 +752,12 @@ fi %{_libdir}/pkgconfig/uuid.pc %changelog +* Wed Mar 27 2013 Karel Zak 2.23-0.3 +- libblkid ntfs bugfix for build on s390 + +* Wed Mar 27 2013 Karel Zak 2.23-0.2 +- add upstream patches for to fix umount and mount. + * Fri Mar 22 2013 Karel Zak 2.23-0.1 - upgrade to the release 2.22-rc1 ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.23/v2.23-ReleaseNotes