Re: [musl] bbox: musl versus uclibc

2017-08-14 Thread Rich Felker
On Mon, Aug 14, 2017 at 07:43:39PM +0200, Denys Vlasenko wrote: > As uclibc is increasingly aging, I am finally forced > to switch to musl: I'm bitten by a nasty bug in > getopt() - hush is using it in a slightly unusual way, > which uclibc does not expect. While I'm glad musl is working for you,

Re: [PATCH] Re: Possible Vulnerability in httpd.c

2016-11-22 Thread Rich Felker
On Tue, Nov 22, 2016 at 02:30:50AM +0100, Denys Vlasenko wrote: > On Mon, Nov 21, 2016 at 8:18 PM, Simon Rettberg > wrote: > > On Mon, 21 Nov 2016 20:37:14 +0200 > > Timo Teras wrote: > >> > >> It is still good practice to fill it with snprintf. If this is done, > >> proper error checking should

Re: Current git HEAD busybox segfaults on some applets

2016-09-16 Thread Rich Felker
On Fri, Sep 16, 2016 at 04:35:23PM +, Laurent Bercot wrote: > > A full gdb output is available here: http://pastebin.com/3k6SENiX > > The issue comes from the fact that fflush(stream) is #define'd as > fflush_unlocked(stream), so fflush(0) actually runs > fflush_unlocked(0), which segfaults

Re: [PATCH] getrandom: new applet

2016-07-12 Thread Rich Felker
On Tue, Jul 12, 2016 at 06:56:50PM -0400, Michael Conrad wrote: > On 7/12/2016 5:53 PM, Rich Felker wrote: > >On Tue, Jul 12, 2016 at 01:09:42PM -0400, Michael Conrad wrote: > >>On 7/7/2016 11:49 AM, Rob Landley wrote: > >>>On 07/06/2016 11:41 AM, Etienne Champetie

Re: [PATCH] getrandom: new applet

2016-07-12 Thread Rich Felker
On Tue, Jul 12, 2016 at 01:09:42PM -0400, Michael Conrad wrote: > On 7/7/2016 11:49 AM, Rob Landley wrote: > >On 07/06/2016 11:41 AM, Etienne Champetier wrote: > >>>Now you really hate the fact that getrandom() is a syscall. > >I do not hate the fact getrandom is a syscall. I'm asking what the poin

Re: [PATCH] getrandom: new applet

2016-07-11 Thread Rich Felker
On Mon, Jul 11, 2016 at 08:19:29PM +0200, Denys Vlasenko wrote: > On Mon, Jul 11, 2016 at 8:58 AM, Rob Landley wrote: > > Anyway, the point is you can't voluntarily collect _more_ entropy from > > these sources. They run when there's data to gather, calling the > > routines when there isn't new da

Re: [PATCH] getrandom: new applet

