From 08f7ede86cbc023edd820dcf973419ae814e37d3 Mon Sep 17 00:00:00 2001 From: zhangyao Date: Thu, 23 Nov 2023 15:31:32 +0800 Subject: [PATCH] sync community patches --- backport-Fix-memory-leaks-in-the-chcpu.patch | 20 +++++ ...pt-for-each-field-on-a-separate-line.patch | 79 +++++++++++++++++++ ...stdin-and-fix-uninitialized-variable.patch | 37 +++++++++ ...ush-stdout-before-reading-from-stdin.patch | 27 +++++++ ...lid-unicode-input-passed-to-s-option.patch | 30 +++++++ ...-prefix-doesnot-use-priority-default.patch | 37 +++++++++ backport-logger-fix-size-use-for-stdin.patch | 64 +++++++++++++++ ...lloc-buffer-when-header-size-changed.patch | 64 +++++++++++++++ ...store-tty-size-after-calling-vhangup.patch | 58 ++++++++++++++ ...mcookie-fix-infinite-loop-when-use-f.patch | 23 ++++++ ...su-offer-usernames-rather-than-files.patch | 24 ++++++ ...w-flush-stdout-before-getting-answer.patch | 35 ++++++++ util-linux.spec | 32 +++++++- 13 files changed, 529 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-memory-leaks-in-the-chcpu.patch create mode 100644 backport-chfn-Make-readline-prompt-for-each-field-on-a-separate-line.patch create mode 100644 backport-chfn-flush-stdout-before-reading-stdin-and-fix-uninitialized-variable.patch create mode 100644 backport-chsh-fflush-stdout-before-reading-from-stdin.patch create mode 100644 backport-column-segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch create mode 100644 backport-logger-fix-prio-prefix-doesnot-use-priority-default.patch create mode 100644 backport-logger-fix-size-use-for-stdin.patch create mode 100644 backport-logger-realloc-buffer-when-header-size-changed.patch create mode 100644 backport-login-Restore-tty-size-after-calling-vhangup.patch create mode 100644 backport-mcookie-fix-infinite-loop-when-use-f.patch create mode 100644 backport-su-offer-usernames-rather-than-files.patch create mode 100644 backport-vipw-flush-stdout-before-getting-answer.patch diff --git a/backport-Fix-memory-leaks-in-the-chcpu.patch b/backport-Fix-memory-leaks-in-the-chcpu.patch new file mode 100644 index 0000000..3b0e959 --- /dev/null +++ b/backport-Fix-memory-leaks-in-the-chcpu.patch @@ -0,0 +1,20 @@ +From a283ad4ed27b19da176e75d4bec521dea067fedc Mon Sep 17 00:00:00 2001 +From: jiazhenyuan +Date: Mon, 6 Sep 2021 16:50:27 +0800 +Subject: [PATCH] Fix memory leaks in the chcpu +--- + sys-utils/chcpu.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c +index c4e5bc7e29..527bce5586 100644 +--- a/sys-utils/chcpu.c ++++ b/sys-utils/chcpu.c +@@ -383,6 +383,7 @@ int main(int argc, char *argv[]) + break; + } + ++ CPU_FREE(cpu_set); + ul_unref_path(sys); + + return rc == 0 ? EXIT_SUCCESS : diff --git a/backport-chfn-Make-readline-prompt-for-each-field-on-a-separate-line.patch b/backport-chfn-Make-readline-prompt-for-each-field-on-a-separate-line.patch new file mode 100644 index 0000000..c09c382 --- /dev/null +++ b/backport-chfn-Make-readline-prompt-for-each-field-on-a-separate-line.patch @@ -0,0 +1,79 @@ +From 49848aa53ae3a599277e8ceb50feda565f140b45 Mon Sep 17 00:00:00 2001 +From: Damien Goutte-Gattat +Date: Sat, 27 Jun 2020 19:58:13 +0100 +Subject: [PATCH] chfn: Make readline prompt for each field on a separate line + +When readline is called to get user input, it is called without +a prompt argument. As a result, if the user does not enter anything +for a given field, then the next field is displayed on the same +line, yielding the following output: + + $ chfn + Changing finger information for user. + Password: + Name []: Office []: Office Phone []: Home Phone []: + +instead of the expected: + + $ chfn + Changing finger information for user. + Password: + Full Name []: + Room Number []: + Work Phone []: + Home Phone []: + +This patch restores the expected behavior by feeding readline with +a character to display as "prompt". + +[kzak@redhat.com: - do the same change in chsh + - use ' ' rather than '\n' for non-readline code] + +Signed-off-by: Damien Goutte-Gattat +Signed-off-by: Karel Zak +--- + login-utils/chfn.c | 5 +++-- + login-utils/chsh.c | 5 +++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/login-utils/chfn.c b/login-utils/chfn.c +index b739555..eaba7f8 100644 +--- a/login-utils/chfn.c ++++ b/login-utils/chfn.c +@@ -236,12 +236,13 @@ static char *ask_new_field(struct chfn_control *ctl, const char *question, + if (!def_val) + def_val = ""; + while (true) { +- printf("%s [%s]: ", question, def_val); ++ printf("%s [%s]:", question, def_val); + __fpurge(stdin); + #ifdef HAVE_LIBREADLINE + rl_bind_key('\t', rl_insert); +- if ((buf = readline(NULL)) == NULL) ++ if ((buf = readline(" ")) == NULL) + #else ++ putchar(' '); + if (getline(&buf, &dummy, stdin) < 0) + #endif + errx(EXIT_FAILURE, _("Aborted.")); +diff --git a/login-utils/chsh.c b/login-utils/chsh.c +index a9ebec8..17cc9f1 100644 +--- a/login-utils/chsh.c ++++ b/login-utils/chsh.c +@@ -205,10 +205,11 @@ static char *ask_new_shell(char *question, char *oldshell) + #endif + if (!oldshell) + oldshell = ""; +- printf("%s [%s]\n", question, oldshell); ++ printf("%s [%s]:", question, oldshell); + #ifdef HAVE_LIBREADLINE +- if ((ans = readline("> ")) == NULL) ++ if ((ans = readline(" ")) == NULL) + #else ++ putchar(' '); + if (getline(&ans, &dummy, stdin) < 0) + #endif + return NULL; +-- +2.27.0 + diff --git a/backport-chfn-flush-stdout-before-reading-stdin-and-fix-uninitialized-variable.patch b/backport-chfn-flush-stdout-before-reading-stdin-and-fix-uninitialized-variable.patch new file mode 100644 index 0000000..f10a06e --- /dev/null +++ b/backport-chfn-flush-stdout-before-reading-stdin-and-fix-uninitialized-variable.patch @@ -0,0 +1,37 @@ +From 05907d0d9e7c85f33e168feab1eb36b464425054 Mon Sep 17 00:00:00 2001 +From: Lorenzo Beretta +Date: Mon, 25 Oct 2021 14:06:00 +0200 +Subject: [PATCH] chfn: flush stdout before reading stdin and fix uninitialized + variable + +Same problem as described in https://github.com/karelzak/util-linux/pull/1481 + +Signed-off-by: Lorenzo Beretta +--- + login-utils/chfn.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/login-utils/chfn.c b/login-utils/chfn.c +index eaba7f8..aea26f7 100644 +--- a/login-utils/chfn.c ++++ b/login-utils/chfn.c +@@ -228,7 +228,7 @@ static char *ask_new_field(struct chfn_control *ctl, const char *question, + char *def_val) + { + int len; +- char *buf; ++ char *buf = NULL; /* leave initialized to NULL or getline segfaults */ + #ifndef HAVE_LIBREADLINE + size_t dummy = 0; + #endif +@@ -243,6 +243,7 @@ static char *ask_new_field(struct chfn_control *ctl, const char *question, + if ((buf = readline(" ")) == NULL) + #else + putchar(' '); ++ fflush(stdout); + if (getline(&buf, &dummy, stdin) < 0) + #endif + errx(EXIT_FAILURE, _("Aborted.")); +-- +2.27.0 + diff --git a/backport-chsh-fflush-stdout-before-reading-from-stdin.patch b/backport-chsh-fflush-stdout-before-reading-from-stdin.patch new file mode 100644 index 0000000..a28cfd1 --- /dev/null +++ b/backport-chsh-fflush-stdout-before-reading-from-stdin.patch @@ -0,0 +1,27 @@ +From 0a08200bd5664d1849e477f7f776ab4d13bb8422 Mon Sep 17 00:00:00 2001 +From: Lorenzo Beretta +Date: Mon, 25 Oct 2021 15:28:02 +0200 +Subject: [PATCH] chsh: fflush stdout before reading from stdin + +Same problem as described in https://github.com/karelzak/util-linux/pull/1481 + +Signed-off-by: Lorenzo Beretta +--- + login-utils/chsh.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/login-utils/chsh.c b/login-utils/chsh.c +index 17cc9f1..63b8b29 100644 +--- a/login-utils/chsh.c ++++ b/login-utils/chsh.c +@@ -210,6 +210,7 @@ static char *ask_new_shell(char *question, char *oldshell) + if ((ans = readline(" ")) == NULL) + #else + putchar(' '); ++ fflush(stdout); + if (getline(&ans, &dummy, stdin) < 0) + #endif + return NULL; +-- +2.27.0 + diff --git a/backport-column-segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch b/backport-column-segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch new file mode 100644 index 0000000..ed139dd --- /dev/null +++ b/backport-column-segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch @@ -0,0 +1,30 @@ +From 9714331843ef3a6d9c10ff1d3bc5fcf53d44d930 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 31 Aug 2021 12:31:15 +0200 +Subject: [PATCH] column: segmentation fault on invalid unicode input passed to + -s option + +The function mbs_to_wcs() returns NULL on invalid UTF. + +Fixes: https://github.com/karelzak/util-linux/issues/1425 +Signed-off-by: Karel Zak +--- + text-utils/column.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/text-utils/column.c b/text-utils/column.c +index 33c7f1f..5728dfb 100644 +--- a/text-utils/column.c ++++ b/text-utils/column.c +@@ -769,6 +769,8 @@ int main(int argc, char **argv) + case 's': + free(ctl.input_separator); + ctl.input_separator = mbs_to_wcs(optarg); ++ if (!ctl.input_separator) ++ err(EXIT_FAILURE, _("failed to use input separator")); + ctl.greedy = 0; + break; + case 'T': +-- +2.27.0 + diff --git a/backport-logger-fix-prio-prefix-doesnot-use-priority-default.patch b/backport-logger-fix-prio-prefix-doesnot-use-priority-default.patch new file mode 100644 index 0000000..296d24e --- /dev/null +++ b/backport-logger-fix-prio-prefix-doesnot-use-priority-default.patch @@ -0,0 +1,37 @@ +From 02f859392754038f383dabeb32effec4ae1f02ba Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 16 Sep 2021 12:20:25 +0200 +Subject: [PATCH] logger: fix --prio-prefix doesn't use --priority default + +The commit b9ef27f have added priority check, but it introduced +regression as the default priority (as specified by --priority) is +ignored. + +This patch fixes this problem, but it also removes extra check for +"kern facility", it's unnecessary and inconsistent with the rest of +logger. + +Fixes: https://github.com/karelzak/util-linux/issues/1450 +Signed-off-by: Karel Zak +--- + misc-utils/logger.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/misc-utils/logger.c b/misc-utils/logger.c +index a7736eb..4120871 100644 +--- a/misc-utils/logger.c ++++ b/misc-utils/logger.c +@@ -1003,8 +1003,8 @@ static void logger_stdin(struct logger_ctl *ctl) + if (c == '>' && 0 <= pri && pri <= 191) { + /* valid RFC PRI values */ + i = 0; +- if (pri < 8) /* kern facility is forbidden */ +- pri |= 8; ++ if ((pri & LOG_FACMASK) == 0) ++ pri |= (default_priority & LOG_FACMASK); + ctl->pri = pri; + } else + ctl->pri = default_priority; +-- +2.27.0 + diff --git a/backport-logger-fix-size-use-for-stdin.patch b/backport-logger-fix-size-use-for-stdin.patch new file mode 100644 index 0000000..3fa24d2 --- /dev/null +++ b/backport-logger-fix-size-use-for-stdin.patch @@ -0,0 +1,64 @@ +From 58e4ee082bca100034791a4a74481f263bb30a25 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 21 Oct 2021 18:47:40 +0200 +Subject: [PATCH] logger: fix --size use for stdin +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The stdin version counts log header into the message size, but +for example when it reads message from argv[] it counts only message +itself. + + $ logger --stderr --size 3 "abcd" + <13>Oct 21 18:48:29 kzak: abc + + $ echo "abcd" | logger --stderr --size 3 + logger: cannot allocate 18446744073709551597 bytes: Cannot allocate memory + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602 +Signed-off-by: Karel Zak +--- + misc-utils/logger.c | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/misc-utils/logger.c b/misc-utils/logger.c +index d3b3343..15d5dc5 100644 +--- a/misc-utils/logger.c ++++ b/misc-utils/logger.c +@@ -981,9 +981,7 @@ static void logger_stdin(struct logger_ctl *ctl) + */ + int default_priority = ctl->pri; + int last_pri = default_priority; +- size_t max_usrmsg_size = ctl->max_message_size - strlen(ctl->hdr); +- size_t allocated_usrmsg_size = max_usrmsg_size; +- char *buf = xmalloc(allocated_usrmsg_size + 2 + 2); ++ char *buf = xmalloc(ctl->max_message_size + 2 + 2); + int pri; + int c; + size_t i; +@@ -1011,20 +1009,13 @@ static void logger_stdin(struct logger_ctl *ctl) + + if (ctl->pri != last_pri) { + generate_syslog_header(ctl); +- max_usrmsg_size = ctl->max_message_size - strlen(ctl->hdr); +- +- if (max_usrmsg_size > allocated_usrmsg_size) { +- allocated_usrmsg_size = max_usrmsg_size; +- buf = xrealloc(buf, allocated_usrmsg_size + 2 + 2); +- } +- + last_pri = ctl->pri; + } + if (c != EOF && c != '\n') + c = getchar(); + } + +- while (c != EOF && c != '\n' && i < max_usrmsg_size) { ++ while (c != EOF && c != '\n' && i < ctl->max_message_size) { + buf[i++] = c; + c = getchar(); + } +-- +2.27.0 + diff --git a/backport-logger-realloc-buffer-when-header-size-changed.patch b/backport-logger-realloc-buffer-when-header-size-changed.patch new file mode 100644 index 0000000..a542097 --- /dev/null +++ b/backport-logger-realloc-buffer-when-header-size-changed.patch @@ -0,0 +1,64 @@ +From b0a8b8cd9c34600dda7d0503aac2dc0af3012fdc Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 21 Oct 2021 16:00:01 +0200 +Subject: [PATCH] logger: realloc buffer when header size changed + +This is probably paranoid optimization, but when we generate a new +header we need to be sure that buffer is not smaller than calculated +maximal size of user's data. + +Signed-off-by: Karel Zak +--- + misc-utils/logger.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/misc-utils/logger.c b/misc-utils/logger.c +index 23da164cd6..4511ab1141 100644 +--- a/misc-utils/logger.c ++++ b/misc-utils/logger.c +@@ -979,11 +979,11 @@ static void logger_stdin(struct logger_ctl *ctl) + * update header timestamps and to reflect possible priority changes. + * The initial header is generated by logger_open(). + */ +- int has_header = 1; + int default_priority = ctl->pri; + int last_pri = default_priority; + size_t max_usrmsg_size = ctl->max_message_size - strlen(ctl->hdr); +- char *const buf = xmalloc(max_usrmsg_size + 2 + 2); ++ size_t allocated_usrmsg_size = max_usrmsg_size; ++ char *buf = xmalloc(allocated_usrmsg_size + 2 + 2); + int pri; + int c; + size_t i; +@@ -1010,9 +1010,14 @@ static void logger_stdin(struct logger_ctl *ctl) + ctl->pri = default_priority; + + if (ctl->pri != last_pri) { +- has_header = 0; +- max_usrmsg_size = +- ctl->max_message_size - strlen(ctl->hdr); ++ generate_syslog_header(ctl); ++ max_usrmsg_size = ctl->max_message_size - strlen(ctl->hdr); ++ ++ if (max_usrmsg_size > allocated_usrmsg_size) { ++ allocated_usrmsg_size = max_usrmsg_size; ++ buf = xrealloc(buf, allocated_usrmsg_size + 2 + 2); ++ } ++ + last_pri = ctl->pri; + } + if (c != EOF && c != '\n') +@@ -1025,12 +1030,8 @@ static void logger_stdin(struct logger_ctl *ctl) + } + buf[i] = '\0'; + +- if (i > 0 || !ctl->skip_empty_lines) { +- if (!has_header) +- generate_syslog_header(ctl); ++ if (i > 0 || !ctl->skip_empty_lines) + write_output(ctl, buf); +- has_header = 0; +- } + + if (c == '\n') /* discard line terminator */ + c = getchar(); diff --git a/backport-login-Restore-tty-size-after-calling-vhangup.patch b/backport-login-Restore-tty-size-after-calling-vhangup.patch new file mode 100644 index 0000000..4066b6e --- /dev/null +++ b/backport-login-Restore-tty-size-after-calling-vhangup.patch @@ -0,0 +1,58 @@ +From 7e58b71dfa9bf27f574fd79424f56206f44fa806 Mon Sep 17 00:00:00 2001 +From: Daan De Meyer +Date: Sat, 30 Oct 2021 15:56:14 +0100 +Subject: [PATCH] login: Restore tty size after calling vhangup() + +If login receives the tty to work on via stdin, stdout and stderr, +login might end up closing the remaining open file descriptors to +the tty just before it calls vhangup(). When the last open file +descriptors to a tty are closed, it's configured size is reset to +0x0. To avoid this from happening, save the size before closing +the stdin, stdout and stderr file descriptors and reapply the size +after the tty is re-opened. + +Fixes #1484 +--- + login-utils/login.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/login-utils/login.c b/login-utils/login.c +index c08d380..648d3d2 100644 +--- a/login-utils/login.c ++++ b/login-utils/login.c +@@ -362,6 +362,7 @@ static void init_tty(struct login_context *cxt) + { + struct stat st; + struct termios tt, ttt; ++ struct winsize ws; + + cxt->tty_mode = (mode_t) getlogindefs_num("TTYPERM", TTY_MODE); + +@@ -392,6 +393,12 @@ static void init_tty(struct login_context *cxt) + } + #endif + ++ /* The TTY size might be reset to 0x0 by the kernel when we close the stdin/stdout/stderr file ++ * descriptors so let's save the size now so we can reapply it later */ ++ memset(&ws, 0, sizeof(struct winsize)); ++ if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) < 0) ++ syslog(LOG_WARNING, _("TIOCGWINSZ ioctl failed: %m")); ++ + tcgetattr(0, &tt); + ttt = tt; + ttt.c_cflag &= ~HUPCL; +@@ -423,6 +430,11 @@ static void init_tty(struct login_context *cxt) + + /* restore tty modes */ + tcsetattr(0, TCSAFLUSH, &tt); ++ ++ /* Restore tty size */ ++ if (ws.ws_row > 0 || ws.ws_col > 0) ++ if (ioctl(STDIN_FILENO, TIOCSWINSZ, &ws) < 0) ++ syslog(LOG_WARNING, _("TIOCSWINSZ ioctl failed: %m")); + } + + +-- +2.27.0 + diff --git a/backport-mcookie-fix-infinite-loop-when-use-f.patch b/backport-mcookie-fix-infinite-loop-when-use-f.patch new file mode 100644 index 0000000..aa0a2d7 --- /dev/null +++ b/backport-mcookie-fix-infinite-loop-when-use-f.patch @@ -0,0 +1,23 @@ +From 60e5bb73990260836b087735a9c69deab8af4c81 Mon Sep 17 00:00:00 2001 +From: Hiroaki Sengoku +Date: Fri, 15 Oct 2021 14:02:46 +0900 +Subject: [PATCH] mcookie: fix infinite-loop when use -f + +Signed-off-by: Karel Zak +--- + misc-utils/mcookie.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/misc-utils/mcookie.c b/misc-utils/mcookie.c +index 315740127e..be5c34ae4c 100644 +--- a/misc-utils/mcookie.c ++++ b/misc-utils/mcookie.c +@@ -65,7 +65,7 @@ static uint64_t hash_file(struct mcookie_control *ctl, int fd) + rdsz = wanted - count; + + r = read_all(fd, (char *) buf, rdsz); +- if (r < 0) ++ if (r <= 0) + break; + ul_MD5Update(&ctl->ctx, buf, r); + count += r; diff --git a/backport-su-offer-usernames-rather-than-files.patch b/backport-su-offer-usernames-rather-than-files.patch new file mode 100644 index 0000000..5ea936d --- /dev/null +++ b/backport-su-offer-usernames-rather-than-files.patch @@ -0,0 +1,24 @@ +From 059811d096f0051d911f884d47ebc6147630990a Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 31 Aug 2021 12:51:40 +0200 +Subject: [PATCH] su: (bash-completion) offer usernames rather than files + +Fixes: https://github.com/karelzak/util-linux/issues/1424 +Signed-off-by: Karel Zak +--- + bash-completion/su | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bash-completion/su b/bash-completion/su +index 309505085d..913e445230 100644 +--- a/bash-completion/su ++++ b/bash-completion/su +@@ -41,7 +41,7 @@ _su_module() + esac + local IFS=$'\n' + compopt -o filenames +- COMPREPLY=( $(compgen -f -- $cur) ) ++ COMPREPLY=( $(compgen -u -- $cur) ) + return 0 + } + complete -F _su_module su diff --git a/backport-vipw-flush-stdout-before-getting-answer.patch b/backport-vipw-flush-stdout-before-getting-answer.patch new file mode 100644 index 0000000..3b9c560 --- /dev/null +++ b/backport-vipw-flush-stdout-before-getting-answer.patch @@ -0,0 +1,35 @@ +From 34a9b65587a7d704db0344e859511af4a6756c89 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=89rico=20Nogueira?= +Date: Fri, 22 Oct 2021 14:28:50 -0300 +Subject: [PATCH] vipw: flush stdout before getting answer. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Otherwise the question is displayed only after the user presses Return, +and the program looks like it's hanging. + +This happens at least on musl libc. + +Reported by @loreb. + +Signed-off-by: Érico Nogueira +--- + login-utils/vipw.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/login-utils/vipw.c b/login-utils/vipw.c +index 38953b7..bd0bac5 100644 +--- a/login-utils/vipw.c ++++ b/login-utils/vipw.c +@@ -364,6 +364,7 @@ int main(int argc, char *argv[]) + * which means they can be translated. */ + printf(_("Would you like to edit %s now [y/n]? "), orig_file); + ++ fflush(stdout); + if (fgets(response, sizeof(response), stdin) && + rpmatch(response) == RPMATCH_YES) + edit_file(1); +-- +2.27.0 + diff --git a/util-linux.spec b/util-linux.spec index d41a396..fe834f4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Name: util-linux Version: 2.35.2 -Release: 12 +Release: 13 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -57,6 +57,18 @@ Patch18: backport-libblkid-use-sys-to-read-all-block-devices.patch Patch19: backpaort-fix-rounding-in-size_to_human_string.patch Patch20: backpaort-fix-uint64_t-overflow.patch Patch21: backpaort-update-fdisk-outputs-due-to-sizes-rounding-change.patch +Patch22: backport-column-segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch +Patch23: backport-su-offer-usernames-rather-than-files.patch +Patch24: backport-Fix-memory-leaks-in-the-chcpu.patch +Patch25: backport-logger-fix-prio-prefix-doesnot-use-priority-default.patch +Patch26: backport-mcookie-fix-infinite-loop-when-use-f.patch +Patch27: backport-logger-realloc-buffer-when-header-size-changed.patch +Patch28: backport-logger-fix-size-use-for-stdin.patch +Patch29: backport-vipw-flush-stdout-before-getting-answer.patch +Patch30: backport-chfn-Make-readline-prompt-for-each-field-on-a-separate-line.patch +Patch31: backport-chfn-flush-stdout-before-reading-stdin-and-fix-uninitialized-variable.patch +Patch32: backport-chsh-fflush-stdout-before-reading-from-stdin.patch +Patch33: backport-login-Restore-tty-size-after-calling-vhangup.patch Patch6000: backport-CVE-2021-37600.patch Patch6001: backport-lib-strutils-fix-parse_size-for-large-numbers.patch Patch6002: backport-add-ul_strtou64.patch @@ -415,6 +427,24 @@ fi %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog +* Thu Nov 23 2023 zhangyao - 2.35.2-13 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:sync community patches + backport-column-segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch + backport-su-offer-usernames-rather-than-files.patch + backport-Fix-memory-leaks-in-the-chcpu.patch + backport-logger-fix-prio-prefix-doesnot-use-priority-default.patch + backport-mcookie-fix-infinite-loop-when-use-f.patch + backport-logger-realloc-buffer-when-header-size-changed.patch + backport-logger-fix-size-use-for-stdin.patch + backport-vipw-flush-stdout-before-getting-answer.patch + backport-chfn-Make-readline-prompt-for-each-field-on-a-separate-line.patch + backport-chfn-flush-stdout-before-reading-stdin-and-fix-uninitialized-variable.patch + backport-chsh-fflush-stdout-before-reading-from-stdin.patch + backport-login-Restore-tty-size-after-calling-vhangup.patch + * Wed Jul 13 2022 hanjinpeng - 2.35.2-12 - Type:bugfix - ID:NA -- Gitee