[PATCH] tsort: new applet

2022-02-20 Thread David Leonard
/tsort.tests | 110 + 3 files changed, 307 insertions(+), 1 deletion(-) create mode 100644 coreutils/tsort.c create mode 100755 testsuite/tsort.testsFrom d398d3dbfd8d1356137d574fd168a61cf58898c2 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Sun, 20 Feb 2022 14:29:45 +1000

Re: [PATCH] tsort: new applet

2022-02-20 Thread David Leonard
INY bb_error_msg("cycle at %s", G.nodes[i]->name); + fprintf(stderr, "tsort: cycle at %s\n", G.nodes[i]->name); +#endifFrom 354deec608184a9d82ad117328eff4b3c60f300d Mon Sep 17 00:00:00 2001 From: David Leonard Date: Sun, 20 Feb 2022 14:29:45 +1000 Subje

[PATCH] find: implement -ok

2022-03-27 Thread David Leonard
+4 -- (add/remove: 0/0 grow/shrink: 5/0 up/down: 191/0) Total: 191 bytesFrom 7ac4795a2767e1fc2a5fbc759290f8ce22000864 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Mon, 28 Mar 2022 10:55:18 +1000 Subject: [PATCH 1/2] find: implemen

[PATCH] find: implement -nouser, -nogroup

2022-03-27 Thread David Leonard
Implement's POSIX's -nouser and -nogroup primaries for find. From 48e78e55f367a427cf613f199cfa9060af08a304 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Mon, 28 Mar 2022 11:14:13 +1000 Subject: [PATCH] find: implement -nouser, -nogroup

Re: [PATCH] Added miscutil/tree.c

2022-04-11 Thread David Leonard
ped tree: tree.tempdir: No such file or directory FAIL: tree error opening dir FAIL: tree single file FAIL: tree nested directories and files -- From: David Leonard Date: Tue, 12 Apr 2022 14:13:09 +1000 Subject: [PATCH 1/2] libbb/recursive_action: add ACTION_MORE flag For tree-like call

Re: [PATCH] find: implement -ok

2023-01-28 Thread David Leonard
Resending patch for 'find -ok'. I re-ran bloatcheck (x86_64). Subject: [PATCH] find: implement -ok https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html -ok utility_name [argument ...] ; The -ok primary shall be equivalent to -exec, except that the use of a to punc

Re: [PATCH] find: implement -nouser, -nogroup

2023-01-28 Thread David Leonard
Resending patch for 'find -nouser', 'find -nogroup'. Refreshed bloatcheck Subject: [PATCH] find: implement -nouser, -nogroup https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html -nouser The primary shall evaluate as true if the file belongs to a user ID for which the

Re: [PATCH] find: implement -nouser, -nogroup

2023-01-29 Thread David Leonard
On Sun, 29 Jan 2023, Kang-Che Sung wrote: > +IF_FEATURE_FIND_NOUSER( ACTS(nouser)) > +IF_FEATURE_FIND_NOUSER( ACTS(nogroup)) Typo. (Should be IF_FEATURE_FIND_NOGROUP) Thanks! > +ACTF(nouser) > +{ > +       return !getpwuid(statbuf->st_uid); > +} I think there is a logic hole here. getpwuid

Re: [PATCH v2] find: implement -nouser, -nogroup

2023-01-29 Thread David Leonard
* v2 Fix ifdef guard typo found by Kang-Che Sung Subject: [PATCH v2] find: implement -nouser, -nogroup https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html -nouser The primary shall evaluate as true if the file belongs to a user ID for which the getpwuid() function d

Re: [PATCH v4] readlink: slight size optimization

2023-04-24 Thread David Leonard
On Mon, 24 Apr 2023, Harald van Dijk wrote: coreutils/readlink.c:91:27: warning: adding 'unsigned int' to a string does not append to the string [-Wstring-plus-int] printf("%s%s", buf, "\n" + (opt & 1)); ~^~~ coreutils/readlink.c:91:27: note: use arr

[PATCH 1/2] od: fix -O

2023-05-11 Thread David Leonard
od with option -O (4-byte octal) was incorrectly displaying 2-byte decimal when built without CONFIG_DESKTOP --- coreutils/od.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreutils/od.c b/coreutils/od.c index 6f22331e0..dcf1bd6f6 100644 --- a/coreutils/od.c +++ b/coreut

[PATCH 2/2] od: add tests

2023-05-11 Thread David Leonard
* Added tests for od (non-DESKTOP little-endian) * Allow 'optional' to invert meaning of a config option with '!' --- testsuite/od.tests | 191 +++ testsuite/testing.sh | 10 +++ 2 files changed, 201 insertions(+) diff --git a/testsuite/od.tests b/tes

Re: [PATCH 2/2] od: add tests

2023-05-11 Thread David Leonard
On Fri, 12 May 2023, David Leonard wrote: * Added tests for od (non-DESKTOP little-endian) * Allow 'optional' to invert meaning of a config option with '!' Hmm, that patch seems to have been a bit mangled in transit. Attaching. From 78f493ff5b29834dc537d554ba702160a58f70b1

Re: [PATCH] getfattr: new applet

2023-07-05 Thread David Leonard
On Mon, 3 Jul 2023, 余生与君 wrote: Gentle ping. On Sun, Jun 18, 2023 at 4:53 PM LoveSy wrote: function old new delta getfattr_main - 380+380 print_attr -