2016-07-08 Thread Rich Felker
On Wed, Jul 06, 2016 at 12:31:01AM -0500, Rob Landley wrote: > On 07/05/2016 11:49 PM, Rich Felker wrote: > > On the other hand, /dev/urandom has a problem that it will give > > results before sufficient entropy has been collected, resulting in > > duplicate sequences (an

Re: [PATCH] getrandom: new applet

2016-07-05 Thread Rich Felker
On Tue, Jul 05, 2016 at 09:33:04PM -0500, Rob Landley wrote: > On 07/05/2016 06:42 AM, Etienne Champetier wrote: > >> You've implied that this new API can block until it's initialized, which > >> reading from /dev/random can already do, and presumably > >> select/poll/inotify could do on /dev/rando

Re: [PATCH] Bug 9076 - Whois using a non working host for queries by default

2016-07-04 Thread Rich Felker
On Mon, Jul 04, 2016 at 09:36:07PM -0500, Rob Landley wrote: > On 07/04/2016 02:47 PM, Vito Mulè wrote: > > stopped using strcpy, > > Why? > > > +size_t query_len = strlen(argv_host); > > + char *str_token = malloc(query_len+1 * sizeof(char)); > > > + strncpy(str_token, argv_host

Re: [PATCH] getrandom: new applet

2016-07-03 Thread Rich Felker
On Sun, Jul 03, 2016 at 06:44:22PM +0200, Denys Vlasenko wrote: > On Tue, Jun 28, 2016 at 6:56 PM, Etienne CHAMPETIER > wrote: > > first user of this applet will be LEDE (OpenWrt) to save an urandom seed > > using getrandom() (so we are sure /dev/urandom pool is initialized) > > > Please be more

Re: [PATCH] getrandom: new applet

2016-07-03 Thread Rich Felker
On Sun, Jul 03, 2016 at 06:46:32PM +0200, Denys Vlasenko wrote: > On Tue, Jun 28, 2016 at 7:47 PM, walter harms wrote: > > perhaps a better aim ist to improve the $RANDOM in ash ? > > $RAMDOM generator in my tests passed all "dieharder -g 200 -a" tests. > How much better than this do you need? T

Re: kbuild overwrites $CC

2016-07-02 Thread Rich Felker
On Fri, Jul 01, 2016 at 06:16:59PM +0200, Martin Kaiser wrote: > Dear all, > > I'm trying to compile busysbox with a toolchain created from > yoctoproject. This toolchain comes with a setup script to set $CC and > cross-compiler related environment variables. If the toolchain is > installed to a n

Re: [PATCH v3 3/4] nsenter: new applet

2016-03-14 Thread Rich Felker
On Mon, Mar 14, 2016 at 02:27:56PM -0400, Mike Frysinger wrote: > On 14 Mar 2016 18:11, Bartosz Gołaszewski wrote: > > 2016-03-14 15:27 GMT+01:00 Mike Frysinger : > > > On 14 Mar 2016 11:07, Bartosz Golaszewski wrote: > > >> +#ifndef __BB_NAMESPACE_H > > >> +#define __BB_NAMESPACE_H > > > > > > use

Re: [PATCH v3 3/4] nsenter: new applet

2016-03-14 Thread Rich Felker
On Mon, Mar 14, 2016 at 10:27:19AM -0400, Mike Frysinger wrote: > On 14 Mar 2016 11:07, Bartosz Golaszewski wrote: > > +#ifndef __BB_NAMESPACE_H > > +#define __BB_NAMESPACE_H > > use a naming style like other busybox headers And in particular, don't use leading underscores, ever. They're not avai

Re: [PATCH V2]networking: Allow dot at the end of the domain name in dhcp response

2016-02-10 Thread Rich Felker
On Thu, Feb 11, 2016 at 05:59:39AM +0100, Denys Vlasenko wrote: > On Tue, Feb 9, 2016 at 6:23 PM, Balaji Punnuru > wrote: > > When a dhcp server responds with a domain name that ends with a ".", > > domain name validation is failing which leads to populating domain bad in > > resolv.conf > > > >

Re: [PATCH 0/2] ntpd: retry name-resolution until success

2016-02-10 Thread Rich Felker
On Thu, Feb 11, 2016 at 05:56:06AM +0100, Denys Vlasenko wrote: > On Thu, Feb 4, 2016 at 2:43 PM, Mark O'Donovan wrote: > > This is an attempt to fix bug 8131: > > ntpd: should retry on name resolving error > > Should it? > Why doesn't ping do this? telnet? netcat? No network utility does this.

Re: [PATCH] Fix compiling with musl's utmp stubs

2016-01-30 Thread Rich Felker
On Sun, Jan 31, 2016 at 01:02:27AM -0500, Kylie McClain wrote: > >From 4d76d9b69503b1ad61cf857d83cb8c4d5d92465b Mon Sep 17 00:00:00 2001 > From: Kylie McClain > Date: Sat, 30 Jan 2016 23:00:18 -0500 > Subject: [PATCH] Fix compiling with musl's utmp stubs > > This patch fixes compiling busybox wit

Re: [PATCH] Remove a compilation warning

2016-01-01 Thread Rich Felker
onably mistake the operator precedence in this case or in any case reported by -Wlogical-not-parentheses. It's a bogus warning. Rich > On January 1, 2016 2:14:55 PM EST, Rich Felker wrote: > >On Thu, Dec 31, 2015 at 11:01:24AM +0100, Cristian Ionescu-Idbohrn > >wrote: > >

Re: [PATCH] Remove a compilation warning

2016-01-01 Thread Rich Felker
On Thu, Dec 31, 2015 at 11:01:24AM +0100, Cristian Ionescu-Idbohrn wrote: > Reported by gcc (Debian 5.3.1-4) 5.3.1 20151219 > > shell/ash.c: In function 'evaltree': > shell/ash.c:8432:19: warning: logical not is only applied to the left hand > side of comparison [-Wlogical-not-parentheses] >i

Re: how to use ntp in busybox

2015-11-24 Thread Rich Felker
On Tue, Nov 24, 2015 at 10:40:51AM +0100, walter harms wrote: > > > Am 23.11.2015 07:49, schrieb Wei, Catherine: > > Hi: > > I've checked the ntpclient, and found that it can monitor the time > > difference between server and local machine, but seems it cannot support > > runtime configura

Re: [PATCH 1/2] udhcpd: sanitize invalid hostnames to match rfcs

2015-10-19 Thread Rich Felker
On Mon, Oct 19, 2015 at 10:52:27AM +0200, walter harms wrote: > > > Am 18.10.2015 23:26, schrieb Isaac Dunham: > > On Sun, Oct 18, 2015 at 07:55:38PM +0200, walter harms wrote: > >> > >> > >> Am 18.10.2015 07:54, schrieb Isaac Dunham: > >>> RFC952/RFC1123 limit the characters in a hostname for a

Re: [PATCH] fix hush umask command

2015-10-06 Thread Rich Felker
On Wed, Oct 07, 2015 at 12:31:15AM -0400, Rich Felker wrote: > The hush umask command is backwards; umask 022 sets the umask to 0755. > Attached patch should fix it. > > Rich > diff --git a/shell/hush.c b/shell/hush.c > index 96c739f..58c8dab 100644 > --- a/shell/hush.c

[PATCH] fix hush umask command

2015-10-06 Thread Rich Felker
The hush umask command is backwards; umask 022 sets the umask to 0755. Attached patch should fix it. Rich diff --git a/shell/hush.c b/shell/hush.c index 96c739f..58c8dab 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -8956,9 +8956,7 @@ static int FAST_FUNC builtin_umask(char **argv) if (a

Re: [PATCH] su: support denying accounts with blank password

2015-10-01 Thread Rich Felker
On Thu, Oct 01, 2015 at 03:42:40PM -0300, Alain Mouette wrote: > Why would you want to completely disable root login? > > If it is a security feature, how can it be used? It can be > interesting to avoid escalating priviledges, but then how to to > administrative tasks? (assuming ssh root login is

Re: [RFC/PATCH v2 3/5] libbb: add ends_with() function

2015-08-21 Thread Rich Felker
On Fri, Aug 21, 2015 at 06:26:27PM +0200, walter harms wrote: > > > Am 21.08.2015 16:23, schrieb Bartosz Golaszewski: > > This function checks if given key can be found at the end of the string. > > > > Signed-off-by: Bartosz Golaszewski > > --- > > include/libbb.h | 1 + > > lib

Re: osuosl.org and Spamhaus PBL

2015-08-03 Thread Rich Felker
On Wed, Jul 22, 2015 at 03:16:15PM +0200, Laurent Bercot wrote: > > X-Greylist: delayed 00:06:59 by SQLgrey-1.7.6 > > (For the record, I read the headers wrong, and it's osuosl.org > that actually performs that greylisting. My apologies to Numericable, > for once I accused them wrongly. > Now t

Re: [PATCH 1/2] Revert "ash: use alloca to get rid of setjmp"

2015-07-26 Thread Rich Felker
On Wed, Jul 22, 2015 at 04:02:22PM +0100, Daniel Thompson wrote: > 2015-07-22 5:19 GMT+02:00 Rich Felker : > >On Sun, Jul 19, 2015 at 11:07:13PM +0200, Denys Vlasenko wrote: > >>I would rather keep it. > >> > >>What is the "most horrible" thin

Re: [PATCH 1/2] Revert "ash: use alloca to get rid of setjmp"

2015-07-21 Thread Rich Felker
On Sun, Jul 19, 2015 at 11:07:13PM +0200, Denys Vlasenko wrote: > I would rather keep it. > > What is the "most horrible" thing which can happen here? Arbitrary code execution due to stack overflow. Does this really need a PoC? alloca is _always_ unsafe unless the argument is bounded and tiny. R

Re: [PATCH 2/2] ash: use alloca to get rid of setjmp

2015-07-15 Thread Rich Felker
On Mon, Jul 13, 2015 at 04:25:02AM +0200, Denys Vlasenko wrote: > On Thu, Jul 2, 2015 at 10:01 AM, Ron Yorston wrote: > > Rich Felker wrote: > >>In general alloca is unsafe. It's not obvious to me what the code here > >>is doing, so I can't tell for sure if i

Re: [PATCH 2/2] ash: use alloca to get rid of setjmp

2015-07-01 Thread Rich Felker
On Wed, Jul 01, 2015 at 04:46:18PM +0100, Ron Yorston wrote: > Now that the only thing protected by setjmp/longjmp is the saved string, > we can allocate it on the stack to get rid of the jump. > > Based on commit bd35d8e from git://git.kernel.org/pub/scm/utils/dash/dash.git > by Herbert Xu. In g

Re: Re: [EDT][PATCH 0/11] typo fixes in busybox

2015-05-21 Thread Rich Felker
On Fri, May 22, 2015 at 03:39:18AM +, Maninder Singh wrote: > EP-E9D7571734A347E2ADA07C4134AB97EA > >> Hi, > > >Please fix your MUA or MTA to omit that EP- thing in the mail-body. > Hi Bernhard, > Already requested for fixing, from Next time hopefullt it will be fixed. > Do i need to resubmit

Re: [PATCH] Bionic lacks transparent LFS migrations; provide a workaround

2015-04-28 Thread Rich Felker
On Tue, Apr 28, 2015 at 09:53:26PM -0400, Matt Whitlock wrote: > On Wednesday, 29 April 2015, at 1:26 am, Tanguy Pruvot wrote: > > For this case i generally cast the param to the biggest possible type. > > > > printf("llu", (uint64_t) val); > > You probably shouldn't assume that uint64_t is the l

Re: [PATCH] Bionic lacks transparent LFS migrations; provide a workaround

2015-04-28 Thread Rich Felker
On Tue, Apr 28, 2015 at 03:55:59PM -0400, Matt Whitlock wrote: > On Tuesday, 28 April 2015, at 9:56 am, Rich Felker wrote: > > What I do think is a bad idea is providing a hackish environment where > > only some things work correctly with 64-bit off_t and others silently &

Re: [PATCH] Bionic lacks transparent LFS migrations; provide a workaround

2015-04-28 Thread Rich Felker
On Mon, Apr 27, 2015 at 08:14:19PM -0400, Matt Whitlock wrote: > On Sunday, 26 April 2015, at 10:28 pm, Rich Felker wrote: > > On Sat, Apr 25, 2015 at 04:06:23PM -0400, Matt Whitlock wrote: > > > In short, Bionic has most of the syscall-level support introduced by > >

Re: [PATCH 5/5] Bionic lacks transparent LFS migrations; provide a workaround

2015-04-27 Thread Rich Felker
On Mon, Apr 27, 2015 at 06:30:59AM +, dietmar.schind...@manroland-web.com wrote: > > On Friday, 24 April 2015, at 4:12 am, Matt Whitlock wrote: > > > +#if defined(__BIONIC__) && _FILE_OFFSET_BITS == 64 > > > > The preprocessor needs to test whether _FILE_OFFSET_BITS is defined before > > usin

Re: [PATCH] Bionic lacks transparent LFS migrations; provide a workaround

2015-04-26 Thread Rich Felker
On Sat, Apr 25, 2015 at 04:06:23PM -0400, Matt Whitlock wrote: > On Saturday, 25 April 2015, at 11:38 am, Rich Felker wrote: > > On Sat, Apr 25, 2015 at 04:53:33AM -0400, Matt Whitlock wrote: > > > This solves some of the problems arising from Bionic's off_t being >

Re: [PATCH] Bionic lacks transparent LFS migrations; provide a workaround

2015-04-25 Thread Rich Felker
On Sat, Apr 25, 2015 at 04:53:33AM -0400, Matt Whitlock wrote: > This solves some of the problems arising from Bionic's off_t being > 32 bits wide despite _FILE_OFFSET_BITS==64. See BusyBox bug #6908. > > Note that this doesn't solve all such problems since Bionic lacks > 64-bit variants of many s

Re: [PATCH 1/2] Bionic lacks ttyname_r; provide a workaround

2015-04-24 Thread Rich Felker
On Fri, Apr 24, 2015 at 05:22:57PM -0400, Matt Whitlock wrote: > I think providing an alternative implementation of ttyname_r() in > missing_syscalls.c won't work. Busybox cannot be statically linked > when ttyname_r is defined in missing_syscalls.o: > > ld: error: > /usr/local/arm-linux-androide

Re: [PATCH] libbb: remove unnecessary argument to nonblock_immune_read

2015-04-19 Thread Rich Felker
On Sun, Apr 19, 2015 at 10:50:25AM +0100, Ron Yorston wrote: > The loop_on_EINTR argument to nonblock_immune_read is always set to 1. > > function old new delta > xmalloc_reads200 195 -5 > pgetc

Re: [musl] Re: Busybox on musl is affected by CVE-2015-1817

2015-04-02 Thread Rich Felker
On Wed, Apr 01, 2015 at 10:49:40AM +0200, u-w...@aetey.se wrote: > Hi Harald, > > On Wed, Apr 01, 2015 at 10:11:51AM +0200, Harald Becker wrote: > > There is a big difference if you talk about suid > > *root* programs or other suid usage. > > > > The former is definitely very dangerous and should

Re: [musl] Re: Busybox on musl is affected by CVE-2015-1817

2015-03-31 Thread Rich Felker
On Wed, Apr 01, 2015 at 12:11:18AM +0100, Justin Cormack wrote: > On 31 March 2015 at 20:07, Denys Vlasenko wrote: > > On Mon, Mar 30, 2015 at 7:31 AM, Rich Felker wrote: > >> For details on CVE-2015-1817, see: > >> http://www.openwall.com/lists/musl/2015/03/30/1

Re: Busybox on musl is affected by CVE-2015-1817

2015-03-31 Thread Rich Felker
On Tue, Mar 31, 2015 at 09:07:19PM +0200, Denys Vlasenko wrote: > On Mon, Mar 30, 2015 at 7:31 AM, Rich Felker wrote: > > For details on CVE-2015-1817, see: > > http://www.openwall.com/lists/musl/2015/03/30/1 > > > > With musl-linked Busybox installed setuid and ping e

Busybox on musl is affected by CVE-2015-1817

2015-03-29 Thread Rich Felker
For details on CVE-2015-1817, see: http://www.openwall.com/lists/musl/2015/03/30/1 With musl-linked Busybox installed setuid and ping enabled, exploiting this issue is trivial. While CVE-2015-1817 is certainly musl's fault, there are two changes to Busybox I'd like to propose that would have prev

Re: [RFC] Proof-of-concept for netlink listener for mdev -i

2015-03-14 Thread Rich Felker
On Sun, Mar 15, 2015 at 01:22:35AM +0100, Laurent Bercot wrote: > On 14/03/2015 20:23, Rich Felker wrote: > >Could you elaborate on how you measure that? With musl only the parts > >of stdio you actually use will be linked, and use of exit does not > >result in linking o

Re: [RFC] Proof-of-concept for netlink listener for mdev -i

2015-03-14 Thread Rich Felker
On Thu, Mar 12, 2015 at 05:51:00PM +0100, Laurent Bercot wrote: > On 12/03/2015 16:19, Natanael Copa wrote: > >netlink listener code that needs to be in memory all the time: > >http://git.alpinelinux.org/cgit/ncopa/nldev/tree/nldev.c > > A few comments: > [...] > - It may be worth it to write fu

Re: Fwd: [PATCH] ls: no longer assume a 4-digit year on file timestamp.

2015-02-17 Thread Rich Felker
On Tue, Feb 17, 2015 at 02:29:05PM +0100, Laurent Bercot wrote: > On 17/02/2015 13:52, Explorer wrote: > >My original motivation was to avoid that annoying comment saying that > >"it's buggy after year ", and I believe it should be written right > >in the first place. > > Would you prefer the

Re: [PATCH] ls: no longer assume a 4-digit year on file timestamp.

2015-02-16 Thread Rich Felker
On Mon, Feb 16, 2015 at 11:16:02PM -0500, Joshua Judson Rosen wrote: > On 02/15/2015 06:06 AM, Steven Honeyman wrote: > >On 15 February 2015 at 07:38, Explorer wrote: > >>This is a trivial change to allow a 5-digit-or-more year in 'ls' timestamp > >>output. > >> > >>Signed-off-by: Kang-che Sung >

Re: [PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r

2015-02-07 Thread Rich Felker
On Sat, Feb 07, 2015 at 09:49:19AM -0800, Isaac Dunham wrote: > On Thu, Feb 05, 2015 at 03:52:24PM -0500, Rich Felker wrote: > > On Thu, Feb 05, 2015 at 09:42:08PM +0100, Denys Vlasenko wrote: > > > struct passwd *getpwent() > > > { > > > static cha

Re: [PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r

2015-02-07 Thread Rich Felker
On Sat, Feb 07, 2015 at 03:14:10PM +0100, Denys Vlasenko wrote: > On Sat, Feb 7, 2015 at 2:32 AM, Rich Felker wrote: > >> > the _r functions are for thread-safe > >> > versions of their corresponding legacy functions, but getpwent_r has > >> > inherent glo

Re: [PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r

2015-02-06 Thread Rich Felker
On Thu, Feb 05, 2015 at 11:01:55PM +0100, Denys Vlasenko wrote: > On Thu, Feb 5, 2015 at 9:52 PM, Rich Felker wrote: > >> And musl will eventually be forced to implement getpwent_r() > >> if it wants to be usable for more packages... so... > > > > getpwent_r make

Re: [PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r

2015-02-05 Thread Rich Felker
On Thu, Feb 05, 2015 at 09:42:08PM +0100, Denys Vlasenko wrote: > struct passwd *getpwent() > { > static char *line; > static struct passwd pw; > size_t size=0; > if (!f) f = fopen("/etc/passwd", "rbe"); > if (!f) return 0; > return __getpwent_a(f, &p

Re: [PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r

2015-02-05 Thread Rich Felker
On Thu, Feb 05, 2015 at 02:09:36PM +0100, Denys Vlasenko wrote: > On Fri, Apr 25, 2014 at 9:36 AM, Natanael Copa wrote: > > Prefer use POSIX getpwent over glibc extension getpwent_r. This fixes > > building with musl libc with CONFIG_USE_BB_PWD_GRP disabled. > > Sorry, I missed this patch. > > H

[PATCH] fix gzip applet not to store timestamps

2015-02-01 Thread Rich Felker
Storing the original file's modification time in the output file is harmful (precludes deterministic results) and unlike official gzip, the busybox version provides no way to suppress this behavior; the -n option is silently ignored. Rather than trying to make -n work, this patch just removes the t

Re: [PATCH] udhcpd: Handle auto_time timeout overflow

2015-01-27 Thread Rich Felker
On Tue, Jan 27, 2015 at 04:51:33PM -0500, Cathey, Jim wrote: > At the bottom, some of C's arithmetical rules > are 'stupid'. Especially as regards type > promotion. At least they're well-defined. No, unsigned types are just modular arithmetic. There's nothing 'stupid' or unexpected about how the

Re: [PATCH] udhcpd: Handle auto_time timeout overflow

2015-01-27 Thread Rich Felker
On Tue, Jan 27, 2015 at 10:28:26PM +0100, Tim Hentenaar wrote: > On Tue, Jan 27, 2015 at 09:51:29PM +0100, Denys Vlasenko wrote: > > Hmm, I think it's a sign-extension bug. Can you try replacing > > > > tv.tv_sec = timeout_end - monotonic_sec(); > > > > with > > > > tv.tv_sec = (int)(timeout_end

Re: ntpdate-like functionality in ntpd

2015-01-27 Thread Rich Felker
On Tue, Jan 27, 2015 at 10:26:47PM +0100, Denys Vlasenko wrote: > On Tue, Jan 27, 2015 at 7:27 PM, Guillermo Rodriguez Garcia > wrote: > > Hello all, > > > > Is there a way to make ntpd work just like ntpdate (just use the first > > response received to set the time)? This is to set the approximat

Re: [PATCH] udhcpd: Handle auto_time timeout overflow

2015-01-27 Thread Rich Felker
On Tue, Jan 27, 2015 at 04:02:16PM +0100, Tim Hentenaar wrote: > On Tue, Jan 27, 2015 at 08:41:30AM -0500, Rich Felker wrote: > > On Wed, Jan 21, 2015 at 11:00:03PM +0100, Tim Hentenaar wrote: > > > --- > > > networking/udhcp/dhcpd.c | 3 +++ > >

Re: [PATCH] udhcpd: Handle auto_time timeout overflow

2015-01-27 Thread Rich Felker
On Wed, Jan 21, 2015 at 11:00:03PM +0100, Tim Hentenaar wrote: > Howdy y'all, > > I've noticed an interesting issue with udhcpd and auto_time. > > Some paths within the while loop don't go through continue_with_autotime. > Thus, if it takes a bit too long to reset timeout_end, the monotonic > tim

Re: bug-report: ash: fix a memory leak

2014-12-23 Thread Rich Felker
On Wed, Dec 24, 2014 at 10:32:19AM +0800, yhu2 wrote: > The script which triggers the leak: > > while true > do > while true > do > break; > done done > > someone had fixed this bug, the commit is: > http://git.busybox.net/busybox/commit/shell/ash.c?id=4ba6c5d3ba3d2c7922af

Re: problem of memory leak in re-direction (shell/ash.c: expredir)

2014-12-14 Thread Rich Felker
On Mon, Dec 15, 2014 at 02:55:41PM +0800, shengyong wrote: > hi, all > I meet the memory leak problem when use re-direction in a reading-loop, like: > > while true > do > while true > do > break > done < /dev/null >

Re: [PATCH] mktemp: don't use mktemp() function

2014-12-11 Thread Rich Felker
On Thu, Dec 11, 2014 at 06:01:57PM +0100, Bartosz Golaszewski wrote: > The linker emits this warning: > > warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp' > > Fix it by using mkstemp() instead of mktemp(). > > function old

Re: Writing unicode ncurses applications for busybox

2014-11-18 Thread Rich Felker
On Tue, Nov 18, 2014 at 12:47:36PM +0300, Pugnator wrote: > Hi all, > I write ncurses based application which utilizes  russian characters. It > looks like this: > > wchar_t *unicode_string = L"Это юникод"; > mvwprintw(stdscr,1,5,"%ls", unicode_string);    > > And it works pretty well on my de

Re: nslookup's Server: 0.0.0.0 but resolves correctly

2014-11-02 Thread Rich Felker
On Sun, Nov 02, 2014 at 09:02:57PM +, Steven Honeyman wrote: > On 2 November 2014 18:05, wrote: > >> musl: > >> > >> 24 > >> 25 /* unused; purely for broken apps */ > >> 26 typedef struct __res_state { > >> 27 int retrans; > >> > > > > sorry you lost me. > > is this an nslookup.c from

Re: Considering porting acpi

2014-10-12 Thread Rich Felker
On Sun, Oct 12, 2014 at 03:08:03AM -0500, Rob Landley wrote: > Heh. The ping.c one is particularly strange because clause 2, > "Redistributions in binary form must reproduce the above notice" but > busybox does not include the word "Regents" in any text string, so how > it would emit it at runtime

Re: Considering porting acpi

2014-10-10 Thread Rich Felker
On Fri, Oct 10, 2014 at 08:43:15AM -0700, Isaac Dunham wrote: > > > The code I have is currently using dirtree_read(), which corresponds to > > > recursive_action(). > > > Basically it looks in /sys/class/*/*/, /sys/class/power_supply, > > > and /sys/class/thermal for device status. > > > I could m

Re: netcat nc only ipv4 (ping6 ipv6 already present)

2014-08-30 Thread Rich Felker
On Sun, Aug 31, 2014 at 02:35:33PM +1000, Jaro Gress wrote: > It would be great to have netcat nc upgraded to handle ipv6. > the usual option is "nc -6 -l x" or "nc -6 -l -p x". > The -p option could be done without. It is kind of non standard. > ping6 is handling ipv6 already well. > > (

Re: Possible Unicode Problems in Busybox - Collect and Discussion

2014-08-15 Thread Rich Felker
On Fri, Aug 15, 2014 at 12:31:15AM +0200, Harald Becker wrote: > >> and how want you behave in case of invalid UTF-8 sequences? My > >>functions just skip over stray codes of 0x80..0xBF and synchronize > >>on next valid UTF-8 leading byte. How would you count invalid > >>sequences? > > > >In g

Re: Re: Re: missing format string in applets/usage_pod.c

2014-08-15 Thread Rich Felker
On Thu, Aug 14, 2014 at 11:58:56PM -0700, Isaac Dunham wrote: > On Thu, Aug 14, 2014 at 04:15:50PM +0100, Laszlo Papp wrote: > > On Thu, Aug 14, 2014 at 4:05 PM, Rich Felker wrote: > > > > > On Thu, Aug 14, 2014 at 03:28:51PM +0100, Laszlo Papp wrote: > > >

Re: Possible Unicode Problems in Busybox - Collect and Discussion

2014-08-14 Thread Rich Felker
On Thu, Aug 14, 2014 at 09:09:02PM +0200, Harald Becker wrote: > Hi Rich! > > > I think uClibc is pretty fast at this too. It's glibc that's horribly > >slow. Rough comparison: > > Pretty fast is still slower than UTF-8 optimized functions. The standard functions certainly can be UTF-8-optimized

Re: Possible Unicode Problems in Busybox - Collect and Discussion

2014-08-14 Thread Rich Felker
On Thu, Aug 14, 2014 at 07:14:52PM +0200, Harald Becker wrote: > Hi Rich! > > >> You say this, but libbb/unicode.c contains a unicode_strlen calling > >>this complex mb to wc conversion function to count the number of > >>characters. Those multi byte functions tend to be highly complex and > >>slo

Re: Possible Unicode Problems in Busybox - Collect and Discussion

2014-08-14 Thread Rich Felker
On Thu, Aug 14, 2014 at 07:16:36PM +0200, Tanguy Pruvot wrote: > size_t utf8len( const char* s ) > { >size_t n = 0; >while (*s) > if ((*s++ ^ 0x40) < 0xC0) >n++; >return n; > } > > you need to test s != NULL, else *s will crash Says who? NULL is not a valid pointer. Shoul

Re: Re: Re: missing format string in applets/usage_pod.c

2014-08-14 Thread Rich Felker
On Thu, Aug 14, 2014 at 03:28:51PM +0100, Laszlo Papp wrote: > On Thu, Aug 14, 2014 at 2:44 PM, Tanguy Pruvot > wrote: > > > its the same with bionic libc (arm) > > > > printf("test") is ok but not printf(buf) with char buf[] = "test"; > > printf("%s", buf) is ok > > > > Yeah, I guess it is abou

Re: Possible Unicode Problems in Busybox - Collect and Discussion

2014-08-13 Thread Rich Felker
On Wed, Aug 13, 2014 at 07:06:38PM +0200, Harald Becker wrote: > Hi Denys ! > > > The world seems to be standardizing on utf-8. > >Thank God, supporting gazillion of encodings is no fun. > > You say this, but libbb/unicode.c contains a unicode_strlen calling > this complex mb to wc conversion fun

Re: How do I (unconditionally) enable unicode support in busybox?

2014-08-11 Thread Rich Felker
On Mon, Aug 11, 2014 at 05:15:21PM +0200, Harald Becker wrote: > >IMO there is still something very strange with sed and unicode > > YES! I did not stop looking for this. Looks like this is a problem > in the regular expression parser. > > s /./x/g > > shall match every character and replace wit

Re: How do I (unconditionally) enable unicode support in busybox?

2014-08-06 Thread Rich Felker
On Wed, Aug 06, 2014 at 02:51:21PM +0200, Harald Becker wrote: > Hi James! > > > The problem is mainly when I use a busybox script > >as /init inside an initrd (initramfs). It runs as process 1. > >The /init script is called directly by the bootloader. Its > >environment is controlled by the co

Re: How do I (unconditionally) enable unicode support in busybox?

2014-08-04 Thread Rich Felker
On Mon, Aug 04, 2014 at 03:00:07PM -0400, Michael Conrad wrote: > On 8/4/2014 2:48 PM, James Bowlin wrote: > >BTW, the following code is an infinite loop in my > >initrd: > > > >[ "$LANG" = "en_US.UTF-8" ] || LANG=en_US.UTF-8 exec "$0" "$@" > > I think you should focus on this bug. Which busybox

Re: How do I (unconditionally) enable unicode support in busybox?

2014-08-04 Thread Rich Felker
On Sun, Aug 03, 2014 at 11:50:29PM -0600, James Bowlin wrote: > I run busybox in an initrd (initramfs) environment using both > legacy Grub and isolinux as boot loaders. I want to be able to > get the correct length of unicode strings in characters, not > bytes. I always have these two options se

Re: [PATCH] top: fix parsing of /proc/meminfo

2014-07-22 Thread Rich Felker
On Tue, Jul 22, 2014 at 08:24:30PM +0300, Timo Teras wrote: > On Tue, 22 Jul 2014 13:07:15 -0400 > "Cathey, Jim" wrote: > > > >Am I missing something here? There is no structure, just a > > >character pointer. If you leave off "static" it will be compiled as > > >an instruction that pushes a co

Re: [PATCH] Use the standard libc types in fatattr

2014-07-05 Thread Rich Felker
On Sat, Jul 05, 2014 at 12:20:51PM +0100, Laszlo Papp wrote: > > To be pedantic, uint32_t was introduced in the Open Group Base > > Specifications, Issue 5 (released in 1997, basis for UNIX98). > > At that point it was defined in , which only defined > > (u)int*_t. > > > > As far as when was avail

Re: [PATCH] Use the standard libc types in fatattr

2014-07-04 Thread Rich Felker
On Fri, Jul 04, 2014 at 04:25:11PM +0200, Denys Vlasenko wrote: > On Fri, Jul 4, 2014 at 4:06 PM, Laszlo Papp wrote: > > On Fri, Jul 4, 2014 at 2:47 PM, Denys Vlasenko > > wrote: > >> > >> On Fri, Jul 4, 2014 at 3:26 PM, Laszlo Papp wrote: > >> >> > -# define FAT_IOCTL_GET_ATTRIBUTES_IOR

Re: [Question] Questions about the BusyBox specification.

2014-07-02 Thread Rich Felker
On Tue, Jul 01, 2014 at 08:47:45PM +0200, Harald Becker wrote: > Hi Rich! > > > Obviously something like that isn't acceptable for inclusion. > > It was probably just a hacked-up version of upstream iptables. > > Just as a question. I did not look into that very deep. > > You are talking about i

Re: [Question] Questions about the BusyBox specification.

2014-07-01 Thread Rich Felker
On Mon, Jun 30, 2014 at 07:57:56PM -0700, Isaac Dunham wrote: > On Fri, Jun 27, 2014 at 09:26:27AM -0400, Rich Felker wrote: > > On Fri, Jun 27, 2014 at 10:06:07AM +0200, Frank Ihle wrote: > > > >> (6) Is there a (stateless/statefull) firewall for BusyBox ? > > >

Re: ftpd authentication [PATCH] ftpd: NOMMU/chroot fix

2014-06-27 Thread Rich Felker
On Fri, Jun 27, 2014 at 01:55:26PM +0200, Denys Vlasenko wrote: > On Fri, Jun 27, 2014 at 1:46 PM, Morten Kvistgaard > wrote: > > A small detail, why do you check if the root_fd is valid? Eg. > > > > ... > > if (G.root_fd >= 0) { > > ... > > > > It shouldn't be possible for it to be invalid and th

Re: [Question] Questions about the BusyBox specification.

2014-06-27 Thread Rich Felker
On Fri, Jun 27, 2014 at 10:06:07AM +0200, Frank Ihle wrote: > >> (6) Is there a (stateless/statefull) firewall for BusyBox ? > > think this is not related to busybox. Use iptables? The lack of an iptables command in Busybox is something that would be nice to fix, especially since the official ip

Re: ftpd authentication [PATCH] ftpd: NOMMU/chroot fix

2014-06-26 Thread Rich Felker
On Thu, Jun 26, 2014 at 04:47:04PM +0200, Denys Vlasenko wrote: > On Thu, Jun 26, 2014 at 1:37 PM, Morten Kvistgaard > wrote: > >>> ... > >>> execve("proc/self/exe", ["ftpd", "-l", "/"], [/* 9 vars */]) = -1 > >>> ENOENT (No such file or directory) ... > >> > >>This is strange. Any ideas why this

Re: [PATCH 0/6] Add a unit-testing framework to Busybox

2014-06-26 Thread Rich Felker
On Thu, Jun 26, 2014 at 12:35:53PM +0200, Denys Vlasenko wrote: > On Thu, Jun 26, 2014 at 12:00 PM, Bartosz Gołaszewski > wrote: > > 2014-06-22 16:31 GMT+02:00 Denys Vlasenko : > >> Applied all patches with some editing. > >> Thanks a lot! > > > > Hi Denys, > > > > I see, that you removed the INIT

Re: [PATCH] Add coreutils/unlink.c

2014-06-23 Thread Rich Felker
On Mon, Jun 23, 2014 at 07:36:50PM +0100, Laurent Bercot wrote: > >Well, unlink takes '--version' and '--help' as options. I think > >there's a conflict between open standard and coreutils' oddity to > >bring command syntax and version information with command line > >switches. > > unlink is not

Re: [PATCH] Add coreutils/unlink.c

2014-06-23 Thread Rich Felker
On Mon, Jun 23, 2014 at 07:44:23PM +0200, Denys Vlasenko wrote: > On Mon, Jun 23, 2014 at 7:24 PM, Cathey, Jim wrote: > > The entire point of unlink, the reason it even > > exists, is that it never takes _any_ options. > > Anything you feed it is a filename, and it > > will delete it. > > coreuti

netstat output issues

2014-06-07 Thread Rich Felker
Two small issues I found in busybox's netstat vs non-busybox versions: 1. The "any" address 0.0.0.0 or :: is not printed as '*' but actually looked up via the resolver. If nothing else this is a waste of time; it's also (at least in my opinion) uglier and harder to read. 2. IPv6 literals ar

Re: busybox nslookup slow on x86_64

2014-05-30 Thread Rich Felker
On Sat, May 31, 2014 at 02:02:35AM +0200, Denys Vlasenko wrote: > On Thursday 29 May 2014 20:47, Rich Felker wrote: > > On Wed, May 28, 2014 at 04:34:23PM +0200, Denys Vlasenko wrote: > > > On Tue, May 27, 2014 at 9:34 AM, muddyboot wrote: > > > > Hi, I found nslook

Re: Issues removing files with certain characters in their names.

2014-05-30 Thread Rich Felker
On Fri, May 30, 2014 at 09:18:19PM +0200, Harald Becker wrote: > Hi Rich ! > > >My statement was imprecise; of course to support users still > >stuck on legacy locales, nl_langinfo(CODESET) should be > >consulted. > > How do you determine the correct code set of a foreign file > system on an exte

Re: Issues removing files with certain characters in their names.

2014-05-30 Thread Rich Felker
On Fri, May 30, 2014 at 08:06:24PM +0200, Harald Becker wrote: > Hi Joshua ! > > On 29-05-2014 18:41 Joshua Judson Rosen > wrote: > > >But why is ls able to match the files when rm is not able to > >remove them? > > The problem happens on the opposite direction you expect. It is > not the creat

Re: Proposition: use a hashtable instead of bsearch to locate applets

2014-05-30 Thread Rich Felker
On Fri, May 30, 2014 at 12:13:41PM +0100, Laurent Bercot wrote: > > On 05/30/2014 10:16 AM, Bartosz Gołaszewski wrote: > >I've checked the times just by looking up all the applets in a loop > >and measuring the time using gettimeofday() - the results are: ~220 > >microseconds for bsearch and ~150

Re: Issues removing files with certain characters in their names.

2014-05-30 Thread Rich Felker
On Thu, May 29, 2014 at 06:41:17PM -0400, Joshua Judson Rosen wrote: > But why is ls able to match the files when rm is not able to remove them? I have no idea. Have you tried running them under strace and seeing where the failure occurs? > Is it perhaps because ls is not actually doing any opera

Re: busybox nslookup slow on x86_64

2014-05-29 Thread Rich Felker
On Thu, May 29, 2014 at 11:30:58PM +0200, Harald Becker wrote: > Hi Rich ! > > >> bbox nslookup uses libc to perform the lookup. > > >However, it may be nice to have an option for bb nslookup to > >turn off v6 lookups if such an option doesn't already exist. > > The problem has been solved by pl

Re: Issues removing files with certain characters in their names.

2014-05-29 Thread Rich Felker
On Thu, May 29, 2014 at 11:27:07PM +0200, Harald Becker wrote: > Hi Rich ! > > >> I know this problem very well. It happens about every few > >> month, that I get a ZIP packaged file from a Windows system. > >> As the maintainer is a bit stupid, he can't manage to avoid > >> foreign characters and

Re: Issues removing files with certain characters in their names.

2014-05-29 Thread Rich Felker
On Thu, May 29, 2014 at 09:18:26AM +0200, Harald Becker wrote: > Hi Denys ! > > >> For what it's worth the users with this problem were unable to > >> remove the files using wildcards. For example, one user had a > >> file named: > >> > >> På hjul.mkv > >> > >> ls P* displayed the file. > >> rm

Re: busybox nslookup slow on x86_64

2014-05-29 Thread Rich Felker
On Wed, May 28, 2014 at 04:34:23PM +0200, Denys Vlasenko wrote: > On Tue, May 27, 2014 at 9:34 AM, muddyboot wrote: > > Hi, I found nslookup resolve very slow on x86_64 system , it cost 5 seconds > > or longer almost everytime. > > > > Tested OS: Debian 7 x86_64 with kernel 3.2.5 & LFS x86_64 wi

Re: Shell test or quoting mechanism breaks on parens

2014-05-19 Thread Rich Felker
On Mon, May 19, 2014 at 05:02:48PM -0500, dung_ngu...@dell.com wrote: > Dell - Internal Use - Confidential > Hello, > I used to use busybox 1.00 and this command line returns 0 or at least the > output is the same as RHEL 5.3 shell: > ># [ '(' = '(' ] ; rc=$? ; echo $rc ; [ $rc -ne 0 ] && ech

Re: bug in busybox sed with non-ascii chars

2014-05-07 Thread Rich Felker
On Mon, May 05, 2014 at 08:08:32PM +0100, Sam Liddicott wrote: > One of the advantages of utf-8 encoding was that it was easy to re-sync > after an invalid sequence. > > It's a bit of a waste to then not do that. Minus points for musl. An application can resync, although the C multibyte interface

  1   2   3   4   >