diff --git a/SOURCES/0186-libblkid-fix-file-descriptor-leak-in-blkid_verify.patch b/SOURCES/0186-libblkid-fix-file-descriptor-leak-in-blkid_verify.patch new file mode 100644 index 0000000..c4161e7 --- /dev/null +++ b/SOURCES/0186-libblkid-fix-file-descriptor-leak-in-blkid_verify.patch @@ -0,0 +1,87 @@ +From b99078ca40eb4fe9aca6f9bfbd5939cdbebd2aa4 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Wed, 31 Jul 2019 16:18:27 +0200 +Subject: [PATCH 186/189] libblkid: fix file descriptor leak in blkid_verify() + +The function blkid_verify() uses private device file descriptor and +uses blkid_probe_set_device() to assign the descriptor to low-level +probing code. Unfortunately, close() in this case is not enough as the +prober can internally open whole-disk device too. + +The library API has been extended so blkid_probe_set_device() +deallocates and close previously used prober for whole-disk. This new +functionality is used in blkid_verify() now. + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1734545 +Upstream: http://github.com/karelzak/util-linux/commit/c4d6d1c54dcd0eff701236d396d88b1fc6251768 +Signed-off-by: Karel Zak +--- + libblkid/src/probe.c | 19 ++++++++++++++++--- + libblkid/src/verify.c | 4 +++- + 2 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c +index ef0a72299..826ffa1c7 100644 +--- a/libblkid/src/probe.c ++++ b/libblkid/src/probe.c +@@ -653,10 +653,15 @@ int blkid_probe_is_cdrom(blkid_probe pr) + * @off: begin of probing area + * @size: size of probing area (zero means whole device/file) + * +- * Assigns the device to probe control struct, resets internal buffers and +- * resets the current probing. ++ * Assigns the device to probe control struct, resets internal buffers, resets ++ * the current probing, and close previously associated device (if open by ++ * libblkid). + * +- * Returns: -1 in case of failure, or 0 on success. ++ * If @fd is < 0 than only resets the prober and returns 1. Note that ++ * blkid_reset_probe() keeps the device associated with the prober, but ++ * blkid_probe_set_device() does complete reset. ++ * ++ * Returns: -1 in case of failure, 0 on success and 1 on reset. + */ + int blkid_probe_set_device(blkid_probe pr, int fd, + blkid_loff_t off, blkid_loff_t size) +@@ -672,6 +677,11 @@ int blkid_probe_set_device(blkid_probe pr, int fd, + if ((pr->flags & BLKID_FL_PRIVATE_FD) && pr->fd >= 0) + close(pr->fd); + ++ if (pr->disk_probe) { ++ blkid_free_probe(pr->disk_probe); ++ pr->disk_probe = NULL; ++ } ++ + pr->flags &= ~BLKID_FL_PRIVATE_FD; + pr->flags &= ~BLKID_FL_TINY_DEV; + pr->flags &= ~BLKID_FL_CDROM_DEV; +@@ -687,6 +697,9 @@ int blkid_probe_set_device(blkid_probe pr, int fd, + pr->wipe_size = 0; + pr->wipe_chain = NULL; + ++ if (fd < 0) ++ return 1; ++ + #if defined(POSIX_FADV_RANDOM) && defined(HAVE_POSIX_FADVISE) + /* Disable read-ahead */ + posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM); +diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c +index 2d64d97ca..d5c3592b6 100644 +--- a/libblkid/src/verify.c ++++ b/libblkid/src/verify.c +@@ -182,9 +182,11 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) + dev->bid_name, (long long)st.st_rdev, dev->bid_type)); + } + +- blkid_reset_probe(cache->probe); ++ /* reset prober */ + blkid_probe_reset_superblocks_filter(cache->probe); ++ blkid_probe_set_device(cache->probe, -1, 0, 0); + close(fd); ++ + return dev; + } + +-- +2.21.0 + diff --git a/SOURCES/0186-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch b/SOURCES/0186-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch deleted file mode 100644 index 9d04c9c..0000000 --- a/SOURCES/0186-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch +++ /dev/null @@ -1,320 +0,0 @@ -From 2f497b152a3d968addb7bc34d1a1fbdf6963bea8 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Tue, 6 Aug 2019 11:19:13 +0200 -Subject: [PATCH] misc: cleanup size_t vs. int for string_add_to_idarray() - -The newly backported utils use size_t, but the original code is still -based on int to count output columns. Let's use int everywhere.. - -Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1712768 -Signed-off-by: Karel Zak ---- - login-utils/lslogins.c | 8 ++++---- - sys-utils/lsipc.c | 20 ++++++++++---------- - sys-utils/lsmem.c | 11 +++++------ - sys-utils/lsns.c | 10 +++++----- - sys-utils/wdctl.c | 7 ++++--- - sys-utils/zramctl.c | 8 ++++---- - 6 files changed, 32 insertions(+), 32 deletions(-) - -diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c -index 041053625..33d4777e5 100644 ---- a/login-utils/lslogins.c -+++ b/login-utils/lslogins.c -@@ -438,8 +438,8 @@ static struct utmp *get_last_wtmp(struct lslogins_control *ctl, const char *user - - static int require_wtmp(void) - { -- size_t i; -- for (i = 0; i < (size_t) ncolumns; i++) -+ int i; -+ for (i = 0; i < ncolumns; i++) - if (is_wtmp_col(columns[i])) - return 1; - return 0; -@@ -447,8 +447,8 @@ static int require_wtmp(void) - - static int require_btmp(void) - { -- size_t i; -- for (i = 0; i < (size_t) ncolumns; i++) -+ int i; -+ for (i = 0; i < ncolumns; i++) - if (is_btmp_col(columns[i])) - return 1; - return 0; -diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c -index 0be9d9128..1c2c4b294 100644 ---- a/sys-utils/lsipc.c -+++ b/sys-utils/lsipc.c -@@ -194,7 +194,7 @@ static const struct lsipc_coldesc coldescs[] = - * column twice. That's enough, dynamically allocated array of the columns is - * unnecessary overkill and over-engineering in this case */ - static int columns[ARRAY_SIZE(coldescs) * 2]; --static size_t ncolumns; -+static int ncolumns; - - static inline size_t err_columns_index(size_t arysz, size_t idx) - { -@@ -358,7 +358,7 @@ static struct libscols_table *new_table(struct lsipc_control *ctl) - static struct libscols_table *setup_table(struct lsipc_control *ctl) - { - struct libscols_table *table = new_table(ctl); -- size_t n; -+ int n; - - for (n = 0; n < ncolumns; n++) { - int flags = coldescs[columns[n]].flag; -@@ -473,7 +473,7 @@ static void global_set_data(struct libscols_table *tb, const char *resource, - const char *desc, uintmax_t used, uintmax_t limit, int usage) - { - struct libscols_line *ln; -- size_t n; -+ int n; - - ln = scols_table_new_line(tb, NULL); - if (!ln) -@@ -545,7 +545,7 @@ static void do_sem(int id, struct lsipc_control *ctl, struct libscols_table *tb) - return; - } - for (semdsp = semds; semdsp->next != NULL || id > -1; semdsp = semdsp->next) { -- size_t n; -+ int n; - ln = scols_table_new_line(tb, NULL); - - for (n = 0; n < ncolumns; n++) { -@@ -732,7 +732,7 @@ static void do_msg(int id, struct lsipc_control *ctl, struct libscols_table *tb) - } - - for (msgdsp = msgds; msgdsp->next != NULL || id > -1 ; msgdsp = msgdsp->next) { -- size_t n; -+ int n; - ln = scols_table_new_line(tb, NULL); - - /* no need to call getpwuid() for the same user */ -@@ -888,7 +888,7 @@ static void do_shm(int id, struct lsipc_control *ctl, struct libscols_table *tb) - } - - for (shmdsp = shmds; shmdsp->next != NULL || id > -1 ; shmdsp = shmdsp->next) { -- size_t n; -+ int n; - ln = scols_table_new_line(tb, NULL); - if (!ln) - err_oom(); -@@ -1073,7 +1073,7 @@ int main(int argc, char *argv[]) - { - int opt, msg = 0, sem = 0, shm = 0, id = -1; - int show_time = 0, show_creat = 0, global = 0; -- size_t i; -+ int i; - struct lsipc_control *ctl = xcalloc(1, sizeof(struct lsipc_control)); - static struct libscols_table *tb; - char *outarg = NULL; -@@ -1248,7 +1248,7 @@ int main(int argc, char *argv[]) - - if (ctl->outmode == OUT_PRETTY && !(optarg || show_creat || show_time)) { - /* all columns for lsipc -- --id */ -- for (ncolumns = 0, i = 0; i < ARRAY_SIZE(coldescs); i++) -+ for (ncolumns = 0, i = 0; i < (int) ARRAY_SIZE(coldescs); i++) - columns[ncolumns++] = i; - } else { - if (show_creat) { -@@ -1264,7 +1264,7 @@ int main(int argc, char *argv[]) - } - if (shm && show_time) { - /* keep "COMMAND" as last column */ -- size_t cmd = columns[ncolumns - 1] == COL_COMMAND; -+ int cmd = columns[ncolumns - 1] == COL_COMMAND; - - if (cmd) - ncolumns--; -@@ -1280,7 +1280,7 @@ int main(int argc, char *argv[]) - } - - if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns), -- (int *) &ncolumns, column_name_to_id) < 0) -+ &ncolumns, column_name_to_id) < 0) - return EXIT_FAILURE; - - tb = setup_table(ctl); -diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c -index aaf7374fc..4f682691d 100644 ---- a/sys-utils/lsmem.c -+++ b/sys-utils/lsmem.c -@@ -138,7 +138,7 @@ static struct coldesc coldescs[] = { - * column twice. That's enough, dynamically allocated array of the columns is - * unnecessary overkill and over-engineering in this case */ - static int columns[ARRAY_SIZE(coldescs) * 2]; --static size_t ncolumns; -+static int ncolumns; - - static inline size_t err_columns_index(size_t arysz, size_t idx) - { -@@ -183,7 +183,7 @@ static int column_name_to_id(const char *name, size_t namesz) - static inline int get_column_id(int num) - { - assert(num >= 0); -- assert((size_t) num < ncolumns); -+ assert(num < ncolumns); - assert(columns[num] < (int) ARRAY_SIZE(coldescs)); - - return columns[num]; -@@ -230,7 +230,7 @@ static void set_split_policy(struct lsmem *l, int cols[], size_t ncols) - - static void add_scols_line(struct lsmem *lsmem, struct memory_block *blk) - { -- size_t i; -+ int i; - struct libscols_line *line; - - line = scols_table_new_line(lsmem->table, NULL); -@@ -523,8 +523,7 @@ int main(int argc, char **argv) - }, *lsmem = &_lsmem; - - const char *outarg = NULL, *splitarg = NULL; -- int c; -- size_t i; -+ int c, i; - - enum { - LSMEM_OPT_SUMARRY = CHAR_MAX + 1 -@@ -640,7 +639,7 @@ int main(int argc, char **argv) - } - - if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns), -- (int *) &ncolumns, column_name_to_id) < 0) -+ &ncolumns, column_name_to_id) < 0) - return EXIT_FAILURE; - - /* -diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c -index d32756508..74f04dc12 100644 ---- a/sys-utils/lsns.c -+++ b/sys-utils/lsns.c -@@ -95,7 +95,7 @@ static const struct colinfo infos[] = { - }; - - static int columns[ARRAY_SIZE(infos) * 2]; --static size_t ncolumns; -+static int ncolumns; - - enum { - LSNS_ID_MNT = 0, -@@ -193,7 +193,7 @@ static int column_name_to_id(const char *name, size_t namesz) - static inline int get_column_id(int num) - { - assert(num >= 0); -- assert((size_t) num < ncolumns); -+ assert(num < ncolumns); - assert(columns[num] < (int) ARRAY_SIZE(infos)); - - return columns[num]; -@@ -444,7 +444,7 @@ static int read_namespaces(struct lsns *ls) - static void add_scols_line(struct lsns *ls, struct libscols_table *table, - struct lsns_namespace *ns, struct lsns_process *proc) - { -- size_t i; -+ int i; - struct libscols_line *line; - - assert(ns); -@@ -504,7 +504,7 @@ static void add_scols_line(struct lsns *ls, struct libscols_table *table, - static struct libscols_table *init_scols_table(struct lsns *ls) - { - struct libscols_table *tab; -- size_t i; -+ int i; - - tab = scols_new_table(); - if (!tab) { -@@ -745,7 +745,7 @@ int main(int argc, char *argv[]) - } - - if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns), -- (int *) &ncolumns, column_name_to_id) < 0) -+ &ncolumns, column_name_to_id) < 0) - return EXIT_FAILURE; - - scols_init_debug(0); -diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c -index 24ec770fb..5e996d0ba 100644 ---- a/sys-utils/wdctl.c -+++ b/sys-utils/wdctl.c -@@ -238,7 +238,7 @@ static void add_flag_line(struct tt *tt, struct wdinfo *wd, const struct wdflag - - static int show_flags(struct wdinfo *wd, int tt_flags, uint32_t wanted) - { -- size_t i; -+ int i; - int rc = -1; - struct tt *tt; - uint32_t flags; -@@ -251,7 +251,7 @@ static int show_flags(struct wdinfo *wd, int tt_flags, uint32_t wanted) - } - - /* define columns */ -- for (i = 0; i < (size_t) ncolumns; i++) { -+ for (i = 0; i < ncolumns; i++) { - struct colinfo *col = get_column_info(i); - - if (!tt_define_column(tt, col->name, col->whint, col->flags)) { -@@ -264,7 +264,7 @@ static int show_flags(struct wdinfo *wd, int tt_flags, uint32_t wanted) - * -- one line for each supported flag (option) */ - flags = wd->ident.options; - -- for (i = 0; i < ARRAY_SIZE(wdflags); i++) { -+ for (i = 0; i < (int) ARRAY_SIZE(wdflags); i++) { - if (wanted && !(wanted & wdflags[i].flag)) - ; /* ignore */ - else if (flags & wdflags[i].flag) -@@ -513,6 +513,7 @@ int main(int argc, char *argv[]) - return EXIT_SUCCESS; - case 'h': - usage(stdout); -+ /* fallthrough */ - case 'F': - noflags = 1; - break; -diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c -index c3112d68a..3a558d150 100644 ---- a/sys-utils/zramctl.c -+++ b/sys-utils/zramctl.c -@@ -392,7 +392,7 @@ static void fill_table_row(struct libscols_table *tb, struct zram *z) - { - static struct libscols_line *ln; - struct sysfs_cxt *sysfs; -- size_t i; -+ int i; - uint64_t num; - - assert(tb); -@@ -408,7 +408,7 @@ static void fill_table_row(struct libscols_table *tb, struct zram *z) - if (!ln) - err(EXIT_FAILURE, _("failed to initialize output line")); - -- for (i = 0; i < (size_t) ncolumns; i++) { -+ for (i = 0; i < ncolumns; i++) { - char *str = NULL; - - switch (get_column_id(i)) { -@@ -479,7 +479,7 @@ static void fill_table_row(struct libscols_table *tb, struct zram *z) - static void status(struct zram *z) - { - struct libscols_table *tb; -- size_t i; -+ int i; - - scols_init_debug(0); - -@@ -490,7 +490,7 @@ static void status(struct zram *z) - scols_table_enable_raw(tb, raw); - scols_table_enable_noheadings(tb, no_headings); - -- for (i = 0; i < (size_t) ncolumns; i++) { -+ for (i = 0; i < ncolumns; i++) { - const struct colinfo *col = get_column_info(i); - - if (!scols_table_new_column(tb, col->name, col->whint, col->flags)) --- -2.21.0 - diff --git a/SOURCES/0187-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch b/SOURCES/0187-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch new file mode 100644 index 0000000..0e0b66b --- /dev/null +++ b/SOURCES/0187-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch @@ -0,0 +1,321 @@ +From 1940ca0dff25d02aee10a96282d6166fe4b03331 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 6 Aug 2019 11:19:13 +0200 +Subject: [PATCH 187/189] misc: cleanup size_t vs. int for + string_add_to_idarray() + +The newly backported utils use size_t, but the original code is still +based on int to count output columns. Let's use int everywhere.. + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1712768 +Signed-off-by: Karel Zak +--- + login-utils/lslogins.c | 8 ++++---- + sys-utils/lsipc.c | 20 ++++++++++---------- + sys-utils/lsmem.c | 11 +++++------ + sys-utils/lsns.c | 10 +++++----- + sys-utils/wdctl.c | 7 ++++--- + sys-utils/zramctl.c | 8 ++++---- + 6 files changed, 32 insertions(+), 32 deletions(-) + +diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c +index 041053625..33d4777e5 100644 +--- a/login-utils/lslogins.c ++++ b/login-utils/lslogins.c +@@ -438,8 +438,8 @@ static struct utmp *get_last_wtmp(struct lslogins_control *ctl, const char *user + + static int require_wtmp(void) + { +- size_t i; +- for (i = 0; i < (size_t) ncolumns; i++) ++ int i; ++ for (i = 0; i < ncolumns; i++) + if (is_wtmp_col(columns[i])) + return 1; + return 0; +@@ -447,8 +447,8 @@ static int require_wtmp(void) + + static int require_btmp(void) + { +- size_t i; +- for (i = 0; i < (size_t) ncolumns; i++) ++ int i; ++ for (i = 0; i < ncolumns; i++) + if (is_btmp_col(columns[i])) + return 1; + return 0; +diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c +index 0be9d9128..1c2c4b294 100644 +--- a/sys-utils/lsipc.c ++++ b/sys-utils/lsipc.c +@@ -194,7 +194,7 @@ static const struct lsipc_coldesc coldescs[] = + * column twice. That's enough, dynamically allocated array of the columns is + * unnecessary overkill and over-engineering in this case */ + static int columns[ARRAY_SIZE(coldescs) * 2]; +-static size_t ncolumns; ++static int ncolumns; + + static inline size_t err_columns_index(size_t arysz, size_t idx) + { +@@ -358,7 +358,7 @@ static struct libscols_table *new_table(struct lsipc_control *ctl) + static struct libscols_table *setup_table(struct lsipc_control *ctl) + { + struct libscols_table *table = new_table(ctl); +- size_t n; ++ int n; + + for (n = 0; n < ncolumns; n++) { + int flags = coldescs[columns[n]].flag; +@@ -473,7 +473,7 @@ static void global_set_data(struct libscols_table *tb, const char *resource, + const char *desc, uintmax_t used, uintmax_t limit, int usage) + { + struct libscols_line *ln; +- size_t n; ++ int n; + + ln = scols_table_new_line(tb, NULL); + if (!ln) +@@ -545,7 +545,7 @@ static void do_sem(int id, struct lsipc_control *ctl, struct libscols_table *tb) + return; + } + for (semdsp = semds; semdsp->next != NULL || id > -1; semdsp = semdsp->next) { +- size_t n; ++ int n; + ln = scols_table_new_line(tb, NULL); + + for (n = 0; n < ncolumns; n++) { +@@ -732,7 +732,7 @@ static void do_msg(int id, struct lsipc_control *ctl, struct libscols_table *tb) + } + + for (msgdsp = msgds; msgdsp->next != NULL || id > -1 ; msgdsp = msgdsp->next) { +- size_t n; ++ int n; + ln = scols_table_new_line(tb, NULL); + + /* no need to call getpwuid() for the same user */ +@@ -888,7 +888,7 @@ static void do_shm(int id, struct lsipc_control *ctl, struct libscols_table *tb) + } + + for (shmdsp = shmds; shmdsp->next != NULL || id > -1 ; shmdsp = shmdsp->next) { +- size_t n; ++ int n; + ln = scols_table_new_line(tb, NULL); + if (!ln) + err_oom(); +@@ -1073,7 +1073,7 @@ int main(int argc, char *argv[]) + { + int opt, msg = 0, sem = 0, shm = 0, id = -1; + int show_time = 0, show_creat = 0, global = 0; +- size_t i; ++ int i; + struct lsipc_control *ctl = xcalloc(1, sizeof(struct lsipc_control)); + static struct libscols_table *tb; + char *outarg = NULL; +@@ -1248,7 +1248,7 @@ int main(int argc, char *argv[]) + + if (ctl->outmode == OUT_PRETTY && !(optarg || show_creat || show_time)) { + /* all columns for lsipc -- --id */ +- for (ncolumns = 0, i = 0; i < ARRAY_SIZE(coldescs); i++) ++ for (ncolumns = 0, i = 0; i < (int) ARRAY_SIZE(coldescs); i++) + columns[ncolumns++] = i; + } else { + if (show_creat) { +@@ -1264,7 +1264,7 @@ int main(int argc, char *argv[]) + } + if (shm && show_time) { + /* keep "COMMAND" as last column */ +- size_t cmd = columns[ncolumns - 1] == COL_COMMAND; ++ int cmd = columns[ncolumns - 1] == COL_COMMAND; + + if (cmd) + ncolumns--; +@@ -1280,7 +1280,7 @@ int main(int argc, char *argv[]) + } + + if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns), +- (int *) &ncolumns, column_name_to_id) < 0) ++ &ncolumns, column_name_to_id) < 0) + return EXIT_FAILURE; + + tb = setup_table(ctl); +diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c +index aaf7374fc..4f682691d 100644 +--- a/sys-utils/lsmem.c ++++ b/sys-utils/lsmem.c +@@ -138,7 +138,7 @@ static struct coldesc coldescs[] = { + * column twice. That's enough, dynamically allocated array of the columns is + * unnecessary overkill and over-engineering in this case */ + static int columns[ARRAY_SIZE(coldescs) * 2]; +-static size_t ncolumns; ++static int ncolumns; + + static inline size_t err_columns_index(size_t arysz, size_t idx) + { +@@ -183,7 +183,7 @@ static int column_name_to_id(const char *name, size_t namesz) + static inline int get_column_id(int num) + { + assert(num >= 0); +- assert((size_t) num < ncolumns); ++ assert(num < ncolumns); + assert(columns[num] < (int) ARRAY_SIZE(coldescs)); + + return columns[num]; +@@ -230,7 +230,7 @@ static void set_split_policy(struct lsmem *l, int cols[], size_t ncols) + + static void add_scols_line(struct lsmem *lsmem, struct memory_block *blk) + { +- size_t i; ++ int i; + struct libscols_line *line; + + line = scols_table_new_line(lsmem->table, NULL); +@@ -523,8 +523,7 @@ int main(int argc, char **argv) + }, *lsmem = &_lsmem; + + const char *outarg = NULL, *splitarg = NULL; +- int c; +- size_t i; ++ int c, i; + + enum { + LSMEM_OPT_SUMARRY = CHAR_MAX + 1 +@@ -640,7 +639,7 @@ int main(int argc, char **argv) + } + + if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns), +- (int *) &ncolumns, column_name_to_id) < 0) ++ &ncolumns, column_name_to_id) < 0) + return EXIT_FAILURE; + + /* +diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c +index d32756508..74f04dc12 100644 +--- a/sys-utils/lsns.c ++++ b/sys-utils/lsns.c +@@ -95,7 +95,7 @@ static const struct colinfo infos[] = { + }; + + static int columns[ARRAY_SIZE(infos) * 2]; +-static size_t ncolumns; ++static int ncolumns; + + enum { + LSNS_ID_MNT = 0, +@@ -193,7 +193,7 @@ static int column_name_to_id(const char *name, size_t namesz) + static inline int get_column_id(int num) + { + assert(num >= 0); +- assert((size_t) num < ncolumns); ++ assert(num < ncolumns); + assert(columns[num] < (int) ARRAY_SIZE(infos)); + + return columns[num]; +@@ -444,7 +444,7 @@ static int read_namespaces(struct lsns *ls) + static void add_scols_line(struct lsns *ls, struct libscols_table *table, + struct lsns_namespace *ns, struct lsns_process *proc) + { +- size_t i; ++ int i; + struct libscols_line *line; + + assert(ns); +@@ -504,7 +504,7 @@ static void add_scols_line(struct lsns *ls, struct libscols_table *table, + static struct libscols_table *init_scols_table(struct lsns *ls) + { + struct libscols_table *tab; +- size_t i; ++ int i; + + tab = scols_new_table(); + if (!tab) { +@@ -745,7 +745,7 @@ int main(int argc, char *argv[]) + } + + if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns), +- (int *) &ncolumns, column_name_to_id) < 0) ++ &ncolumns, column_name_to_id) < 0) + return EXIT_FAILURE; + + scols_init_debug(0); +diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c +index 24ec770fb..5e996d0ba 100644 +--- a/sys-utils/wdctl.c ++++ b/sys-utils/wdctl.c +@@ -238,7 +238,7 @@ static void add_flag_line(struct tt *tt, struct wdinfo *wd, const struct wdflag + + static int show_flags(struct wdinfo *wd, int tt_flags, uint32_t wanted) + { +- size_t i; ++ int i; + int rc = -1; + struct tt *tt; + uint32_t flags; +@@ -251,7 +251,7 @@ static int show_flags(struct wdinfo *wd, int tt_flags, uint32_t wanted) + } + + /* define columns */ +- for (i = 0; i < (size_t) ncolumns; i++) { ++ for (i = 0; i < ncolumns; i++) { + struct colinfo *col = get_column_info(i); + + if (!tt_define_column(tt, col->name, col->whint, col->flags)) { +@@ -264,7 +264,7 @@ static int show_flags(struct wdinfo *wd, int tt_flags, uint32_t wanted) + * -- one line for each supported flag (option) */ + flags = wd->ident.options; + +- for (i = 0; i < ARRAY_SIZE(wdflags); i++) { ++ for (i = 0; i < (int) ARRAY_SIZE(wdflags); i++) { + if (wanted && !(wanted & wdflags[i].flag)) + ; /* ignore */ + else if (flags & wdflags[i].flag) +@@ -513,6 +513,7 @@ int main(int argc, char *argv[]) + return EXIT_SUCCESS; + case 'h': + usage(stdout); ++ /* fallthrough */ + case 'F': + noflags = 1; + break; +diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c +index c3112d68a..3a558d150 100644 +--- a/sys-utils/zramctl.c ++++ b/sys-utils/zramctl.c +@@ -392,7 +392,7 @@ static void fill_table_row(struct libscols_table *tb, struct zram *z) + { + static struct libscols_line *ln; + struct sysfs_cxt *sysfs; +- size_t i; ++ int i; + uint64_t num; + + assert(tb); +@@ -408,7 +408,7 @@ static void fill_table_row(struct libscols_table *tb, struct zram *z) + if (!ln) + err(EXIT_FAILURE, _("failed to initialize output line")); + +- for (i = 0; i < (size_t) ncolumns; i++) { ++ for (i = 0; i < ncolumns; i++) { + char *str = NULL; + + switch (get_column_id(i)) { +@@ -479,7 +479,7 @@ static void fill_table_row(struct libscols_table *tb, struct zram *z) + static void status(struct zram *z) + { + struct libscols_table *tb; +- size_t i; ++ int i; + + scols_init_debug(0); + +@@ -490,7 +490,7 @@ static void status(struct zram *z) + scols_table_enable_raw(tb, raw); + scols_table_enable_noheadings(tb, no_headings); + +- for (i = 0; i < (size_t) ncolumns; i++) { ++ for (i = 0; i < ncolumns; i++) { + const struct colinfo *col = get_column_info(i); + + if (!scols_table_new_column(tb, col->name, col->whint, col->flags)) +-- +2.21.0 + diff --git a/SOURCES/0188-setarch-use-personality-system-call-when-it-is-avail.patch b/SOURCES/0188-setarch-use-personality-system-call-when-it-is-avail.patch new file mode 100644 index 0000000..9b1f499 --- /dev/null +++ b/SOURCES/0188-setarch-use-personality-system-call-when-it-is-avail.patch @@ -0,0 +1,53 @@ +From bbea32299156308ba51a447dc775f320fe3c459b Mon Sep 17 00:00:00 2001 +From: Sami Kerola +Date: Sun, 7 Sep 2014 00:16:18 +0100 +Subject: [PATCH 188/189] setarch: use personality() system call when it is + available + +Signed-off-by: Sami Kerola +Signed-off-by: Karel Zak +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1690102 +Upstream: http://github.com/karelzak/util-linux/commit/9ed11cc260a28a64de0c1fa5d94d7cd6273781a5 +--- + sys-utils/setarch.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c +index b03406dd3..bcde78f4c 100644 +--- a/sys-utils/setarch.c ++++ b/sys-utils/setarch.c +@@ -24,8 +24,7 @@ + * sparc32 util by Jakub Jelinek (1998, 1999) + */ + +-#include +-#include ++#include + #include + #include + #include +@@ -37,7 +36,11 @@ + #include "c.h" + #include "closestream.h" + +-#define set_pers(pers) ((long)syscall(SYS_personality, pers)) ++#ifndef HAVE_PERSONALITY ++# include ++# define personality(pers) ((long)syscall(SYS_personality, pers)) ++#endif ++ + + /* Options without equivalent short options */ + enum { +@@ -220,7 +223,7 @@ set_arch(const char *pers, unsigned long options, int list) + errx(EXIT_FAILURE, _("%s: Unrecognized architecture"), pers); + + pers_value = transitions[i].perval | options; +- if (set_pers(pers_value) == -EINVAL) ++ if (personality(pers_value) == -EINVAL) + return 1; + + uname(&un); +-- +2.21.0 + diff --git a/SOURCES/0189-setarch-fix-personality-syscall-return-code-check.patch b/SOURCES/0189-setarch-fix-personality-syscall-return-code-check.patch new file mode 100644 index 0000000..d27aee7 --- /dev/null +++ b/SOURCES/0189-setarch-fix-personality-syscall-return-code-check.patch @@ -0,0 +1,51 @@ +From 123ac3f91e1f47108d74e5f294e0f7b6b5ba6033 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Sat, 5 Mar 2016 00:22:52 +0300 +Subject: [PATCH 189/189] setarch: fix personality syscall return code check + +Depending on architecture and kernel version, personality +syscall is either capable or incapable of returning an error. +If the return value is not an error, then it's the previous +personality value, which can be an arbitrary value +undistinguishable from an error value. +To make things clear, a second call is needed. + +For more details about personality syscall peculiarities see +https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=glibc-2.22-637-ge0043e17dfc5 + +Signed-off-by: Dmitry V. Levin +Signed-off-by: Karel Zak +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1690102 +Upstream: http://github.com/karelzak/util-linux/commit/ae7065760d9bbe776a93a73d88e85c7796acb8cc +--- + sys-utils/setarch.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c +index bcde78f4c..0e45cfef9 100644 +--- a/sys-utils/setarch.c ++++ b/sys-utils/setarch.c +@@ -223,8 +223,18 @@ set_arch(const char *pers, unsigned long options, int list) + errx(EXIT_FAILURE, _("%s: Unrecognized architecture"), pers); + + pers_value = transitions[i].perval | options; +- if (personality(pers_value) == -EINVAL) +- return 1; ++ if (personality(pers_value) < 0) { ++ /* ++ * Depending on architecture and kernel version, personality ++ * syscall is either capable or incapable of returning an error. ++ * If the return value is not an error, then it's the previous ++ * personality value, which can be an arbitrary value ++ * undistinguishable from an error value. ++ * To make things clear, a second call is needed. ++ */ ++ if (personality(pers_value) < 0) ++ return 1; ++ } + + uname(&un); + if(transitions[i].result_arch && +-- +2.21.0 + diff --git a/SOURCES/0190-build-sys-check-for-librtas.patch b/SOURCES/0190-build-sys-check-for-librtas.patch new file mode 100644 index 0000000..7b14163 --- /dev/null +++ b/SOURCES/0190-build-sys-check-for-librtas.patch @@ -0,0 +1,33 @@ +From b4861ab42477e0c4c417b53412a653d24baee482 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 6 Aug 2019 12:17:38 +0200 +Subject: [PATCH] build-sys: check for librtas + +Signed-off-by: Karel Zak +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1734261 +--- + configure.ac | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 7381a9e5e..4c5d098e6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -360,6 +360,14 @@ 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_LIB([rtas], [rtas_get_sysparm], [ ++ RTAS_LIBS="-lrtas" ++ AC_DEFINE_UNQUOTED([HAVE_LIBRTAS], [1], [Define if librtas exists]), [], ++]) ++AC_SUBST([RTAS_LIBS]) ++ ++ + AC_CHECK_MEMBER(struct sockaddr.sa_len, + AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),, + [#include +-- +2.21.0 + diff --git a/SOURCES/0191-setarch-prefer-preprocessor-rather-than-autotools-ch.patch b/SOURCES/0191-setarch-prefer-preprocessor-rather-than-autotools-ch.patch new file mode 100644 index 0000000..1ee286b --- /dev/null +++ b/SOURCES/0191-setarch-prefer-preprocessor-rather-than-autotools-ch.patch @@ -0,0 +1,101 @@ +From e08af84191b2a8ca226e1c72c27c63dcf8ac8c27 Mon Sep 17 00:00:00 2001 +From: Sami Kerola +Date: Sun, 28 Jul 2013 22:11:16 +0100 +Subject: [PATCH] setarch: prefer preprocessor rather than autotools check + +It seems to be pointless to spend time in ./configure phase when +preprocessor has to perform #ifndef check anyway. + +[kzak@redhat.com: - + Note that on RHEL-7 glibc' does not contain the + same set of the flags like . We need to include + glibc version dues to syscall, so it seems better make our macro + fallbacks more robust.] + +Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1690102 +Upstream: http://github.com/karelzak/util-linux/commit/f29a3d1868c847ae41bc681db58bd087fc9f941d +Signed-off-by: Sami Kerola +--- + configure.ac | 12 ------------ + sys-utils/setarch.c | 22 +++++++++++----------- + 2 files changed, 11 insertions(+), 23 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 4c5d098e6..49de6c6b3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -260,18 +260,6 @@ AC_CHECK_MEMBERS([struct termios.c_line],,, + AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,, + [#include ]) + +-AC_CHECK_DECLS([ +- UNAME26, +- ADDR_NO_RANDOMIZE, +- FDPIC_FUNCPTRS, +- MMAP_PAGE_ZERO, +- ADDR_COMPAT_LAYOUT, +- READ_IMPLIES_EXEC, +- ADDR_LIMIT_32BIT, +- WHOLE_SECONDS, +- STICKY_TIMEOUTS, +- ADDR_LIMIT_3GB], [], [], [#include ]) +- + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ + #ifdef HAVE_SYS_SWAP_H +diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c +index 0e45cfef9..9863cb298 100644 +--- a/sys-utils/setarch.c ++++ b/sys-utils/setarch.c +@@ -56,37 +56,37 @@ enum { + } while(0) + + +-#if !HAVE_DECL_UNAME26 ++#ifndef UNAME26 + # define UNAME26 0x0020000 + #endif +-#if !HAVE_DECL_ADDR_NO_RANDOMIZE ++#ifndef ADDR_NO_RANDOMIZE + # define ADDR_NO_RANDOMIZE 0x0040000 + #endif +-#if !HAVE_DECL_FDPIC_FUNCPTRS ++#ifndef FDPIC_FUNCPTRS + # define FDPIC_FUNCPTRS 0x0080000 + #endif +-#if !HAVE_DECL_MMAP_PAGE_ZERO ++#ifndef MMAP_PAGE_ZERO + # define MMAP_PAGE_ZERO 0x0100000 + #endif +-#if !HAVE_DECL_ADDR_COMPAT_LAYOUT ++#ifndef ADDR_COMPAT_LAYOUT + # define ADDR_COMPAT_LAYOUT 0x0200000 + #endif +-#if !HAVE_DECL_READ_IMPLIES_EXEC ++#ifndef READ_IMPLIES_EXEC + # define READ_IMPLIES_EXEC 0x0400000 + #endif +-#if !HAVE_DECL_ADDR_LIMIT_32BIT ++#ifndef ADDR_LIMIT_32BIT + # define ADDR_LIMIT_32BIT 0x0800000 + #endif +-#if !HAVE_DECL_SHORT_INODE ++#ifndef SHORT_INODE + # define SHORT_INODE 0x1000000 + #endif +-#if !HAVE_DECL_WHOLE_SECONDS ++#ifndef WHOLE_SECONDS + # define WHOLE_SECONDS 0x2000000 + #endif +-#if !HAVE_DECL_STICKY_TIMEOUTS ++#ifndef STICKY_TIMEOUTS + # define STICKY_TIMEOUTS 0x4000000 + #endif +-#if !HAVE_DECL_ADDR_LIMIT_3GB ++#ifndef ADDR_LIMIT_3GB + # define ADDR_LIMIT_3GB 0x8000000 + #endif + +-- +2.21.0 + diff --git a/SOURCES/0192-libmount-Preserve-empty-string-value-in-optstr-parsi.patch b/SOURCES/0192-libmount-Preserve-empty-string-value-in-optstr-parsi.patch new file mode 100644 index 0000000..af16b0a --- /dev/null +++ b/SOURCES/0192-libmount-Preserve-empty-string-value-in-optstr-parsi.patch @@ -0,0 +1,207 @@ +From c0f53628926e9fe8956ea276e30d98817d8cbcd4 Mon Sep 17 00:00:00 2001 +From: Filipe Brandenburger +Date: Wed, 10 Aug 2016 13:27:07 -0700 +Subject: [PATCH] libmount: Preserve empty string value in optstr parsing + +Recent mount (since the switch to libmount in v2.22) drops the '=' in +mount options that are set to an empty value. For example, the command +line below will be affected: + + # mount -o rw,myopt='' -t tmpfs tmpfs /mnt/tmp + +Fix that by preserving an empty string in the options passed to the +mount(2) syscall when they are present on the command line. + +Add test cases to ensure empty string handling is working as expected +and in order to prevent regressions in the future. + +Also tested manually by stracing mount commands (on a kernel which +accepts a special extra option, for testing purposes.) + +Before this commit: + + # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp + mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myarg") = -1 EINVAL (Invalid argument) + +After this commit: + + # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp + mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myopt=") = 0 + +All test cases pass, including newly added test cases. Also checked +them with valgrind using: + + $ tests/run.sh --memcheck libmount/optstr + +Fixes #332. + +Signed-off-by: Filipe Brandenburger +Signed-off-by: Karel Zak +Upstream: http://github.com/karelzak/util-linux/commit/727c689908c5e68c92aa1dd65e0d3bdb6d91c1e5 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1740572 +--- + libmount/src/optstr.c | 4 +-- + .../libmount/optstr-append-empty-value | 1 + + .../libmount/optstr-deduplicate-empty | 1 + + .../libmount/optstr-prepend-empty-value | 1 + + .../libmount/optstr-remove-empty-value | 1 + + tests/expected/libmount/optstr-set-empty | 1 + + tests/expected/libmount/optstr-set-new-empty | 1 + + .../libmount/optstr-set-new-end-empty | 1 + + tests/ts/libmount/optstr | 28 +++++++++++++++++++ + 9 files changed, 37 insertions(+), 2 deletions(-) + create mode 100644 tests/expected/libmount/optstr-append-empty-value + create mode 100644 tests/expected/libmount/optstr-deduplicate-empty + create mode 100644 tests/expected/libmount/optstr-prepend-empty-value + create mode 100644 tests/expected/libmount/optstr-remove-empty-value + create mode 100644 tests/expected/libmount/optstr-set-empty + create mode 100644 tests/expected/libmount/optstr-set-new-empty + create mode 100644 tests/expected/libmount/optstr-set-new-end-empty + +diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c +index 3c680ff6e..7bd9bbdb5 100644 +--- a/libmount/src/optstr.c ++++ b/libmount/src/optstr.c +@@ -186,7 +186,7 @@ static int __mnt_optstr_append_option(char **optstr, + sz = osz + nsz + 1; /* 1: '\0' */ + if (osz) + sz++; /* ',' options separator */ +- if (vsz) ++ if (value) + sz += vsz + 1; /* 1: '=' */ + + p = realloc(*optstr, sz); +@@ -202,7 +202,7 @@ static int __mnt_optstr_append_option(char **optstr, + memcpy(p, name, nsz); + p += nsz; + +- if (vsz) { ++ if (value) { + *p++ = '='; + memcpy(p, value, vsz); + p += vsz; +diff --git a/tests/expected/libmount/optstr-append-empty-value b/tests/expected/libmount/optstr-append-empty-value +new file mode 100644 +index 000000000..35adf5c72 +--- /dev/null ++++ b/tests/expected/libmount/optstr-append-empty-value +@@ -0,0 +1 @@ ++result: >aaa,bbb=BBB,ccc,ddd=< +diff --git a/tests/expected/libmount/optstr-deduplicate-empty b/tests/expected/libmount/optstr-deduplicate-empty +new file mode 100644 +index 000000000..63b74f678 +--- /dev/null ++++ b/tests/expected/libmount/optstr-deduplicate-empty +@@ -0,0 +1 @@ ++result: >bbb,ccc,xxx,ddd,AAA=,fff=eee< +diff --git a/tests/expected/libmount/optstr-prepend-empty-value b/tests/expected/libmount/optstr-prepend-empty-value +new file mode 100644 +index 000000000..4cea63527 +--- /dev/null ++++ b/tests/expected/libmount/optstr-prepend-empty-value +@@ -0,0 +1 @@ ++result: >ddd=,aaa,bbb=BBB,ccc< +diff --git a/tests/expected/libmount/optstr-remove-empty-value b/tests/expected/libmount/optstr-remove-empty-value +new file mode 100644 +index 000000000..eee5c95b9 +--- /dev/null ++++ b/tests/expected/libmount/optstr-remove-empty-value +@@ -0,0 +1 @@ ++result: >aaa,ccc< +diff --git a/tests/expected/libmount/optstr-set-empty b/tests/expected/libmount/optstr-set-empty +new file mode 100644 +index 000000000..e0a3300f9 +--- /dev/null ++++ b/tests/expected/libmount/optstr-set-empty +@@ -0,0 +1 @@ ++result: >aaa,bbb=,ccc< +diff --git a/tests/expected/libmount/optstr-set-new-empty b/tests/expected/libmount/optstr-set-new-empty +new file mode 100644 +index 000000000..a1cfb3721 +--- /dev/null ++++ b/tests/expected/libmount/optstr-set-new-empty +@@ -0,0 +1 @@ ++result: >aaa=,bbb=BBB,ccc< +diff --git a/tests/expected/libmount/optstr-set-new-end-empty b/tests/expected/libmount/optstr-set-new-end-empty +new file mode 100644 +index 000000000..d0e9880f3 +--- /dev/null ++++ b/tests/expected/libmount/optstr-set-new-end-empty +@@ -0,0 +1 @@ ++result: >aaa,bbb=BBB,ccc=< +diff --git a/tests/ts/libmount/optstr b/tests/ts/libmount/optstr +index f6a5c0530..07a548963 100755 +--- a/tests/ts/libmount/optstr ++++ b/tests/ts/libmount/optstr +@@ -20,6 +20,10 @@ ts_init_subtest "append-value" + ts_valgrind $TESTPROG --append "aaa,bbb=BBB,ccc" "ddd" "DDD" &> $TS_OUTPUT + ts_finalize_subtest + ++ts_init_subtest "append-empty-value" ++ts_valgrind $TESTPROG --append "aaa,bbb=BBB,ccc" "ddd" "" &> $TS_OUTPUT ++ts_finalize_subtest ++ + ts_init_subtest "prepend" + ts_valgrind $TESTPROG --prepend "aaa,bbb=BBB,ccc" "ddd" &> $TS_OUTPUT + ts_finalize_subtest +@@ -28,6 +32,10 @@ ts_init_subtest "prepend-value" + ts_valgrind $TESTPROG --prepend "aaa,bbb=BBB,ccc" "ddd" "DDD" &> $TS_OUTPUT + ts_finalize_subtest + ++ts_init_subtest "prepend-empty-value" ++ts_valgrind $TESTPROG --prepend "aaa,bbb=BBB,ccc" "ddd" "" &> $TS_OUTPUT ++ts_finalize_subtest ++ + ts_init_subtest "set-remove" + ts_valgrind $TESTPROG --set "aaa,bbb=BBB,ccc" "bbb" &> $TS_OUTPUT + ts_finalize_subtest +@@ -40,14 +48,26 @@ ts_init_subtest "set-large" + ts_valgrind $TESTPROG --set "aaa,bbb=BBB,ccc" "bbb" "XXX-YYY-ZZZ" &> $TS_OUTPUT + ts_finalize_subtest + ++ts_init_subtest "set-empty" ++ts_valgrind $TESTPROG --set "aaa,bbb=BBB,ccc" "bbb" "" &> $TS_OUTPUT ++ts_finalize_subtest ++ + ts_init_subtest "set-new" + ts_valgrind $TESTPROG --set "aaa,bbb=BBB,ccc" "aaa" "XXX" &> $TS_OUTPUT + ts_finalize_subtest + ++ts_init_subtest "set-new-empty" ++ts_valgrind $TESTPROG --set "aaa,bbb=BBB,ccc" "aaa" "" &> $TS_OUTPUT ++ts_finalize_subtest ++ + ts_init_subtest "set-new-end" + ts_valgrind $TESTPROG --set "aaa,bbb=BBB,ccc" "ccc" "XXX" &> $TS_OUTPUT + ts_finalize_subtest + ++ts_init_subtest "set-new-end-empty" ++ts_valgrind $TESTPROG --set "aaa,bbb=BBB,ccc" "ccc" "" &> $TS_OUTPUT ++ts_finalize_subtest ++ + ts_init_subtest "get" + ts_valgrind $TESTPROG --get "aaa,bbb=BBB,ccc" "aaa" &> $TS_OUTPUT + ts_finalize_subtest +@@ -68,6 +88,10 @@ ts_init_subtest "remove-value" + ts_valgrind $TESTPROG --remove "aaa,bbb=BBB,ccc" "bbb" &> $TS_OUTPUT + ts_finalize_subtest + ++ts_init_subtest "remove-empty-value" ++ts_valgrind $TESTPROG --remove "aaa,bbb=,ccc" "bbb" &> $TS_OUTPUT ++ts_finalize_subtest ++ + ts_init_subtest "split" + ts_valgrind $TESTPROG --split "aaa,bbb=BBB,ccc,x-bar,x-foo=foodata,user=kzak,noexec,nosuid,loop=/dev/loop0" &> $TS_OUTPUT + ts_finalize_subtest +@@ -92,4 +116,8 @@ ts_init_subtest "deduplicate" + ts_valgrind $TESTPROG --dedup bbb,ccc,AAA,xxx,AAA=a,AAA=bbb,ddd,AAA=ccc,fff=eee AAA &> $TS_OUTPUT + ts_finalize_subtest + ++ts_init_subtest "deduplicate-empty" ++ts_valgrind $TESTPROG --dedup bbb,ccc,AAA,xxx,AAA=a,AAA=bbb,ddd,AAA=,fff=eee AAA &> $TS_OUTPUT ++ts_finalize_subtest ++ + ts_finalize +-- +2.21.0 + diff --git a/SPECS/util-linux.spec b/SPECS/util-linux.spec index 2f17c4d..761ccf3 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: 61%{?dist}.1 +Release: 63%{?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 @@ -28,6 +28,9 @@ BuildRequires: libcap-ng-devel BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool +%ifarch ppc64le +BuildRequires: librtas-devel +%endif ### Sources Source0: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.23/util-linux-%{upstream_version}.tar.xz @@ -453,10 +456,21 @@ 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 -# RHEL7.7.Z +# RHEL-7.8 # +# 1734545 - RHEL-7: blkid_get_dev() leak file descriptor to underlying block device +Patch186: 0186-libblkid-fix-file-descriptor-leak-in-blkid_verify.patch # 1712768 - lsmem segfaults on ppc64 wih -o -Patch186: 0186-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch +Patch187: 0187-misc-cleanup-size_t-vs.-int-for-string_add_to_idarra.patch +# 1690102 - setarch(8) does not check error return values properly. +Patch188: 0188-setarch-use-personality-system-call-when-it-is-avail.patch +Patch189: 0189-setarch-fix-personality-syscall-return-code-check.patch +# 1734261 - lscpu not showing Physical socket, chips information +Patch190: 0190-build-sys-check-for-librtas.patch +# 1690102 - setarch(8) does not check error return values properly. +Patch191: 0191-setarch-prefer-preprocessor-rather-than-autotools-ch.patch +# 1740572 - libmount ignores empty domain field due to which plain domain option is sent. +Patch192: 0192-libmount-Preserve-empty-string-value-in-optstr-parsi.patch %description @@ -1227,8 +1241,14 @@ fi %{_libdir}/pkgconfig/uuid.pc %changelog -* Tue Oct 29 2019 Karel Zak 2.23.2-61.el7_7.1 +* Wed Aug 21 2019 Karel Zak 2.23.2-63 +- fix #1740572 - libmount ignores empty domain field due to which plain domain option is sent. + +* Tue Aug 06 2019 Karel Zak 2.23.2-62 +- fix #1734545 - blkid_get_dev() leak file descriptor to underlying block device - fix #1712768 - lsmem segfaults on ppc64 wih -o +- fix #1690102 - setarch(8) does not check error return values properly. +- fix #1734261 - lscpu not showing Physical socket, chips information * Fri Mar 22 2019 Karel Zak 2.23.2-61 - #1203378 - Cannot use swapon with fallocated XFS swapfile