Re: [PATCH] hwclock: add get/set parameters option

2023-07-05 Thread David Leonard
On Mon, 3 Jul 2023, Andrej Picej wrote: Gentle ping. On 5. 06. 23 10:57, Andrej Picej wrote: In kernel 5.16 special ioctls were introduced to get/set RTC parameters. Add option to get/set parameters into busybox version of hwclock. Implementation is similar to the one already used in linux-util

Re: Failing shell code under busybox 1.36.1 that worked with 1.31.1

2024-02-15 Thread David Leonard
_result="$_result '${_p//'/'\"'\"'}'" Busybox ash has a CONFIG_ASH_BASH_COMPAT config to get this ${var//...} replacement behaviour. And, in bash, the ' in the pattern section is treated as a quote start. To give the ' a literal meaning, use \' eg ${_p//\'/..repl..} In current busybo

RE: Failing shell code under busybox 1.36.1 that worked with 1.31.1

2024-02-15 Thread 'David Leonard'
default: @@ -12989,6 +13012,13 @@ parsesub: { goto badsub; subtype++; /* VSREPLACEALL */ break; +#endif +#if BASH_PARAM_TRANSFORM + case '@': + /* ${v@ope

Re: [PATCH v2] fixdep: add fstat error handling

2024-04-25 Thread David Leonard
On Tue, 23 Apr 2024, Sam James wrote: } - fstat(fd, &st); + if (fstat(fd, &st) < 0) { + fprintf(stderr, "fixdep: fstat"); + perror(filename); + exit(2); + } if (st.st_size == 0) { close(fd);

[PATCH] date: permit compatible dates in -d option

2020-10-15 Thread David Leonard
When FEATURE_DATE_COMPAT is enabled, also permit POSIX-style MMDDHHMM[[CC]YY] formats to be used with -d. This form is used by ancient versions of hwclock. --- coreutils/date.c | 50 +--- testsuite/date/date-compat-works | 7 + 2 files changed,

Re: [PATCH] date: permit compatible dates in -d option

2020-10-28 Thread David Leonard
I'd like to withdraw this patch. It turns out that hwclock was not the cause. On Fri, 16 Oct 2020, David Leonard wrote: When FEATURE_DATE_COMPAT is enabled, also permit POSIX-style MMDDHHMM[[CC]YY] formats to be used with -d. This form is used by ancient versions of hwclock. --- core

Re: [PATCH 1/1] ping: Add support for IPv4-mapped IPv6 address format

2024-10-19 Thread David Leonard
I'm not a fan of this patch because ping is a low-level diagnostic tool. On Fri, 18 Oct 2024, Petr Vorel wrote: IP addresses with ::: prefix are IPv6 addresses which are mapped to IPv4. Therefore ping resulting IPv4 address. I can understand why anyone would think this translation is nor

Re: [PATCH 1/1] ping: Add support for IPv4-mapped IPv6 address format

2024-10-22 Thread David Leonard
On Sun, 20 Oct 2024, Lars Uffmann wrote: As for the points David brings up: On 2024-10-20 13:51:32, Petr Vorel wrote: I'm not a fan of this patch because ping is a low-level diagnostic tool. While I would acknowlege the low-level diagnostic part, I do think it has uses that go beyond that -

Re: [RESEND][PATCH] modutils: fix "warning: function may return address of local variable"

2024-12-30 Thread David Leonard
On Mon, 30 Dec 2024, Tomas Paukrt wrote: GCC 14.2 complains that the function filename2modname may return the address of the local variable local_modname. It is a false positive, but still it is better to allocate the memory directly to reduce the size of this function. Signed-off-by: Tomas Pau

Re: [PATCH v2 15/27] BB_EXECVP: make BB_EXECVP do NOEXEC logic and allow it to to force applet execution

2025-01-22 Thread David Leonard
On Wed, 22 Jan 2025, Nadav Tasher wrote: When FEATURE_FORCE_APPLETS is enabled, BB_EXECVP will fail when trying to execute things that are not busybox applets. This allows more control over the executed processes. ... +int FAST_FUNC BB_EXECVPE(const char *file, char *const argv[], char *con

Re: possible bug in netwok/ntpd.c for system that still have 32 bit time_t

2025-02-18 Thread David Leonard
Two issues explained below: - unconventional Era 0 split point - undefined behaviour when casting a double On Mon, 17 Feb 2025, ruggero rossi wrote: On Tue, 18 Feb 2025 00:22:16 +1000 (AEST) David Leonard wrote: Hello David, This is the first time I've thought about NTP eras, s

Re: potential addition of sponge to POSIX

2025-06-19 Thread David Leonard
sponge is pretty interesting. My first thought is that sponge may benefit from a flock option. This would allow file users to avoid accessing the file in an intermediate state. For example sponge -l would obtain a read lock first, then collects input, then upgrade to a write lock, then replace

Re: su and feedback when typing

2025-07-18 Thread David Leonard
On Sun, 13 Jul 2025, Ellie wrote: I often use touch screen devices, too. It's a challenge on any touch screen to be certain about what you're typing. sudo has this feature called "pwfeedback". I realize sudo is notorious having questionable many features. However, showing asterisks is a god-s