From vda.linux at googlemail.com Mon Jan 2 15:59:40 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 2 Jan 2023 16:59:40 +0100 Subject: [git commit] xxd: fix use of non-initialized data Message-ID: <20230102171257.54AC987138@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=adb1c7dcfe14132f2a5e0947d1af3eb50c751327 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- util-linux/hexdump_xxd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util-linux/hexdump_xxd.c b/util-linux/hexdump_xxd.c index 45391b565..b5942899e 100644 --- a/util-linux/hexdump_xxd.c +++ b/util-linux/hexdump_xxd.c @@ -229,7 +229,8 @@ int xxd_main(int argc UNUSED_PARAM, char **argv) { char buf[80]; dumper_t *dumper; - char *opt_l, *opt_s, *opt_o; + char *opt_l, *opt_o; + char *opt_s = NULL; unsigned bytes = 2; unsigned cols = 0; unsigned opt; From vda.linux at googlemail.com Mon Jan 2 16:02:17 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 2 Jan 2023 17:02:17 +0100 Subject: [git commit] testsuite/sha1sum.tests: fix false positive failure Message-ID: <20230102171257.695668713B@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=fb0c000567634db32a644fef0e82627517a0f2e8 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- testsuite/sha1sum.tests | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testsuite/sha1sum.tests b/testsuite/sha1sum.tests index 7ad1334c3..e6ddb2a86 100755 --- a/testsuite/sha1sum.tests +++ b/testsuite/sha1sum.tests @@ -4,10 +4,12 @@ # testing "test name" "cmd" "expected result" "file input" "stdin" >EMPTY +optional FEATURE_MD5_SHA1_SUM_CHECK testing "sha1sum: one-space separated input for -c" \ 'echo "da39a3ee5e6b4b0d3255bfef95601890afd80709 EMPTY" | sha1sum -c' \ "EMPTY: OK\n" \ "" "" +SKIP= rm EMPTY . ./md5sum.tests sha1sum d41337e834377140ae7f98460d71d908598ef04f From vda.linux at googlemail.com Mon Jan 2 16:01:14 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 2 Jan 2023 17:01:14 +0100 Subject: [git commit] testsuite/tree.tests: fix false positive failure Message-ID: <20230102171257.5E98E87139@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=dc068abad597cb8ccd08da84180d0bdba7b3af01 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- testsuite/tree.tests | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/testsuite/tree.tests b/testsuite/tree.tests index 4f4a9e30b..1fa66da80 100755 --- a/testsuite/tree.tests +++ b/testsuite/tree.tests @@ -18,6 +18,8 @@ tree.tempdir [error opening dir]\n\ mkdir -p tree2.tempdir touch tree2.tempdir/testfile +optional UNICODE_SUPPORT + testing "tree single file" \ "cd tree2.tempdir && tree" \ "\ @@ -50,17 +52,17 @@ testing "tree nested directories and files" \ .\n\ ????????? test1\n\ ????????? test2\n\ -??????? ????????? a\n\ -??????? ??????? ????????? testfile1\n\ -??????? ??????? ????????? testfile2\n\ -??????? ??????? ????????? testfile3\n\ -??????? ??????? ????????? testfile4 -> ../b/testfile4\n\ -??????? ????????? b\n\ -??????? ????????? test3 -> ../../test3\n\ -??????? ????????? testfile4\n\ +??? ????????? a\n\ +??? ??? ????????? testfile1\n\ +??? ??? ????????? testfile2\n\ +??? ??? ????????? testfile3\n\ +??? ??? ????????? testfile4 -> ../b/testfile4\n\ +??? ????????? b\n\ +??? ????????? test3 -> ../../test3\n\ +??? ????????? testfile4\n\ ????????? test3\n\ ????????? c\n\ - ??????? ????????? testfile5\n\ + ??? ????????? testfile5\n\ ????????? d\n\ ????????? testfile6\n\ \n\ @@ -77,17 +79,17 @@ tree2.tempdir\n\ tree3.tempdir\n\ ????????? test1\n\ ????????? test2\n\ -??????? ????????? a\n\ -??????? ??????? ????????? testfile1\n\ -??????? ??????? ????????? testfile2\n\ -??????? ??????? ????????? testfile3\n\ -??????? ??????? ????????? testfile4 -> ../b/testfile4\n\ -??????? ????????? b\n\ -??????? ????????? test3 -> ../../test3\n\ -??????? ????????? testfile4\n\ +??? ????????? a\n\ +??? ??? ????????? testfile1\n\ +??? ??? ????????? testfile2\n\ +??? ??? ????????? testfile3\n\ +??? ??? ????????? testfile4 -> ../b/testfile4\n\ +??? ????????? b\n\ +??? ????????? test3 -> ../../test3\n\ +??? ????????? testfile4\n\ ????????? test3\n\ ????????? c\n\ - ??????? ????????? testfile5\n\ + ??? ????????? testfile5\n\ ????????? d\n\ ????????? testfile6\n\ \n\ From vda.linux at googlemail.com Mon Jan 2 16:03:44 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 2 Jan 2023 17:03:44 +0100 Subject: [git commit] libbb/loop: fix compile failure (name collision) Message-ID: <20230102171257.75FE48713C@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=e7977df2cae2ac2c5da38f77488ec9e97d10c33b branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- libbb/loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libbb/loop.c b/libbb/loop.c index 95c4a34e2..a0c5d0259 100644 --- a/libbb/loop.c +++ b/libbb/loop.c @@ -112,7 +112,7 @@ static int get_next_free_loop(char *dev, int id) #if ENABLE_TRY_LOOP_CONFIGURE || ENABLE_LOOP_CONFIGURE # define LOOP_CONFIGURE 0x4C0A -struct loop_config { +struct bb_loop_config { uint32_t fd; uint32_t block_size; struct loop_info64 info; @@ -128,7 +128,7 @@ static int set_loopdev_params(int lfd, { int rc; #if ENABLE_TRY_LOOP_CONFIGURE || ENABLE_LOOP_CONFIGURE - struct loop_config lconfig; + struct bb_loop_config lconfig; # define loopinfo lconfig.info #else bb_loop_info loopinfo; From vda.linux at googlemail.com Mon Jan 2 16:10:04 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 2 Jan 2023 17:10:04 +0100 Subject: [git commit] Makefile.flags: add resolv to LDLIBS for linux compilers too (not only gnu ones) Message-ID: <20230102171257.96B428713B@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=8ed57db65ba66709d3b4061c4f03766f1fe58780 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- Makefile.flags | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.flags b/Makefile.flags index 50137a78e..1cec5ba20 100644 --- a/Makefile.flags +++ b/Makefile.flags @@ -184,6 +184,9 @@ LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=% endif ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y) +ifneq (,$(findstring linux,$(shell $(CC) $(CFLAGS) -dumpmachine))) +LDLIBS += resolv +endif ifneq (,$(findstring gnu,$(shell $(CC) $(CFLAGS) -dumpmachine))) LDLIBS += resolv endif From vda.linux at googlemail.com Mon Jan 2 16:05:55 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 2 Jan 2023 17:05:55 +0100 Subject: [git commit] sed: fix double-free in FEATURE_CLEAN_UP=y configs Message-ID: <20230102171257.8C64787139@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=9b2d766e0ecb222d25a43333287835452e43f8a9 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- editors/sed.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/editors/sed.c b/editors/sed.c index 32a4b61f6..00dde60be 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -99,7 +99,7 @@ enum { struct sed_FILE { struct sed_FILE *next; /* Next (linked list, NULL terminated) */ - const char *fname; + char *fname; FILE *fp; }; @@ -188,9 +188,6 @@ static void sed_free_and_close_stuff(void) while (sed_cmd) { sed_cmd_t *sed_cmd_next = sed_cmd->next; - if (sed_cmd->sw_file) - fclose(sed_cmd->sw_file); - /* Used to free regexps, but now there is code * in get_address() which can reuse a regexp * for constructs as /regexp/cmd1;//cmd2 @@ -217,6 +214,18 @@ static void sed_free_and_close_stuff(void) if (G.current_fp) fclose(G.current_fp); + + if (G.FILE_head) { + struct sed_FILE *cur = G.FILE_head; + do { + struct sed_FILE *p; + fclose(cur->fp); + free(cur->fname); + p = cur; + cur = cur->next; + free(p); + } while (cur); + } } #else void sed_free_and_close_stuff(void); From vda.linux at googlemail.com Mon Jan 2 16:04:44 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 2 Jan 2023 17:04:44 +0100 Subject: [git commit] mv: fix error in !VERBOSE configs Message-ID: <20230102171257.803A787138@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=cadf57b3afac5f77c75516d82aed4bc845b5d704 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- coreutils/mv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreutils/mv.c b/coreutils/mv.c index fd2422683..cf6169a1e 100644 --- a/coreutils/mv.c +++ b/coreutils/mv.c @@ -71,9 +71,9 @@ int mv_main(int argc, char **argv) "no-target-directory\0" No_argument "T" "target-directory\0" Required_argument "t" IF_FEATURE_VERBOSE( - "verbose\0" No_argument "v", - &last + "verbose\0" No_argument "v" ) + , &last ); argc -= optind; argv += optind; From vda.linux at googlemail.com Tue Jan 3 07:30:12 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 08:30:12 +0100 Subject: [git commit] xxd: use bb_simple_perror_msg... where appropriate Message-ID: <20230103073731.CBB5687185@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=bcb90b9c419c9d616f21d8fc143f9b343c064ed7 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- util-linux/hexdump_xxd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util-linux/hexdump_xxd.c b/util-linux/hexdump_xxd.c index b5942899e..9738a76ad 100644 --- a/util-linux/hexdump_xxd.c +++ b/util-linux/hexdump_xxd.c @@ -78,7 +78,7 @@ static void write_zeros(off_t count) do { unsigned sz = count < COMMON_BUFSIZE ? (unsigned)count : COMMON_BUFSIZE; if (fwrite(fillbuf, 1, sz, stdout) != sz) - bb_perror_msg_and_die("write error"); + bb_simple_perror_msg_and_die("write error"); count -= sz; } while (count != 0); } @@ -120,7 +120,7 @@ static void reverse(unsigned opt, const char *filename, char *opt_s) if (ofs != cur) { if (fseeko(stdout, ofs, SEEK_SET) != 0) { if (ofs < cur) - bb_perror_msg_and_die("cannot seek"); + bb_simple_perror_msg_and_die("cannot seek"); write_zeros(ofs - cur); } cur = ofs; From vda.linux at googlemail.com Tue Jan 3 07:28:16 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 08:28:16 +0100 Subject: [git commit] shell: fix compile failures in some configs Message-ID: <20230103073731.BF0638717F@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=27be0e8cfeb6f0f7a66bbfb2a6ca23d5a064e6ab branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- include/libbb.h | 8 +++++++- libbb/lineedit.c | 24 +++++++++++++----------- shell/ash.c | 8 ++++++-- shell/hush.c | 6 +++++- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/include/libbb.h b/include/libbb.h index 19ed9ec09..cca33a177 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1939,9 +1939,15 @@ typedef struct line_input_t { # if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH /* function to fetch additional application-specific names to match */ get_exe_name_t *get_exe_name; +# endif +# endif +# if (ENABLE_FEATURE_USERNAME_COMPLETION || ENABLE_FEATURE_EDITING_FANCY_PROMPT) \ + && (ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH) /* function to fetch value of shell variable */ sh_get_var_t *sh_get_var; -# endif +# define EDITING_HAS_sh_get_var 1 +# else +# define EDITING_HAS_sh_get_var 0 # endif # if MAX_HISTORY int cnt_history; diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 697f2a577..d6b2e76ff 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -249,14 +249,6 @@ static void get_user_strings(void) } } -static const char *get_username_str(void) -{ - if (!got_user_strings) - get_user_strings(); - return user_buf ? user_buf : ""; - /* btw, bash uses "I have no name!" string if uid has no entry */ -} - static NOINLINE const char *get_homedir_or_NULL(void) { const char *home; @@ -275,6 +267,16 @@ static NOINLINE const char *get_homedir_or_NULL(void) } #endif +#if ENABLE_FEATURE_EDITING_FANCY_PROMPT +static const char *get_username_str(void) +{ + if (!got_user_strings) + get_user_strings(); + return user_buf ? user_buf : ""; + /* btw, bash uses "I have no name!" string if uid has no entry */ +} +#endif + #if ENABLE_UNICODE_SUPPORT static size_t load_string(const char *src) { @@ -2035,13 +2037,13 @@ static void parse_and_put_prompt(const char *prmt_ptr) case 'W': /* basename of cur dir */ if (!cwd_buf) { const char *home; -#if ENABLE_SHELL_ASH +# if EDITING_HAS_sh_get_var cwd_buf = state->sh_get_var ? xstrdup(state->sh_get_var("PWD")) : xrealloc_getcwd_or_warn(NULL); -#else +# else cwd_buf = xrealloc_getcwd_or_warn(NULL); -#endif +# endif if (!cwd_buf) cwd_buf = (char *)bb_msg_unknown; else if ((home = get_homedir_or_NULL()) != NULL && home[0]) { diff --git a/shell/ash.c b/shell/ash.c index 326f8b2a9..99fdbce7b 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -9736,7 +9736,7 @@ evalpipe(union node *n, int flags) } /* setinteractive needs this forward reference */ -#if ENABLE_FEATURE_EDITING +#if ENABLE_FEATURE_TAB_COMPLETION static const char *get_builtin_name(int i) FAST_FUNC; #endif @@ -9773,8 +9773,12 @@ setinteractive(int on) #if ENABLE_FEATURE_EDITING if (!line_input_state) { line_input_state = new_line_input_t(FOR_SHELL | WITH_PATH_LOOKUP); +# if ENABLE_FEATURE_TAB_COMPLETION line_input_state->get_exe_name = get_builtin_name; +# endif +# if EDITING_HAS_sh_get_var line_input_state->sh_get_var = lookupvar; +# endif } #endif } @@ -10283,7 +10287,7 @@ find_builtin(const char *name) return bp; } -#if ENABLE_FEATURE_EDITING +#if ENABLE_FEATURE_TAB_COMPLETION static const char * FAST_FUNC get_builtin_name(int i) { diff --git a/shell/hush.c b/shell/hush.c index 051b123e7..693099209 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -8188,7 +8188,7 @@ static const struct built_in_command *find_builtin(const char *name) return find_builtin_helper(name, bltins2, &bltins2[ARRAY_SIZE(bltins2)]); } -#if ENABLE_HUSH_JOB && ENABLE_FEATURE_EDITING +#if ENABLE_HUSH_JOB && ENABLE_FEATURE_TAB_COMPLETION static const char * FAST_FUNC get_builtin_name(int i) { if (/*i >= 0 && */ i < ARRAY_SIZE(bltins1)) { @@ -10668,8 +10668,12 @@ int hush_main(int argc, char **argv) # if ENABLE_FEATURE_EDITING G.line_input_state = new_line_input_t(FOR_SHELL); +# if ENABLE_FEATURE_TAB_COMPLETION G.line_input_state->get_exe_name = get_builtin_name; +# endif +# if EDITING_HAS_sh_get_var G.line_input_state->sh_get_var = get_local_var_value; +# endif # endif # if ENABLE_HUSH_SAVEHISTORY && MAX_HISTORY > 0 { From vda.linux at googlemail.com Tue Jan 3 12:39:14 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 13:39:14 +0100 Subject: [git commit] ash: trivial code shrink Message-ID: <20230103124339.166A48718E@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=d488a5218b378631ab78c3358dab9498426bc777 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- shell/ash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index 99fdbce7b..18ccc1329 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -10018,7 +10018,7 @@ mklocal(char *name, int flags) setvareq(name, flags); else /* "local VAR" unsets VAR: */ - setvar0(name, NULL); + unsetvar(name); } } lvp->vp = vp; From vda.linux at googlemail.com Tue Jan 3 13:08:18 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 14:08:18 +0100 Subject: [git commit] hush: code shrink Message-ID: <20230103130830.66F5D872F5@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=969e00816835769429fcd98046313f66b1c194fb branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master function old new delta run_list 1032 1012 -20 Signed-off-by: Denys Vlasenko --- shell/hush.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/shell/hush.c b/shell/hush.c index 693099209..d111f0cc5 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -2460,10 +2460,15 @@ static int set_local_var(char *str, unsigned flags) return retval; } +static int set_local_var0(char *str) +{ + return set_local_var(str, 0); +} + static void FAST_FUNC set_local_var_from_halves(const char *name, const char *val) { char *var = xasprintf("%s=%s", name, val); - set_local_var(var, /*flag:*/ 0); + set_local_var0(var); } /* Used at startup and after each cd */ @@ -6964,7 +6969,7 @@ static NOINLINE int expand_one_var(o_string *output, int n, val = NULL; } else { char *new_var = xasprintf("%s=%s", var, val); - set_local_var(new_var, /*flag:*/ 0); + set_local_var0(new_var); } } } @@ -9373,7 +9378,7 @@ static NOINLINE int run_pipe(struct pipe *pi) } #endif debug_printf_env("set shell var:'%s'->'%s'\n", *argv, p); - if (set_local_var(p, /*flag:*/ 0)) { + if (set_local_var0(p)) { /* assignment to readonly var / putenv error? */ rcode = 1; } @@ -9856,7 +9861,7 @@ static int run_list(struct pipe *pi) } /* Insert next value from for_lcur */ /* note: *for_lcur already has quotes removed, $var expanded, etc */ - set_local_var(xasprintf("%s=%s", pi->cmds[0].argv[0], *for_lcur++), /*flag:*/ 0); + set_local_var_from_halves(pi->cmds[0].argv[0], *for_lcur++); continue; } if (rword == RES_IN) { From vda.linux at googlemail.com Tue Jan 3 14:15:41 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 15:15:41 +0100 Subject: [git commit] Bump version to 1.36.0 Message-ID: <20230103143219.8516A87305@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=70f77e4617e06077231b8b63c3fb3406d7f8865d branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 503475fe9..503af6941 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 1 PATCHLEVEL = 36 SUBLEVEL = 0 -EXTRAVERSION = .git +EXTRAVERSION = NAME = Unnamed # *DOCUMENTATION* From vda.linux at googlemail.com Tue Jan 3 14:32:00 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 15:32:00 +0100 Subject: [git commit] Start 1.37.0 development cycle Message-ID: <20230103143219.9400387306@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=b1884deb514c35289d37e7bfbf23f770b0bd09b3 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 503af6941..7b4686fc8 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 1 -PATCHLEVEL = 36 +PATCHLEVEL = 37 SUBLEVEL = 0 -EXTRAVERSION = +EXTRAVERSION = .git NAME = Unnamed # *DOCUMENTATION* From vda.linux at googlemail.com Tue Jan 3 14:32:33 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 15:32:33 +0100 Subject: [git commit] Announce 1.36.0 Message-ID: <20230103143250.9D47387309@busybox.osuosl.org> commit: https://git.busybox.net/busybox-website/commit/?id=c0f21d5d3c1a7b08d3f5952df49afe3de27a23e9 branch: https://git.busybox.net/busybox-website/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- news.html | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) diff --git a/news.html b/news.html index 33c628a..e859d3f 100644 --- a/news.html +++ b/news.html @@ -34,6 +34,207 @@

+
  • 3 January 2023 -- BusyBox 1.36.0 (unstable) +

    BusyBox 1.36.0. + (git, + patches, + how to add a patch)

    + +

    Sizes of busybox-1.35.0 and busybox-1.36.0 (with equivalent config, static uclibc build):

    +   text	   data	    bss	    dec	    hex	filename
    +1044070	    908	  14328	1059306	 1029ea	busybox-1.35.0
    +1046317	    908	  14328	1061553	 1032b1	busybox-1.36.0
    +
    +

    + +

    Changes since previous release: +

    Aaro Koskinen:
    +      devmem: add 128-bit width
    +
    +Bernhard Reutner-Fischer (3):
    +      kbuild: fix building sha256
    +      kbuild: Prefer -Oz over -Os
    +      seedrng: manually inline seed_rng
    +
    +Brandon Maier:
    +      xxd: fix typo in trivial usage
    +
    +Dario Binacchi (2):
    +      fbset: abort on not handled options
    +      fbset: support setting pixel clock rate
    +
    +David Leonard:
    +      tsort: new applet
    +
    +Denys Vlasenko:
    +      Makefile.flags: add resolv to LDLIBS for linux compilers too (not only gnu ones)
    +      build system: detect if build host has no bzip2
    +      libbb/loop: fix compile failure (name collision)
    +      libbb/loop: optionally use ioctl(LOOP_CONFIGURE) to set up loopdevs
    +      libbb/loop: restore the correct return vaule of set_loop()
    +      libbb/sha1: add config-selectable fully unrolled version, closes 14391
    +      libbb/sha1: add config-selectable partially unrolled version
    +      libbb/sha1: assembly versions for x86
    +      libbb/sha1: optional x86 hardware accelerated hashing
    +      libbb/sha256: optional x86 hardware accelerated hashing
    +      libbb: change xstrndup, xmemdup to take size_t as size parameter
    +      libbb: factor out fflush_stdout_and_exit(EXIT_SUCCESS)
    +      libbb: fflush_stdout_and_exit(0) still exits with _error_ (not 0!) if fflush fails
    +      libbb: fix fallout from nth_string() robustification, closes 14726
    +      libbb: introduce and use chdir_or_warn()
    +      libbb: invert the meaning of SETUP_ENV_NO_CHDIR -> SETUP_ENV_CHDIR
    +      tls: P256: remove NOP macro sp_256_norm_8()
    +      tls: include signature_algorithms extension in client hello message
    +      examples/var_service/dhcp_if: make helper scripts more talkative
    +      testsuite/mount.tests: accomodate umount failure seen on 5.18.0
    +      testsuite/sha1sum.tests: fix false positive failure
    +      testsuite/tree.tests: fix false positive failure
    +      shell: add comments about SIGINT-related problems
    +      shell: fix compile failures in some configs
    +      ash,hush: fix handling of SIGINT while waiting for interactive input
    +      ash: ^C with SIG_INGed SIGINT should not exit the shell
    +      ash: do not truncate failed tilde expansion on unknown user names
    +      ash: fix ifs cleanup on error paths
    +      ash: fix unsafe use of mempcpy
    +      ash: fix use-after-free in pattern substituon code
    +      awk: input numbers are never octal or hex (only program consts can be)
    +      bc: hopefully fix bug 14956 (use-after-free)
    +      cut: build fix for FEATURE_CUT_REGEX
    +      ifplugd: split -a into -a and -A, latter disables upping in iface creation
    +      init: do not set HOME
    +      ls: implement ls -sh (human-readable allocated blocks)
    +      md5/shaXsum: use FEATURE_COPYBUF_KB to size the buffer instead of fixed 4k
    +      mv: fix error in !VERBOSE configs
    +      nmeter: %[md] %[mw] - dirty file-backed pages, writeback pages
    +      powertop: fix cpuid asm: ebx saving/restoring is properly done by gcc
    +      scripts/echo.c: fix NUL handling in "abc\0 def"
    +      sed: correctly handle 'w FILE' commands writing to the same file
    +      sed: fix double-free in FEATURE_CLEAN_UP=y configs
    +      sed: fix handling of escaped delimiters in s/// replacement
    +      sed: fix handling of escaped delimiters in s/// search pattern, closes 14541
    +      seedrng: chdir to the SEED_DIRECTORY - avoid concat_path_file's
    +      seedrng: do not hash in a constant string, it's not adding entropy
    +      seedrng: do not hash lengths, they are very predictable
    +      seedrng: do not try to continue on unexpected errors (just exit)
    +      seedrng: explain why we need locking and fsync'ing
    +      seedrng: include file/dir names in error messages
    +      seedrng: it's not a part of util-linux, move to miscutils
    +      seedrng: prepare read_new_seed() to not need a "success" retval
    +      seedrng: re-add fsync after unlink, and explain its purpose
    +      seedrng: reduce MAX_SEED_LEN from 512 to 256
    +      seedrng: remove redundant assignment
    +      seedrng: remove unnecessary zero-filling of local variables
    +      seedrng: restore error check on fsync
    +      seedrng: simplify read_new_seed() to not have error return
    +      seedrng: use more xfuncs where appropriate
    +      shaNNNsum: accept one-space "HASH FILENAME" format for -c, closes 14866
    +      sort: fix -k2M (wasn't skipping leading whitespace)
    +      sort: fix -s -r interaction: 'stable' order is not affected by -r
    +      sort: fix sort -s -u, closes 14871
    +      sort: support -h
    +      sulogin: increase util-linux compatibility
    +      sulogin: start _login_ shell only with -p
    +      sulogin: util-linux does not say "normal startup" on Ctrl-D
    +      taskset: fix printf format mismatch in !FEATURE_TASKSET_FANCY config. closes 14616
    +      top: fix display of large PID/PPID
    +      top: improve large PID display in memory ('s') mode
    +      tree: make it unicode-aware
    +      tree: unicode tweak (use normal space char, 0x20)
    +      udhcpc6: add missed big-endian conversions
    +      udhcpc6: align FF02__1_2[]
    +      udhcpc6: downgrade "opening listen socket" log level to 2
    +      udhcpc6: fix binding to network aliases
    +      udhcpc6: fix sending of renew messages
    +      udhcpc6: use a different default config script
    +      xargs: implement -o, closes 15146
    +      xxd -r: handle offsets
    +      xxd -r: without -p, stop at more than one whitespace, closes 14786
    +      xxd: fix use of non-initialized data
    +      xxd: use bb_simple_perror_msg... where appropriate
    +
    +Emanuele Giacomelli:
    +      XXXsum: handle binary sums with " " in the path
    +
    +Grob Grobmann:
    +      vi: add 'ZQ' quitting command
    +
    +Henrique Rodrigues:
    +      ping: fix typo in --help text
    +
    +Jason A. Donenfeld (10):
    +      seedrng: import SeedRNG utility for kernel RNG seed files
    +      seedrng: use libbb functions
    +      seedrng: hoist bb_strtoul out of min/max
    +      seedrng: remove some global variables
    +      seedrng: further reduce size
    +      seedrng: use predefined strings where possible
    +      seedrng: avoid needless runtime strlen() call
    +      seedrng: compress format strings with %s arguments
    +      seedrng: code-golf even smaller
    +      seedrng: prune header includes
    +
    +Khem Raj:
    +      apply const trick to ptr_to_globals
    +
    +Louis Sautier:
    +      pkill: add -e to display the name and PID of the process being killed
    +
    +Ludwig Nussel:
    +      libbb: mark stack in assembly files read-only
    +
    +Natanael Copa (2):
    +      awk: fix use after free (CVE-2022-30065)
    +      more: accept and ignore -e
    +
    +Paul Fox:
    +      crond: implement support for setting PATH in crontab files
    +
    +Peter Kaestle:
    +      unzip -l: add missed big-endian conversions date and time
    +
    +Roger Knecht:
    +      tree: new applet
    +
    +Ron Yorston (8):
    +      vi: improved handling of backspace in replace mode
    +      vi: fix backspace over tab in commands
    +      libbb: restore special handling of nomsg errors
    +      ash,hush: use HOME for tab completion and prompts
    +      vi: fix regression in autoindent handling
    +      vi: handle autoindent in 'cc' command
    +      lineedit: get PWD from ash
    +      libbb: make '--help' handling more consistent
    +
    +Samuel Thibault:
    +      Fix non-Linux builds
    +
    +Shawn Landden:
    +      ash: optional sleep builtin
    +
    +S??ren Tempel (3):
    +      ed: add support for -s command-line option as mandated by POSIX
    +      ash: don't read past end of var in subvareval for bash substitutions
    +      ash: fix use-after-free in bash pattern substitution
    +
    +Timo Ter??s:
    +      mkfs.vfat: fix volume label to be padded with space
    +
    +Vincent Stehl??:
    +      fdisk: recognize EBBR protective partitions
    +
    +Walter Lozano:
    +      Add support for long options to cmp
    +
    +Xiaoming Ni (4):
    +      loop: fix a race when a free loop device is snatched
    +      loop: refactor: extract subfunction get_next_free_loop()
    +      loop: simplify code of LOOP_SET_FD failure
    +      loop: refactor: extract subfunction set_loopdev_params()
    +
    +
    +

    +
  • +
  • 26 December 2021 -- BusyBox 1.35.0 (unstable)

    BusyBox 1.35.0. (git, From vda.linux at googlemail.com Tue Jan 3 16:11:37 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 17:11:37 +0100 Subject: [git commit] typo fix; remove uninteresting changelog entry Message-ID: <20230103161210.075B887310@busybox.osuosl.org> commit: https://git.busybox.net/busybox-website/commit/?id=0b52d2d12f63892c13d2f9f94774562e94eb6a57 branch: https://git.busybox.net/busybox-website/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- news.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/news.html b/news.html index e859d3f..a6430d6 100644 --- a/news.html +++ b/news.html @@ -71,7 +71,7 @@ Denys Vlasenko: build system: detect if build host has no bzip2 libbb/loop: fix compile failure (name collision) libbb/loop: optionally use ioctl(LOOP_CONFIGURE) to set up loopdevs - libbb/loop: restore the correct return vaule of set_loop() + libbb/loop: restore the correct return value of set_loop() libbb/sha1: add config-selectable fully unrolled version, closes 14391 libbb/sha1: add config-selectable partially unrolled version libbb/sha1: assembly versions for x86 @@ -88,7 +88,6 @@ Denys Vlasenko: examples/var_service/dhcp_if: make helper scripts more talkative testsuite/mount.tests: accomodate umount failure seen on 5.18.0 testsuite/sha1sum.tests: fix false positive failure - testsuite/tree.tests: fix false positive failure shell: add comments about SIGINT-related problems shell: fix compile failures in some configs ash,hush: fix handling of SIGINT while waiting for interactive input From vda.linux at googlemail.com Tue Jan 3 17:12:43 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 3 Jan 2023 18:12:43 +0100 Subject: [git commit] typo fix Message-ID: <20230103171306.92E2B87318@busybox.osuosl.org> commit: https://git.busybox.net/busybox-website/commit/?id=77d5de74b904136d1d3c9eb1452577fba5148bbf branch: https://git.busybox.net/busybox-website/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- news.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news.html b/news.html index a6430d6..d7d54fb 100644 --- a/news.html +++ b/news.html @@ -95,7 +95,7 @@ Denys Vlasenko: ash: do not truncate failed tilde expansion on unknown user names ash: fix ifs cleanup on error paths ash: fix unsafe use of mempcpy - ash: fix use-after-free in pattern substituon code + ash: fix use-after-free in pattern substitution code awk: input numbers are never octal or hex (only program consts can be) bc: hopefully fix bug 14956 (use-after-free) cut: build fix for FEATURE_CUT_REGEX From vda.linux at googlemail.com Wed Jan 4 01:01:28 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Wed, 4 Jan 2023 02:01:28 +0100 Subject: [git commit] Further tweak the release message Message-ID: <20230104010144.2375B873AF@busybox.osuosl.org> commit: https://git.busybox.net/busybox-website/commit/?id=65f778d5123dd139278ef03d456cf8a2f829579b branch: https://git.busybox.net/busybox-website/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- news.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/news.html b/news.html index d7d54fb..f986ea7 100644 --- a/news.html +++ b/news.html @@ -40,6 +40,8 @@ patches, how to add a patch)

    +

    Note: udhcpc6 now uses a different helper script by default (/usr/share/udhcpc/default6.script).

    +

    Sizes of busybox-1.35.0 and busybox-1.36.0 (with equivalent config, static uclibc build):

        text	   data	    bss	    dec	    hex	filename
     1044070	    908	  14328	1059306	 1029ea	busybox-1.35.0
    @@ -69,6 +71,7 @@ David Leonard:
     Denys Vlasenko:
           Makefile.flags: add resolv to LDLIBS for linux compilers too (not only gnu ones)
           build system: detect if build host has no bzip2
    +      scripts/echo.c: fix NUL handling in "abc\0 def"
           libbb/loop: fix compile failure (name collision)
           libbb/loop: optionally use ioctl(LOOP_CONFIGURE) to set up loopdevs
           libbb/loop: restore the correct return value of set_loop()
    @@ -106,7 +109,6 @@ Denys Vlasenko:
           mv: fix error in !VERBOSE configs
           nmeter: %[md] %[mw] - dirty file-backed pages, writeback pages
           powertop: fix cpuid asm: ebx saving/restoring is properly done by gcc
    -      scripts/echo.c: fix NUL handling in "abc\0 def"
           sed: correctly handle 'w FILE' commands writing to the same file
           sed: fix double-free in FEATURE_CLEAN_UP=y configs
           sed: fix handling of escaped delimiters in s/// replacement
    @@ -117,8 +119,6 @@ Denys Vlasenko:
           seedrng: do not try to continue on unexpected errors (just exit)
           seedrng: explain why we need locking and fsync'ing
           seedrng: include file/dir names in error messages
    -      seedrng: it's not a part of util-linux, move to miscutils
    -      seedrng: prepare read_new_seed() to not need a "success" retval
           seedrng: re-add fsync after unlink, and explain its purpose
           seedrng: reduce MAX_SEED_LEN from 512 to 256
           seedrng: remove redundant assignment
    @@ -195,14 +195,14 @@ Roger Knecht:
           tree: new applet
     
     Ron Yorston (8):
    -      vi: improved handling of backspace in replace mode
    -      vi: fix backspace over tab in commands
           libbb: restore special handling of nomsg errors
    +      libbb: make '--help' handling more consistent
    +      lineedit: get PWD from ash
           ash,hush: use HOME for tab completion and prompts
           vi: fix regression in autoindent handling
           vi: handle autoindent in 'cc' command
    -      lineedit: get PWD from ash
    -      libbb: make '--help' handling more consistent
    +      vi: improved handling of backspace in replace mode
    +      vi: fix backspace over tab in commands
     
     Samuel Thibault:
           Fix non-Linux builds
    @@ -229,7 +229,6 @@ Xiaoming Ni (4):
           loop: refactor: extract subfunction get_next_free_loop()
           loop: simplify code of LOOP_SET_FD failure
           loop: refactor: extract subfunction set_loopdev_params()
    -
     

  • From vda.linux at googlemail.com Thu Jan 5 15:21:48 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Thu, 5 Jan 2023 16:21:48 +0100 Subject: [git commit] ed: don't use memcpy with overlapping memory regions Message-ID: <20230105152201.3303E87635@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=ca96022d6edaaf619324db5a481698231d74d1df branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master The memcpy invocations in the subCommand function, modified by this commit, previously used memcpy with overlapping memory regions. This is undefined behavior. On Alpine Linux, it causes BusyBox ed to crash since we compile BusyBox with -D_FORTIFY_SOURCE=2 and our fortify-headers implementation catches this source of undefined behavior [0]. The issue can only be triggered if the replacement string is the same size or shorter than the old string. Looking at the code, it seems to me that a memmove(3) is what was actually intended here, this commit modifies the code accordingly. [0]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13504 Signed-off-by: S??ren Tempel Signed-off-by: Denys Vlasenko --- editors/ed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editors/ed.c b/editors/ed.c index 209ce9942..4a84f7433 100644 --- a/editors/ed.c +++ b/editors/ed.c @@ -720,7 +720,7 @@ static void subCommand(const char *cmd, int num1, int num2) if (deltaLen <= 0) { memcpy(&lp->data[offset], newStr, newLen); if (deltaLen) { - memcpy(&lp->data[offset + newLen], + memmove(&lp->data[offset + newLen], &lp->data[offset + oldLen], lp->len - offset - oldLen); From vda at busybox.net Tue Jan 3 14:15:41 2023 From: vda at busybox.net (Denys Vlasenko) Date: Tue, 3 Jan 2023 15:15:41 +0100 Subject: [branch/1_36_stable] new branch created Message-ID: <20230105152431.0864A87636@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=70f77e4617e06077231b8b63c3fb3406d7f8865d branch: https://git.busybox.net/busybox/commit/?id=refs/heads/1_36_stable From vda.linux at googlemail.com Thu Jan 5 15:26:49 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Thu, 5 Jan 2023 16:26:49 +0100 Subject: [git commit branch/1_36_stable] ed: don't use memcpy with overlapping memory regions Message-ID: <20230105152716.1348687638@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=f15dfd86c4fba78881071dd0f5c63466fa9737a2 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/1_36_stable The memcpy invocations in the subCommand function, modified by this commit, previously used memcpy with overlapping memory regions. This is undefined behavior. On Alpine Linux, it causes BusyBox ed to crash since we compile BusyBox with -D_FORTIFY_SOURCE=2 and our fortify-headers implementation catches this source of undefined behavior [0]. The issue can only be triggered if the replacement string is the same size or shorter than the old string. Looking at the code, it seems to me that a memmove(3) is what was actually intended here, this commit modifies the code accordingly. [0]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13504 Signed-off-by: S??ren Tempel Signed-off-by: Denys Vlasenko --- editors/ed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editors/ed.c b/editors/ed.c index 209ce9942..4a84f7433 100644 --- a/editors/ed.c +++ b/editors/ed.c @@ -720,7 +720,7 @@ static void subCommand(const char *cmd, int num1, int num2) if (deltaLen <= 0) { memcpy(&lp->data[offset], newStr, newLen); if (deltaLen) { - memcpy(&lp->data[offset + newLen], + memmove(&lp->data[offset + newLen], &lp->data[offset + oldLen], lp->len - offset - oldLen); From bugzilla at busybox.net Sat Jan 7 13:48:04 2023 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Sat, 07 Jan 2023 13:48:04 +0000 Subject: [Bug 6242] rpc: switch to libtirpc In-Reply-To: References: Message-ID: https://bugs.busybox.net/show_bug.cgi?id=6242 --- Comment #4 from 306595428 at qq.com <306595428 at qq.com> --- how to switch rpc to libtirpc ? thanks! -- You are receiving this mail because: You are on the CC list for the bug. From bugzilla at busybox.net Sat Jan 7 13:55:13 2023 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Sat, 07 Jan 2023 13:55:13 +0000 Subject: [Bug 4562] need to link against libtirpc with FEATURE_MOUNT_NFS and glibc-2.14+ In-Reply-To: References: Message-ID: https://bugs.busybox.net/show_bug.cgi?id=4562 --- Comment #8 from 306595428 at qq.com <306595428 at qq.com> --- (In reply to Denys Vlasenko from comment #5) how to do it? i had add CONFIG_EXTRA_LDLIBS: libtirpc and tirpc, the result also is failed. -- You are receiving this mail because: You are on the CC list for the bug. From bugzilla at busybox.net Sun Jan 8 20:30:06 2023 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Sun, 08 Jan 2023 20:30:06 +0000 Subject: [Bug 15236] New: [1.36] SIGILL on accessing sha256 on some CPUs Message-ID: https://bugs.busybox.net/show_bug.cgi?id=15236 Bug ID: 15236 Summary: [1.36] SIGILL on accessing sha256 on some CPUs Product: Busybox Version: unspecified Hardware: All OS: Linux Status: NEW Severity: normal Priority: P5 Component: Other Assignee: unassigned at busybox.net Reporter: tonistiigi at gmail.com CC: busybox-cvs at busybox.net, vda.linux at googlemail.com Target Milestone: --- Since 1.36, accessing sha256sum sometimes errors "illegal instruction". v1.35 seems to work properly. This can be demonstrated in Github Actions infra, which schedules jobs on different types of CPUs, causing them to fail when they hit the wrong one. Please see https://github.com/tonistiigi/gh-busybox-sigill-debug/actions/runs/3858482123/jobs/6577057476 for logs. In GH infra: Good CPUs: 8370C, E5-2673 Bad CPUs: 8171M, 8272CL Likely regression from https://github.com/mirror/busybox/commit/6472ac942898437e040171cec991de1c0b962f72 but didn't verify. -- You are receiving this mail because: You are on the CC list for the bug. From bugzilla at busybox.net Wed Jan 11 17:02:45 2023 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Wed, 11 Jan 2023 17:02:45 +0000 Subject: [Bug 14226] Busybox md5sum fails to support backslashes in filenames In-Reply-To: References: Message-ID: https://bugs.busybox.net/show_bug.cgi?id=14226 --- Comment #1 from tlaurion --- The same behavior applies to sha256sum -c For example (taken out of https://github.com/osresearch/heads/pull/1262#issuecomment-1377744973) cd /boot mkdir "$(echo -e 'hidden dir\b\b\b\b\b\b\b\b\b\bshowed dir')" cd *hidden* touch "$(echo -e 'file with newline\ncharacter')" touch "file with textual new\nline" find ./ -type f ! -path './kexec*' -print0 | xargs -0 sha256sum > /tmp/test sha256sum -c /tmp/test | grep -v 'OK' sha256sum: can't open './showed dir/file with newline': No such file or directory ./showed dir/file with newline: FAILED sha256sum: WARNING: 2 of 340 computed checksums did NOT match cat /tmp/test (exerpt) e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./showed dir/file with textual new\nline e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./showed dir/file with newline character cat /tmp/test | grep show e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./showed dir/file with textual new\nline e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./showed dir/file with newline ls (exerpt) hidden dir??????????showed dir /boot # cd *hidden* /boot/showed dir # ls file with newline?character file with textual new\nline ---- This impacts more than mda5/sha256: this extends to ls and other busybox applets -- You are receiving this mail because: You are on the CC list for the bug. From bugzilla at busybox.net Fri Jan 13 01:25:36 2023 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Fri, 13 Jan 2023 01:25:36 +0000 Subject: [Bug 15256] New: ash treats SIGWINCH as typed newline Message-ID: https://bugs.busybox.net/show_bug.cgi?id=15256 Bug ID: 15256 Summary: ash treats SIGWINCH as typed newline Product: Busybox Version: unspecified Hardware: All OS: Linux Status: NEW Severity: normal Priority: P5 Component: Other Assignee: unassigned at busybox.net Reporter: elly at elly.town CC: busybox-cvs at busybox.net Target Milestone: --- As the summary says. If you start ash, then resize the window it's in, ash acts as though you had typed a blank line. To reproduce this without resizing a window, you can start ash in one terminal then send SIGWINCH to it from another terminal; ash reacts by re-displaying the prompt on a new line as though an empty line had been typed. This was introduced some time between 1_35_stable and 1_36_stable, maybe by 12566e7f9b5e5c5d445bc4d36991d134b431dc6c. -- You are receiving this mail because: You are on the CC list for the bug. From vda.linux at googlemail.com Tue Jan 17 15:48:54 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 17 Jan 2023 16:48:54 +0100 Subject: [git commit] ntpd: make NTP client and server Y2036/2038-ready Message-ID: <20230117160249.9B0D587C46@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=85acf71d2579ebe4eec05c6f31901adffa700adc branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master The 32-bit integer part of the NTP timestamp overflows in year 2036, which starts the second NTP era. Modify the timestamp conversion to shift values between 1900-1970 (in the first era) to the second era to enable the client to measure its offset correctly until year 2106 (assuming 64-bit time_t). Also update the conversion from double used when stepping the clock to work with 64-bit time_t after reaching the maximum 32-bit value in 2038 and the server conversion to work correctly in the next NTP era. function old new delta lfp_to_d 51 64 +13 step_time 326 332 +6 .rodata 105260 105264 +4 d_to_lfp 100 86 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 23/-14) Total: 9 bytes Signed-off-by: Miroslav Lichvar Signed-off-by: Denys Vlasenko --- networking/ntpd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/networking/ntpd.c b/networking/ntpd.c index 204e1d7c2..4365166ff 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -554,7 +554,7 @@ gettime1900d(void) static void d_to_tv(struct timeval *tv, double d) { - tv->tv_sec = (long)d; + tv->tv_sec = (time_t)d; tv->tv_usec = (d - tv->tv_sec) * 1000000; } @@ -565,6 +565,14 @@ lfp_to_d(l_fixedpt_t lfp) lfp.int_partl = ntohl(lfp.int_partl); lfp.fractionl = ntohl(lfp.fractionl); ret = (double)lfp.int_partl + ((double)lfp.fractionl / UINT_MAX); + /* + * Shift timestamps before 1970 to the second NTP era (2036-2106): + * int_partl value of OFFSET_1900_1970 (2208988800) is interpreted as + * the start of year 1970 and it is the minimal representable time, + * all values form the sequence 2208988800..0xffffffff,0..2208988799. + */ + if (lfp.int_partl < OFFSET_1900_1970) + ret += (double)(1ULL << 32); /* because int_partl is 32-bit wide */ return ret; } static NOINLINE double @@ -582,8 +590,8 @@ d_to_lfp(l_fixedpt_t *lfp, double d) { uint32_t intl; uint32_t frac; - intl = (uint32_t)d; - frac = (uint32_t)((d - intl) * UINT_MAX); + intl = (uint32_t)(time_t)d; + frac = (uint32_t)((d - (time_t)d) * UINT_MAX); lfp->int_partl = htonl(intl); lfp->fractionl = htonl(frac); } From vda.linux at googlemail.com Tue Jan 17 16:01:05 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 17 Jan 2023 17:01:05 +0100 Subject: [git commit] ntpd: correct fixed->float conversions of fractions Message-ID: <20230117160249.A5F9087634@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=c344ca6c7f5d8468624ae518d2912d1d9612cb91 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Need to divide by (1<<32), not by (1<<32)-1. Fraction of 0xffffffff is not 1 whole second. function old new delta .rodata 105264 105268 +4 Signed-off-by: Denys Vlasenko --- networking/ntpd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/networking/ntpd.c b/networking/ntpd.c index 4365166ff..ff49550e9 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -564,7 +564,7 @@ lfp_to_d(l_fixedpt_t lfp) double ret; lfp.int_partl = ntohl(lfp.int_partl); lfp.fractionl = ntohl(lfp.fractionl); - ret = (double)lfp.int_partl + ((double)lfp.fractionl / UINT_MAX); + ret = (double)lfp.int_partl + ((double)lfp.fractionl / (1ULL << 32)); /* * Shift timestamps before 1970 to the second NTP era (2036-2106): * int_partl value of OFFSET_1900_1970 (2208988800) is interpreted as @@ -581,7 +581,7 @@ sfp_to_d(s_fixedpt_t sfp) double ret; sfp.int_parts = ntohs(sfp.int_parts); sfp.fractions = ntohs(sfp.fractions); - ret = (double)sfp.int_parts + ((double)sfp.fractions / USHRT_MAX); + ret = (double)sfp.int_parts + ((double)sfp.fractions / (1 << 16)); return ret; } #if ENABLE_FEATURE_NTPD_SERVER @@ -591,7 +591,7 @@ d_to_lfp(l_fixedpt_t *lfp, double d) uint32_t intl; uint32_t frac; intl = (uint32_t)(time_t)d; - frac = (uint32_t)((d - (time_t)d) * UINT_MAX); + frac = (uint32_t)((d - (time_t)d) * 0xffffffff); lfp->int_partl = htonl(intl); lfp->fractionl = htonl(frac); } @@ -601,7 +601,7 @@ d_to_sfp(s_fixedpt_t *sfp, double d) uint16_t ints; uint16_t frac; ints = (uint16_t)d; - frac = (uint16_t)((d - ints) * USHRT_MAX); + frac = (uint16_t)((d - ints) * 0xffff); sfp->int_parts = htons(ints); sfp->fractions = htons(frac); } From vda at busybox.net Wed Jan 18 16:38:26 2023 From: vda at busybox.net (Denys Vlasenko) Date: Wed, 18 Jan 2023 16:38:26 -0000 Subject: [tag/1_36_0] new tag created Message-ID: <20230118163825.9D79487CAA@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=70f77e4617e06077231b8b63c3fb3406d7f8865d tag: https://git.busybox.net/busybox/commit/?id=refs/tags/1_36_0 Bump version to 1.36.0 From vda.linux at googlemail.com Wed Jan 18 17:04:22 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Wed, 18 Jan 2023 18:04:22 +0100 Subject: [git commit] ntpd: correct comment: 2^-20 is ~1 microsecond (confused with 10^-20) Message-ID: <20230118170547.AEFFE87C45@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=1040f78176c7dad57aadbbd023e8ac094606ac25 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- networking/ntpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networking/ntpd.c b/networking/ntpd.c index db04eb272..c7519b8fb 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -1040,7 +1040,7 @@ step_time(double offset) /* This code adds floating point value on the order of 1.0 * to a value of ~4 billion (as of years 203x). * With 52-bit mantissa, "only" 20 bits of offset's precision - * are used (0.01 attosecond), the rest is lost. + * are used (~1 microsecond), the rest is lost. * Some 200 billion years later, when tvc.tv_sec would have * 63 significant bits, the precision loss would be catastrophic, * a more complex code would be needed. From vda.linux at googlemail.com Wed Jan 18 16:42:17 2023 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Wed, 18 Jan 2023 17:42:17 +0100 Subject: [git commit] ntpd: fold d_to_tv() into its only caller Message-ID: <20230118170547.A5A1987CEE@busybox.osuosl.org> commit: https://git.busybox.net/busybox/commit/?id=479bd7af0d24d123326c1ceb447e015e9e2955d7 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master Signed-off-by: Denys Vlasenko --- networking/ntpd.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/networking/ntpd.c b/networking/ntpd.c index ff49550e9..db04eb272 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -551,13 +551,6 @@ gettime1900d(void) return G.cur_time; } -static void -d_to_tv(struct timeval *tv, double d) -{ - tv->tv_sec = (time_t)d; - tv->tv_usec = (d - tv->tv_sec) * 1000000; -} - static NOINLINE double lfp_to_d(l_fixedpt_t lfp) { @@ -1044,8 +1037,17 @@ step_time(double offset) time_t tval; xgettimeofday(&tvc); + /* This code adds floating point value on the order of 1.0 + * to a value of ~4 billion (as of years 203x). + * With 52-bit mantissa, "only" 20 bits of offset's precision + * are used (0.01 attosecond), the rest is lost. + * Some 200 billion years later, when tvc.tv_sec would have + * 63 significant bits, the precision loss would be catastrophic, + * a more complex code would be needed. + */ dtime = tvc.tv_sec + (1.0e-6 * tvc.tv_usec) + offset; - d_to_tv(&tvn, dtime); + tvn.tv_sec = (time_t)dtime; + tvn.tv_usec = (dtime - tvn.tv_sec) * 1000000; xsettimeofday(&tvn); VERB2 { From bugzilla at busybox.net Thu Jan 19 16:23:43 2023 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Thu, 19 Jan 2023 16:23:43 +0000 Subject: [Bug 15256] ash treats SIGWINCH as typed newline In-Reply-To: References: Message-ID: https://bugs.busybox.net/show_bug.cgi?id=15256 --- Comment #1 from maribu --- Created attachment 9466 --> https://bugs.busybox.net/attachment.cgi?id=9466&action=edit proposed fix Hi, the attached patch seems to fix the issue for me. Cheers -- You are receiving this mail because: You are on the CC list for the bug. From bugzilla at busybox.net Thu Jan 19 16:27:52 2023 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Thu, 19 Jan 2023 16:27:52 +0000 Subject: [Bug 15261] New: Feature request for mount. Add options -L/-U Message-ID: https://bugs.busybox.net/show_bug.cgi?id=15261 Bug ID: 15261 Summary: Feature request for mount. Add options -L/-U Product: Busybox Version: 1.35.x Hardware: All OS: Linux Status: NEW Severity: normal Priority: P5 Component: Other Assignee: unassigned at busybox.net Reporter: jbleyel at gmx.net CC: busybox-cvs at busybox.net Target Milestone: --- Feature request for mount. Can you please add the -L and -U option to mount like the linux mount command. -L, --label