diff --git a/SOURCES/0180-swapon-mkswap-sync-man-page-with-upstream.patch b/SOURCES/0180-swapon-mkswap-sync-man-page-with-upstream.patch new file mode 100644 index 0000000..ba7f70b --- /dev/null +++ b/SOURCES/0180-swapon-mkswap-sync-man-page-with-upstream.patch @@ -0,0 +1,417 @@ +From ec6f608028249480bae04c062089cb9120fcd8bd Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 21 Mar 2019 13:21:54 +0100 +Subject: [PATCH 180/185] swapon, mkswap: sync man page with upstream + +Clean up all notes about swap-area restrictions (fallocate, XFS, +BTRFS, NFS, ...) + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1203378 +Signed-off-by: Karel Zak +--- + disk-utils/mkswap.8 | 42 +++++----- + sys-utils/swapon.8 | 186 ++++++++++++++++++++------------------------ + 2 files changed, 104 insertions(+), 124 deletions(-) + +diff --git a/disk-utils/mkswap.8 b/disk-utils/mkswap.8 +index 6435dd6ae..b57433388 100644 +--- a/disk-utils/mkswap.8 ++++ b/disk-utils/mkswap.8 +@@ -1,14 +1,13 @@ + .\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl) + .\" + .\" May be distributed under the GNU General Public License +-.\" Rewritten for 2.1.117, aeb, 981010. + .\" + .TH MKSWAP 8 "March 2009" "util-linux" "System Administration" + .SH NAME + mkswap \- set up a Linux swap area + .SH SYNOPSIS + .B mkswap +-.RI [ options ] ++[options] + .I device + .RI [ size ] + .SH DESCRIPTION +@@ -32,14 +31,14 @@ parameter is superfluous but retained for backwards compatibility. + (It specifies the desired size of the swap area in 1024-byte blocks. + .B mkswap + will use the entire partition or file if it is omitted. +-Specifying it is unwise -- a typo may destroy your disk.) ++Specifying it is unwise \(en a typo may destroy your disk.) + + After creating the swap area, you need the + .B swapon + command to start using it. Usually swap areas are listed in + .I /etc/fstab + so that they can be taken into use at boot time by a +-.B swapon -a ++.B swapon \-a + command in some boot script. + + .SH WARNING +@@ -54,7 +53,7 @@ like many others mkfs-like utils, + However, + .B mkswap + refuses to erase the first block on a device with a disk +-label (SUN, BSD, ...). ++label (SUN, BSD, \&...\&). + + .SH OPTIONS + .TP +@@ -103,48 +102,47 @@ Display version information and exit. + .SH NOTES + The maximum useful size of a swap area depends on the architecture and + the kernel version. +-It is roughly 2GiB on i386, PPC, m68k and ARM, 1GiB on sparc, 512MiB on mips, +-128GiB on alpha, and 3TiB on sparc64. For kernels after 2.3.3 (May 1999) there is no +-such limitation. + +-Note that before version 2.1.117 the kernel allocated one byte for each page, +-while it now allocates two bytes, so that taking into use a swap area of 2 GiB +-might require 2 MiB of kernel memory. ++The maximum number of the pages that is possible to address by swap area header ++is 4294967295 (32-bit unsigned int). The remaining space on the swap device is ignored. + +-Presently, Linux allows 32 swap areas (this was 8 before Linux 2.4.10 (Sep 2001)). ++Presently, Linux allows 32 swap areas. + The areas in use can be seen in the file + .I /proc/swaps +-(since 2.1.25 (Sep 1997)). + + .B mkswap + refuses areas smaller than 10 pages. + + If you don't know the page size that your machine uses, you may be +-able to look it up with "cat /proc/cpuinfo" (or you may not -- ++able to look it up with "cat /proc/cpuinfo" (or you may not \(en + the contents of this file depend on architecture and kernel version). + + To set up a swap file, it is necessary to create that file before + initializing it with + .BR mkswap , +-e.g. using a command like ++e.g.\& using a command like + + .nf + .RS +-# fallocate --length 8GiB swapfile ++# dd if=/dev/zero of=swapfile bs=1MiB count=$((8*1024)) + .RE + .fi + +-Note that a swap file must not contain any holes (so, using +-.BR cp (1) +-to create the file is not acceptable). ++to create 8GiB swapfile. ++ ++Please read notes from ++.BR swapon (8) ++about ++.B the swap file use restrictions ++(holes, preallocation and copy-on-write issues). + + .SH ENVIRONMENT +-.IP LIBBLKID_DEBUG=0xffff +-enables debug output. ++.IP LIBBLKID_DEBUG=all ++enables libblkid debug output. + + .SH "SEE ALSO" + .BR fdisk (8), + .BR swapon (8) + .SH AVAILABILITY + The mkswap command is part of the util-linux package and is available from +-ftp://ftp.kernel.org/pub/linux/utils/util-linux/. ++https://www.kernel.org/pub/linux/utils/util-linux/. +diff --git a/sys-utils/swapon.8 b/sys-utils/swapon.8 +index 836b17277..a45b38865 100644 +--- a/sys-utils/swapon.8 ++++ b/sys-utils/swapon.8 +@@ -31,59 +31,24 @@ + .\" + .\" @(#)swapon.8 6.3 (Berkeley) 3/16/91 + .\" +-.\" Sun Dec 27 12:31:30 1992: Modified by faith@cs.unc.edu +-.\" Sat Mar 6 20:46:02 1993: Modified by faith@cs.unc.edu +-.\" Sat Oct 9 09:35:30 1993: Converted to man format by faith@cs.unc.edu +-.\" Sat Nov 27 20:22:42 1993: Updated authorship information, faith@cs.unc.edu +-.\" Mon Sep 25 14:12:38 1995: Added -v and -p information +-.\" Tue Apr 30 03:32:07 1996: Added some text from A. Koppenhoefer +-.\" +-.TH SWAPON 8 "September 1995" "util-linux" "System Administration" ++.TH SWAPON 8 "October 2014" "util-linux" "System Administration" + .SH NAME + swapon, swapoff \- enable/disable devices and files for paging and swapping + .SH SYNOPSIS +-Get info: +-.br +-.in +5 +-.B swapon \-s +-.RB [ \-h ] +-.RB [ \-V ] +-.sp +-.in -5 +-Enable/disable: +-.br +-.in +5 + .B swapon +-.RB [ \-d ] +-.RB [ \-f ] +-.RB [ \-p +-.IR priority ] +-.RB [ \-v ] +-.IR specialfile ... ++[options] ++.RI [ specialfile ...] + .br + .B swapoff +-.RB [ \-v ] +-.IR specialfile ... +-.sp +-.in -5 +-Enable/disable all: +-.br +-.in +5 +-.B swapon \-a +-.RB [ \-e ] +-.RB [ \-f ] +-.RB [ \-v ] +-.br +-.B swapoff \-a +-.RB [ \-v ] +-.in -5 ++.RB [ \-va ] ++.RI [ specialfile ...] + .SH DESCRIPTION + .B swapon + is used to specify devices on which paging and swapping are to take place. + + The device or file used is given by the + .I specialfile +-parameter. It may be of the form ++parameter. It may be of the form + .BI \-L " label" + or + .BI \-U " uuid" +@@ -105,82 +70,85 @@ flag is given, swapping is disabled on all known swap devices and files + or + .IR /etc/fstab ). + ++.SH OPTIONS + .TP +-.B "\-a, \-\-all" ++.BR \-a , " \-\-all" + All devices marked as ``swap'' in + .I /etc/fstab + are made available, except for those with the ``noauto'' option. + Devices that are already being used as swap are silently skipped. + .TP +-.B "\-d, \-\-discard\fR [=\fIpolicy\fR]" ++.BR \-d , " \-\-discard" [ =\fIpolicy\fR] + Enable swap discards, if the swap backing device supports the discard or +-trim operation. This may improve performance on some Solid State Devices, +-but often it does not. The option allows one to select between two ++trim operation. This may improve performance on some Solid State Devices, ++but often it does not. The option allows one to select between two + available swap discard policies: +-.BI \-\-discard=once ++.B \-\-discard=once + to perform a single-time discard operation for the whole swap area at swapon; + or +-.BI \-\-discard=pages +-to discard freed swap pages before they are reused, while swapping. ++.B \-\-discard=pages ++to asynchronously discard freed swap pages before they are available for reuse. + If no policy is selected, the default behavior is to enable both discard types. + The + .I /etc/fstab + mount options +-.BI discard, +-.BI discard=once, ++.BR discard , ++.BR discard=once , + or +-.BI discard=pages +-may be also used to enable discard flags. ++.B discard=pages ++may also be used to enable discard flags. + .TP +-.B "\-e, \-\-ifexists" ++.BR \-e , " \-\-ifexists" + Silently skip devices that do not exist. + The + .I /etc/fstab + mount option +-.BI nofail +-may be also used to skip non-existing device. ++.B nofail ++may also be used to skip non-existing device. + + .TP +-.B "\-f, \-\-fixpgsz" +-Reinitialize (exec /sbin/mkswap) the swap space if its page size does not ++.BR \-f , " \-\-fixpgsz" ++Reinitialize (exec mkswap) the swap space if its page size does not + match that of the current running kernel. + .BR mkswap (2) + initializes the whole device and does not check for bad blocks. + .TP +-.B \-h, \-\-help +-Provide help. ++.BR \-h , " \-\-help" ++Display help text and exit. + .TP +-.B "\-L \fIlabel\fP" ++.BI \-L " label" + Use the partition that has the specified + .IR label . + (For this, access to + .I /proc/partitions + is needed.) + .TP +-.B "\-p, \-\-priority \fIpriority\fP" ++.BR \-p , " \-\-priority " \fIpriority\fP + Specify the priority of the swap device. + .I priority + is a value between \-1 and 32767. Higher numbers indicate + higher priority. See + .BR swapon (2) +-for a full description of swap priorities. Add ++for a full description of swap priorities. Add + .BI pri= value + to the option field of + .I /etc/fstab + for use with + .BR "swapon -a" . +-When priority is not defined it defaults to \-1. ++When no priority is defined, it defaults to \-1. + .TP +-.B "\-s, \-\-summary" +-Display swap usage summary by device. Equivalent to "cat /proc/swaps". +-Not available before Linux 2.1.25. ++.BR \-s , " \-\-summary" ++Display swap usage summary by device. Equivalent to "cat /proc/swaps". ++This output format is DEPRECATED in favour ++of \fB\-\-show\fR that provides better control on output data. + .TP +-\fB\-\-show\fR [\fIcolumn,column\fR] +-Display definable device table similar to +-.B \-\-summary +-output. See \-\-help output for +-.I column +-list. ++.BR \-\-show [ =\fIcolumn\fR ...] ++Display a definable table of swap areas. See the ++.B \-\-help ++output for a list of available columns. ++.TP ++.B \-\-output\-all ++Output all available columns. + .TP + .B \-\-noheadings + Do not print headings when displaying +@@ -195,51 +163,65 @@ output without aligning table columns. + .B \-\-bytes + Display swap size in bytes in + .B \-\-show +-output instead of user friendly size and unit. +-.B "\-U \fIuuid\fP" ++output instead of in user-friendly units. ++.TP ++.BI \-U " uuid" + Use the partition that has the specified + .IR uuid . + .TP +-.B "\-v, \-\-verbose" ++.BR \-v , " \-\-verbose" + Be verbose. + .TP +-.B "\-V, \-\-version" +-Display version. ++.BR \-V , " \-\-version" ++Display version information and exit. + .SH NOTES +-You should not use +-.B swapon +-on a file with holes. +-Swap over NFS may not work. +-.PP ++.SS Files with holes ++The swap file implementation in the kernel expects to be able to write to the ++file directly, without the assistance of the filesystem. This is a problem on ++files with holes or on copy-on-write files on filesystems like Btrfs. ++.sp ++Commands like ++.BR cp (1) ++or ++.BR truncate (1) ++create files with holes. These files will be rejected by swapon. ++.sp ++Preallocated files created by ++.BR fallocate (1) ++may be interpreted as files with holes too depending of the filesystem. ++Preallocated swap files are supported on XFS since Linux 4.18. ++.sp ++The most portable solution to create a swap file is to use ++.BR dd (1) ++and /dev/zero. ++.SS Btrfs ++Swap files on Btrfs are supported since Linux 5.0 on files with nocow attribute. ++See the ++.BR btrfs (5) ++manual page for more details. ++.SS NFS ++Swap over \fBNFS\fR may not work. ++.SS Suspend + .B swapon +-automatically detects and rewrites swap space signature with old software +-suspend data (e.g S1SUSPEND, S2SUSPEND, ...). The problem is that if we don't ++automatically detects and rewrites a swap space signature with old software ++suspend data (e.g. S1SUSPEND, S2SUSPEND, ...). The problem is that if we don't + do it, then we get data corruption the next time an attempt at unsuspending is + made. +-.PP +-.B swapon +-may not work correctly when using a swap file with some versions of btrfs. +-This is due to the swap file implementation in the kernel expecting to be able +-to write to the file directly, without the assistance of the file system. +-Since btrfs is a copy-on-write file system, the file location may not be +-static and corruption can result. Btrfs actively disallows the use of files +-on its file systems by refusing to map the file. This can be seen in the system +-log as "swapon: swapfile has holes." One possible workaround is to map the +-file to a loopback device. This will allow the file system to determine the +-mapping properly but may come with a performance impact. +- + .SH ENVIRONMENT +-.IP LIBMOUNT_DEBUG=0xffff +-enables debug output. ++.IP LIBMOUNT_DEBUG=all ++enables libmount debug output. ++.IP LIBBLKID_DEBUG=all ++enables libblkid debug output. + + .SH SEE ALSO +-.BR swapon (2), + .BR swapoff (2), ++.BR swapon (2), + .BR fstab (5), + .BR init (8), ++.BR fallocate (1), + .BR mkswap (8), +-.BR rc (8), +-.BR mount (8) ++.BR mount (8), ++.BR rc (8) + .SH FILES + .br + .I /dev/sd?? +@@ -253,4 +235,4 @@ The + command appeared in 4.0BSD. + .SH AVAILABILITY + The swapon command is part of the util-linux package and is available from +-ftp://ftp.kernel.org/pub/linux/utils/util-linux/. ++https://www.kernel.org/pub/linux/utils/util-linux/. +-- +2.20.1 + diff --git a/SOURCES/0181-libblkid-zeroize-errno-on-blkid_probe_get_buffer-suc.patch b/SOURCES/0181-libblkid-zeroize-errno-on-blkid_probe_get_buffer-suc.patch new file mode 100644 index 0000000..80fdf45 --- /dev/null +++ b/SOURCES/0181-libblkid-zeroize-errno-on-blkid_probe_get_buffer-suc.patch @@ -0,0 +1,46 @@ +From bb147e4f4008b5debde0f87282967a5e52d2d50f Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 7 Oct 2014 12:44:34 +0200 +Subject: [PATCH 181/185] libblkid: zeroize errno on blkid_probe_get_buffer() + success + +Since 37f4060225df0591ab8e1dd676dbc8115d900d4f prober functions are +sensitive to errno, it seems more robust to set errno=0 with in +blkid_probe_get_buffer() on success than set the zero on all places +where we call blkid_probe_get_buffer(). + +Addresses: https://github.com/karelzak/util-linux/issues/119 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1632944 +Upstream: http://github.com/karelzak/util-linux/commit/00749bc366fe6106df918660a92a388cfff4f35f +Signed-off-by: Karel Zak +--- + libblkid/src/probe.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c +index 07b08441f..ef0a72299 100644 +--- a/libblkid/src/probe.c ++++ b/libblkid/src/probe.c +@@ -529,8 +529,10 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr, + struct list_head *p; + struct blkid_bufinfo *bf = NULL; + +- if (pr->size <= 0) ++ if (pr->size <= 0) { ++ errno = EINVAL; + return NULL; ++ } + + if (pr->parent && + pr->parent->devno == pr->devno && +@@ -598,6 +600,7 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr, + list_add_tail(&bf->bufs, &pr->buffers); + } + ++ errno = 0; + return off ? bf->data + (off - bf->off) : bf->data; + } + +-- +2.20.1 + diff --git a/SOURCES/0182-libmount-fix-mount-a-for-cifs.patch b/SOURCES/0182-libmount-fix-mount-a-for-cifs.patch new file mode 100644 index 0000000..874b4f7 --- /dev/null +++ b/SOURCES/0182-libmount-fix-mount-a-for-cifs.patch @@ -0,0 +1,147 @@ +From 597807396a00e6f31aa03805ddca27875b81440b Mon Sep 17 00:00:00 2001 +From: Aurelien Aptel +Date: Thu, 1 Sep 2016 13:57:42 +0200 +Subject: [PATCH 182/185] libmount: fix mount -a for cifs + +when mounting a cifs share, the src is actually an UNC path which can in +in several forms: + +simple: //host/share, //host/share/ +including subpath: //host/share/sub/path + +to check if the cifs fs is mounted we have to extract the subpath and +compare *that* to the root. + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1633657 +Upstream: http://github.com/karelzak/util-linux/commit/76d4fba2e47808264f5c4c883127b0d275e31949 +Signed-off-by: Aurelien Aptel +Signed-off-by: Karel Zak +--- + include/strutils.h | 1 + + lib/strutils.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++ + libmount/src/tab.c | 29 ++++++++++++++++++++++++--- + 3 files changed, 77 insertions(+), 3 deletions(-) + +diff --git a/include/strutils.h b/include/strutils.h +index 822fb7d49..83fdc7ead 100644 +--- a/include/strutils.h ++++ b/include/strutils.h +@@ -108,6 +108,7 @@ extern int string_to_bitmask(const char *list, + extern int parse_range(const char *str, int *lower, int *upper, int def); + + extern int streq_except_trailing_slash(const char *s1, const char *s2); ++extern int streq_paths(const char *a, const char *b); + + extern char *strnappend(const char *s, const char *suffix, size_t b); + extern char *strappend(const char *s, const char *suffix); +diff --git a/lib/strutils.c b/lib/strutils.c +index 2458a2c2f..2f264daeb 100644 +--- a/lib/strutils.c ++++ b/lib/strutils.c +@@ -697,6 +697,56 @@ int streq_except_trailing_slash(const char *s1, const char *s2) + return equal; + } + ++static const char *next_path_segment(const char *str, size_t *sz) ++{ ++ const char *start, *p; ++ ++ start = str; ++ *sz = 0; ++ while (start && *start == '/' && *(start + 1) == '/') ++ start++; ++ ++ if (!start || !*start) ++ return NULL; ++ ++ for (*sz = 1, p = start + 1; *p && *p != '/'; p++) { ++ (*sz)++; ++ } ++ ++ return start; ++} ++ ++int streq_paths(const char *a, const char *b) ++{ ++ while (a && b) { ++ size_t a_sz, b_sz; ++ const char *a_seg = next_path_segment(a, &a_sz); ++ const char *b_seg = next_path_segment(b, &b_sz); ++ ++ /* ++ fprintf(stderr, "A>>>(%zu) '%s'\n", a_sz, a_seg); ++ fprintf(stderr, "B>>>(%zu) '%s'\n", b_sz, b_seg); ++ */ ++ ++ /* end of the path */ ++ if (a_sz + b_sz == 0) ++ return 1; ++ ++ /* ignore tailing slash */ ++ if (a_sz + b_sz == 1 && ++ ((a_seg && *a_seg == '/') || (b_seg && *b_seg == '/'))) ++ return 1; ++ ++ if (a_sz != b_sz || strncmp(a_seg, b_seg, a_sz) != 0) ++ return 0; ++ ++ a = a_seg + a_sz; ++ b = b_seg + b_sz; ++ }; ++ ++ return 0; ++} ++ + char *strnappend(const char *s, const char *suffix, size_t b) + { + size_t a; +diff --git a/libmount/src/tab.c b/libmount/src/tab.c +index dfa1da822..3ee9c0042 100644 +--- a/libmount/src/tab.c ++++ b/libmount/src/tab.c +@@ -1053,6 +1053,22 @@ static int is_mountinfo(struct libmnt_table *tb) + return 0; + } + ++ ++ ++static const char *get_cifs_unc_subdir_path (const char *unc) ++{ ++ /* ++ * 1 or more slash: %*[/] ++ * 1 or more non-slash: %*[^/] ++ * number of byte read: %n ++ */ ++ int share_end = 0; ++ int r = sscanf(unc, "%*[/]%*[^/]%*[/]%*[^/]%n", &share_end); ++ if (r == EOF || share_end == 0) ++ return NULL; ++ return unc + share_end; ++} ++ + /** + * mnt_table_is_mounted: + * @tb: /proc/self/mountinfo file +@@ -1150,9 +1166,16 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) + } + + if (root) { +- const char *r = mnt_fs_get_root(fs); +- if (!r || strcmp(r, root) != 0) +- continue; ++ if (strcmp(mnt_fs_get_fstype(fs), "cifs") == 0) { ++ const char *unc_subdir = get_cifs_unc_subdir_path(src); ++ const char *path_on_fs = mnt_fs_get_root(fs); ++ if (!unc_subdir || !path_on_fs || !streq_paths(unc_subdir, path_on_fs)) ++ continue; ++ } else { ++ const char *r = mnt_fs_get_root(fs); ++ if (!r || strcmp(r, root) != 0) ++ continue; ++ } + } + + /* +-- +2.20.1 + diff --git a/SOURCES/0183-agetty-fix-man-page-formatting.patch b/SOURCES/0183-agetty-fix-man-page-formatting.patch new file mode 100644 index 0000000..631f662 --- /dev/null +++ b/SOURCES/0183-agetty-fix-man-page-formatting.patch @@ -0,0 +1,27 @@ +From f4adc45048588d50115c3fad9e1ae1dee8ba205c Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 21 Mar 2019 13:45:41 +0100 +Subject: [PATCH 183/185] agetty: fix man page formatting + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1639465 +Signed-off-by: Karel Zak +--- + term-utils/agetty.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/term-utils/agetty.8 b/term-utils/agetty.8 +index fe4bfd427..5ef3815e9 100644 +--- a/term-utils/agetty.8 ++++ b/term-utils/agetty.8 +@@ -350,7 +350,7 @@ Insert the number of current users logged in. + U + Insert the string "1 user" or " users" where is the number of current + users logged in. +-.PP ++.TP + v + Insert the version of the OS, eg. the build-date etc. + .PP +-- +2.20.1 + diff --git a/SOURCES/0184-build-sys-add-missing-open_memstream-test.patch b/SOURCES/0184-build-sys-add-missing-open_memstream-test.patch new file mode 100644 index 0000000..fc4edcd --- /dev/null +++ b/SOURCES/0184-build-sys-add-missing-open_memstream-test.patch @@ -0,0 +1,26 @@ +From 43e53c69be2337b75e01919b14681e207ee05251 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 21 Mar 2019 13:54:19 +0100 +Subject: [PATCH 184/185] build-sys: add missing open_memstream() test + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1667942 +Signed-off-by: Karel Zak +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index 3f07df495..7381a9e5e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -358,6 +358,7 @@ AC_FUNC_FSEEKO + + AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no]) + AC_CHECK_FUNCS([ioperm iopl], [have_io=yes]) ++AC_CHECK_FUNCS([open_memstream], [have_open_memstream=yes],[have_open_memstream=no]) + + AC_CHECK_MEMBER(struct sockaddr.sa_len, + AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),, +-- +2.20.1 + diff --git a/SOURCES/0185-lib-canonicalize-make-DM-canonicalization-more-robus.patch b/SOURCES/0185-lib-canonicalize-make-DM-canonicalization-more-robus.patch new file mode 100644 index 0000000..7e59026 --- /dev/null +++ b/SOURCES/0185-lib-canonicalize-make-DM-canonicalization-more-robus.patch @@ -0,0 +1,97 @@ +From 36e285eb912c86b607b752964c85aa6ee4bc25ea Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 20 May 2014 10:11:57 +0200 +Subject: [PATCH 185/185] lib/canonicalize: make DM canonicalization more + robust + +The current code cares about filenames, but it's too fragile, we have +to check the path is really path to the block device. + +Addresses: https://github.com/karelzak/util-linux/issues/83 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1678451 +Upstream: http://github.com/karelzak/util-linux/commit/1dbbd85b9498536ab38758a03c9ec20362f1c572 +Signed-off-by: Karel Zak +--- + lib/canonicalize.c | 35 ++++++++++++++++++++++++++--------- + 1 file changed, 26 insertions(+), 9 deletions(-) + +diff --git a/lib/canonicalize.c b/lib/canonicalize.c +index 548e29b75..814ee3dd8 100644 +--- a/lib/canonicalize.c ++++ b/lib/canonicalize.c +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + + #include "canonicalize.h" + +@@ -170,10 +172,28 @@ canonicalize_dm_name(const char *ptname) + return res; + } + ++static int is_dm_devname(char *canonical, char **name) ++{ ++ struct stat sb; ++ char *p = strrchr(canonical, '/'); ++ ++ *name = NULL; ++ ++ if (!p ++ || strncmp(p, "/dm-", 4) != 0 ++ || !isdigit(*(p + 4)) ++ || stat(canonical, &sb) != 0 ++ || !S_ISBLK(sb.st_mode)) ++ return 0; ++ ++ *name = p + 1; ++ return 1; ++} ++ + char * + canonicalize_path(const char *path) + { +- char canonical[PATH_MAX+2]; ++ char canonical[PATH_MAX+2], *dmname; + char *p; + + if (!path || !*path) +@@ -182,10 +202,8 @@ canonicalize_path(const char *path) + if (!myrealpath(path, canonical, PATH_MAX+1)) + return strdup(path); + +- +- p = strrchr(canonical, '/'); +- if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) { +- p = canonicalize_dm_name(p+1); ++ if (is_dm_devname(canonical, &dmname)) { ++ p = canonicalize_dm_name(dmname); + if (p) + return p; + } +@@ -196,7 +214,7 @@ canonicalize_path(const char *path) + char * + canonicalize_path_restricted(const char *path) + { +- char canonical[PATH_MAX+2]; ++ char canonical[PATH_MAX+2], *dmname; + char *p = NULL; + int errsv; + uid_t euid; +@@ -215,9 +233,8 @@ canonicalize_path_restricted(const char *path) + errsv = errno = 0; + + if (myrealpath(path, canonical, PATH_MAX+1)) { +- p = strrchr(canonical, '/'); +- if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) +- p = canonicalize_dm_name(p+1); ++ if (is_dm_devname(canonical, &dmname)) ++ p = canonicalize_dm_name(dmname); + else + p = NULL; + if (!p) +-- +2.20.1 + diff --git a/SPECS/util-linux.spec b/SPECS/util-linux.spec index 974ba18..2e4b679 100644 --- a/SPECS/util-linux.spec +++ b/SPECS/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.23.2 -Release: 59%{?dist}.1 +Release: 61%{?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 @@ -436,10 +436,23 @@ Patch177: 0177-mount-append-inverting-options-for-mount.-type-on-us.patch # 1616264 - Login to emergency shell failed Patch178: 0178-sulogin-backport-RHEL-8-version.patch -# RHEL7.6.Z +# RHEL7.7 # # 1664752 - Bull (Atos) server lands up in invalid stty settings on the serial console after boot preventing login Patch179: 0179-agetty-backport-RHEL-8-version.patch +# 1203378 - Cannot use swapon with fallocated XFS swapfile +Patch180: 0180-swapon-mkswap-sync-man-page-with-upstream.patch +# 1632944 - blkid/lsblk does not recognize exfat filesystem without a label +Patch181: 0181-libblkid-zeroize-errno-on-blkid_probe_get_buffer-suc.patch +# 1633657 - mount -a always tries to mount CIFS share subdir despite being already mounted +Patch182: 0182-libmount-fix-mount-a-for-cifs.patch +# 1639465 - Bad formatting in agetty.8 man page +Patch183: 0183-agetty-fix-man-page-formatting.patch +# 1667942 - libsmartcols: scols_print_table_to_string() doesn't work +Patch184: 0184-build-sys-add-missing-open_memstream-test.patch +# 1678451 - Unable to mount to a directory that matches a dm device under /dev +Patch185: 0185-lib-canonicalize-make-DM-canonicalization-more-robus.patch + %description The util-linux package contains a large variety of low-level system @@ -1209,7 +1222,15 @@ fi %{_libdir}/pkgconfig/uuid.pc %changelog -* Thu Jan 31 2019 Karel Zak 2.23.2-59.el7_6.1 +* Fri Mar 22 2019 Karel Zak 2.23.2-61 +- #1203378 - Cannot use swapon with fallocated XFS swapfile +- #1632944 - blkid/lsblk does not recognize exfat filesystem without a label +- #1633657 - mount -a always tries to mount CIFS share subdir despite being already mounted +- #1639465 - Bad formatting in agetty.8 man page +- #1667942 - libsmartcols: scols_print_table_to_string() doesn't work +- #1678451 - Unable to mount to a directory that matches a dm device under /dev + +* Thu Jan 31 2019 Karel Zak 2.23.2-60 - fix #1664752 - Bull (Atos) server lands up in invalid stty settings on the serial console after boot preventing login * Mon Aug 20 2018 Karel Zak 2.23.2-59