Re: dash regression against klibc

2008-05-03 Thread Herbert Xu
On Sat, May 03, 2008 at 01:16:56AM -0500, Dan McGee wrote: That change makes it work fine here. Thanks for looking into all of this. OK this is what I've committed. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http

Re: strange `printf` arguments, parsing features (bugs?)

2008-05-18 Thread Herbert Xu
On Sun, May 18, 2008 at 06:40:26PM +0200, Oleg Verych wrote: Herbert Xu @ Sun, May 18, 2008 at 11:41:08PM +0800: # (1) parameters to `printf`? [EMAIL PROTECTED]:/tmp$ sh -c 'printf -1' printf: 1: Illegal option -1 This is expected. Use printf -- if you want to disable option

Re: strange `printf` arguments, parsing features (bugs?)

2008-05-18 Thread Herbert Xu
. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to [EMAIL

Re: Inconsistent parameter expansion

2008-05-18 Thread Herbert Xu
correct as far as I know but glob(3) still seems to be broken. In any case you may enable them with --enable-fnmatch and --enable-glob when running configure to see their effect on dash. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page

Re: shell and glibc (Re: Inconsistent parameter expansion)

2008-05-18 Thread Herbert Xu
to be glibc RE library problem: http://bugs.debian.org/475474 (bonus: 4 ways of doing one thing with `sed`, not with `perl`:) Have you seen http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=65458 ? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED

Re: Mac OS X support patch

2008-07-12 Thread Herbert Xu
, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to [EMAIL PROTECTED

Re: Mac OS X support patch

2008-07-13 Thread Herbert Xu
://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to [EMAIL PROTECTED] More majordomo info

Re: restricted dash shell?

2008-07-13 Thread Herbert Xu
option) were excluded because the standard developers considered that the implied level of security could not be achieved and they did not want to raise false expectations. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page

Re: [PATCH] [SHELL] print \n upon EOF (CTRL-D) when run interactively

2009-02-22 Thread Herbert Xu
. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body

Re: [JOBS] Do not close stderr when /dev/tty fails to open

2009-05-22 Thread Herbert Xu
On Sun, Feb 22, 2009 at 07:33:04PM +0800, Herbert Xu wrote: [JOBS] Do not close stderr when /dev/tty fails to open Turns out that there was more to this than jobs.c The use of savefd in redir ended up closing the wrong file descriptor too, albeit in a harmless manner. I'm going to throw

Re: memalloc.c patch ( 4*sizeof(void*) )

2009-06-27 Thread Herbert Xu
. In my opinion in this case we have to use fist 512, sacond 1024, third 2048, all other 4096 chuks. Does it hurt though? If not we should just make this unconditional. PS Please do reply-to-all instead of reply-to-author. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu

Re: Parameter expansion fails when assigning a local variable

2009-06-29 Thread Herbert Xu
portable. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body

Re: bugs in cd

2009-08-31 Thread Herbert Xu
: Herbert Xu herb...@gondor.apana.org.au Date: Mon Aug 31 22:06:41 2009 +1000 [CD] Lookup PWD after going through CDPATH On Tue, Jul 14, 2009 at 09:39:03PM +, Eric Blake wrote: For the cd command, POSIX 2008 requires that after all pathnames in CDPATH have been tested

Re: Allow dash to build with i18n version of Coreutils

2009-08-31 Thread Herbert Xu
=en_* only changes the way upper-case and lower-case letters get sorted rather than what you saw above. Oh I see what's going on. In fact it's sed that's not working for you, not sort. Let me find a way around that. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI

Re: dash arithmetic expression bug (1 1 + 1 | 1)

2010-03-08 Thread Herbert Xu
On Tue, Mar 09, 2010 at 12:38:54AM +0100, Jilles Tjoelker wrote: Noncommutative operators break more easily, for example Input: echo $((3 - 3 * 3 - 3)) Expected result: -9 Actual result: -3 This should fix it: commit 9655c1ac5646bde1007ecba7c6271d3aa98f294b Author: Herbert Xu

[PATCH 1/4] [VAR] Add localvars nesting

2010-05-26 Thread Herbert Xu
[VAR] Add localvars nesting This patch adds localvars nesting infrastructure so we can reuse the localvars mechanism for command evaluation. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog |4 src/eval.c |7 ++- src/var.c | 50

Re: [PATCH 1/4] [VAR] Add localvars nesting

2010-05-26 Thread Herbert Xu
, should be mentioned in the commit message/changelog, as it might break certain scripts. I will modify the Changelog to highlight this change. commit 127788364951212c356aadc39deb21e01b0161c8 Author: Herbert Xu herb...@gondor.apana.org.au Date: Thu May 27 11:32:55 2010 +0800 [VAR] Fix

Re: [PATCH 4/4] [VAR] Replace cmdenviron with localvars

2010-05-26 Thread Herbert Xu
. commit 1d806ac1fbafb867f6252e184e1be05c0829ab71 Author: Herbert Xu herb...@gondor.apana.org.au Date: Thu May 27 11:50:19 2010 +0800 [VAR] Do not poplocalvars prematurely on regular utilities The recent cmdenviron removal broke regular utilities by calling poplocalvars too early

[PATCH 1/2] [REDIR] Move null redirect checks into caller

2010-05-27 Thread Herbert Xu
[REDIR] Move null redirect checks into caller The null redirect checks were added as an optimisation to avoid unnecessary memory allocations. However, we could avoid this completely by simply making the caller avoid making a redirection unless it is not null. Signed-off-by: Herbert Xu herb

Re: IFS regression in 55c46b7

2010-05-27 Thread Herbert Xu
=: read a b; echo $a $b' a b with 55c46b7 and HEAD $ echo a:b |src/dash -c 'IFS=: read a b; echo $a $b' a:b It appears to be fixed in the latest tree. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} herb...@gondor.apana.org.au Home Page: http

Re: [PATCH] [EVAL] Force fork if any trap is set, not just on EXIT.

2010-05-27 Thread Herbert Xu
/ChangeLog index 650899a..969d6be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-05-27 Jilles Tjoelker jil...@stack.nl + + * Force fork if any trap is set, not just on EXIT. + 2010-05-27 Herbert Xu herb...@gondor.apana.org.au * Fix poplocalvar on abnormal exit from function

Re: Job control bug in revision 3800d4934391b,

2010-05-28 Thread Herbert Xu
master Hmm, I can't reproduce this here at all. Can you please run it with strace -f and send the result to us? Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http

Re: Job control bug in revision 3800d4934391b,

2010-05-28 Thread Herbert Xu
On Sat, May 29, 2010 at 09:10:39AM +1000, Herbert Xu wrote: On Fri, May 28, 2010 at 07:01:25PM -0400, Kris Maglione wrote: That's interesting. I've had three users complain about it so far. strace is attached. Thanks, I have reproduced it here now. It looks like it only happens

Re: debian patches to exit with code 127 for nonexistent/directory scripts

2010-06-11 Thread Herbert Xu
Cristian Ionescu-Idbohrn cristian.ionescu-idbo...@axis.com wrote: On Tue, 8 Jun 2010, Herbert Xu wrote: Jilles Tjoelker jil...@stack.nl wrote: Debian's dash package has some local changes which cause an exit with code 127, as required by POSIX, if a script (passed with dash filename

Re: [PATCH] [EVAL] don't clear eflag when forking subshell

2010-06-28 Thread Herbert Xu
through http://bugs.debian.org/514863 Signed-off-by: Gerrit Pape p...@smarden.org Patch applied. Thanks Gerrit! -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from

Re: DASH regression

2010-07-05 Thread Herbert Xu
the wrong pointer when attempting to remove a variable from its hash bucket. The following test case reproduces the bug for me: Thanks for the report. I'll apply your patch. -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http

Re: [PATCH] Fix regression when unsetting variables.

2010-07-06 Thread Herbert Xu
: Herbert Xu herb...@gondor.apana.org.au Date: Tue Jul 6 17:40:53 2010 +0800 [VAR] Fix loss of variables when hash collides Brian Koropoff reported that the new var patches broke the following script: #!/bin/dash GDM_LANG=bar OPTION=foo unset GDM_LANG # OPTION

Re: [PATCH] [EVAL] with set -e exit the shell if a subshell exits non-zero

2010-07-06 Thread Herbert Xu
exits 1 before echo. The bug was reported by Stefan Fritsch through http://bugs.debian.org/514863 Signed-off-by: Gerrit Pape p...@smarden.org Signed-off-by: Herbert Xu herb...@gondor.apana.org.au diff --git a/ChangeLog b/ChangeLog index 3f5e24c..0e367a6 100644

Re: dash klibc DEBUG compile trouble

2010-07-08 Thread Herbert Xu
: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH 2/2] [EVAL] clean up myhistedit.h

2010-09-08 Thread Herbert Xu
happen. myhistedit.h is only included when built without -DSMALL, which means that libedit is present. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list

Re: [Partial patch] IFS and read builtin

2010-09-08 Thread Herbert Xu
with the current implementation if possible. Thanks, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord

Re: [Partial patch] IFS and read builtin

2010-09-08 Thread Herbert Xu
it plus a real memory leak that occurs if we bail before hitting ifsfree. commit 5c7042771753d5a968b2b7263cf9f4e02fa3820e Author: Herbert Xu herb...@gondor.apana.org.au Date: Wed Sep 8 19:51:10 2010 +0800 [EXPAND] Fix ifsfirst/ifslastp leak As it stands expandarg may return with a non

Re: [Partial patch] IFS and read builtin

2010-09-08 Thread Herbert Xu
On Wed, Sep 08, 2010 at 07:53:24PM +0800, Herbert Xu wrote: commit 5c7042771753d5a968b2b7263cf9f4e02fa3820e Author: Herbert Xu herb...@gondor.apana.org.au Date: Wed Sep 8 19:51:10 2010 +0800 [EXPAND] Fix ifsfirst/ifslastp leak Slight update, should also call ifsfree instead

Re: dash klibc DEBUG compile question

2010-09-09 Thread Herbert Xu
skip it. freopen is trickier. However, it's only needed if you enable history. So I guess you could put it inside ifndef SMALL and use fclose/fopen when not using history support. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key

Re: [PATCH] [INPUT] Catch attempts to run a directory as a script

2010-10-06 Thread Herbert Xu
detecting failure to run a directory as a script, as in 'dash .'. Thanks for the detailed investiagtion! If someone could send me a patch that does this without bloating dash too much then I can apply it without feeling too much guilt :) Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home

Re: [PATCH 2/3] Revert Eliminated global exerrno.

2010-10-06 Thread Herbert Xu
...@redhat.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com Actually the bug is elsewhere. This patch works for me. commit 7f684260a2426ac61c06d2e4822429b00437ae24 Author: Herbert Xu herb...@gondor.apana.org.au Date: Thu Oct 7 10:55:15 2010 +0800 [BUILTIN] Fix EXEXEC status clobbering

Re: [PATCH 3/3] [EXCEPTIONS] Eliminate global exerrno

2010-10-06 Thread Herbert Xu
-by: Jonathan Nieder jrnie...@gmail.com Heh, had you sent 2/3 and 3/3 as one patch I would've seen the problem and just applied it :) Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 1/3] [EXCEPTIONS] Stop documenting EXSHELLPROC

2010-10-06 Thread Herbert Xu
*/ There is no need to renumber things. Just leave a gap. Thanks, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body

Re: [PATCH 1/3] [EXCEPTIONS] Stop documenting EXSHELLPROC

2010-10-06 Thread Herbert Xu
On Wed, Oct 06, 2010 at 10:04:14PM -0500, Jonathan Nieder wrote: Herbert Xu wrote: On Wed, Oct 06, 2010 at 08:03:47PM -0500, Jonathan Nieder wrote: --- a/src/error.h +++ b/src/error.h @@ -66,9 +66,8 @@ extern int exception; /* exceptions */ #define EXINT 0 /* SIGINT

Re: [PATCH 2/3] Revert Eliminated global exerrno.

2010-10-06 Thread Herbert Xu
On Wed, Oct 06, 2010 at 10:35:18PM -0500, Jonathan Nieder wrote: Herbert Xu wrote: Actually the bug is elsewhere. It does bisect to there. :) But you're right, it would have been simpler to send one patch. --- a/src/eval.c +++ b/src/eval.c @@ -854,7 +854,7 @@ bail

Re: [PATCH 2/3] Revert Eliminated global exerrno.

2010-10-06 Thread Herbert Xu
On Thu, Oct 07, 2010 at 12:14:06PM +0800, Herbert Xu wrote: Let me run it through the tests and apply it. There is one problem with this and that is changing the exit status in a trap: sh -c 'trap exec nosuchfile EXIT; exit 3'; echo $? This makes dash exit with 127 instead of 3

Re: [Partial patch] IFS and read builtin

2010-10-17 Thread Herbert Xu
+1,7 @@ +2010-10-18 Herbert Xu herb...@gondor.apana.org.au + + * Fix ifsfirst/ifslastp leak in casematch. + 2010-10-07 Herbert Xu herb...@gondor.apana.org.au * Fix EXEXEC status clobbering. diff --git a/src/expand.c b/src/expand.c index d6c6416..1b77b7c 100644 --- a/src/expand.c

Re: bug with - under ulimit -n

2010-10-27 Thread Herbert Xu
counts :) -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] [OPTIONS] Use exit status 127 when the script to run does not exist

2010-11-28 Thread Herbert Xu
On Sun, Nov 28, 2010 at 08:24:37PM +0800, Herbert Xu wrote: On Sun, Nov 28, 2010 at 08:06:27PM +0800, Herbert Xu wrote: However, instead of adding an ad-hoc exception for EXFILE, I'm simply going to move the exit status setting for EXERROR out of main.c and into error.c which should let

Re: [PATCH 2/3] Revert Eliminated global exerrno.

2010-11-28 Thread Herbert Xu
On Wed, Oct 06, 2010 at 10:35:18PM -0500, Jonathan Nieder wrote: Maybe the following would make sense on top? -- 8 -- Subject: [EXCEPTIONS] Use EXEXIT in place of EXEXEC Patch applied. Thanks a lot! -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au

Re: [PATCH v2] [EXCEPTIONS] Stop documenting EXSHELLPROC

2010-11-28 Thread Herbert Xu
-by: Jonathan Nieder jrnie...@gmail.com Also applied. -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message

Re: [PATCH] fix two compile time warnings

2010-11-28 Thread Herbert Xu
return anything that requires %s. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord

Re: [PATCH] [EXPAND] Do not split the result of tilde expansion

2011-03-10 Thread Herbert Xu
. This fixes Debian bug #601096. Example: IFS=m HOME=/tmp; printf %s\n ~ Signed-off-by: Herbert Xu herb...@gondor.apana.org.au diff --git a/ChangeLog b/ChangeLog index c94dff8..a64e030 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2011-03-10 Jilles Tjoelker

Re: [PATCH 2/3] Port to AIX

2011-03-10 Thread Herbert Xu
the spec says it should default to -b t. Explicitly pass -b a for good measure in mkbuiltins. Signed-off-by: Brian Koropoff bkorop...@gmail.com Patch applied. Thanks. -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http

Re: [PATCH 3/3] Port to HP-UX

2011-03-10 Thread Herbert Xu
effect if configure.ac doesn't detect open64 in the first place? The rest looks OK. Thanks, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line

Re: [PATCH] Reset exit status before sourcing a file.

2011-03-10 Thread Herbert Xu
exitstatus if the pipeline is backgrounded. Amusingly pdksh seems to share this bug. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line

Re: [PATCH] Port to Solaris

2011-03-15 Thread Herbert Xu
is unavailable Please take a look at the end result to see if I've messed anything up. Thanks, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- commit

Re: [PATCH v2] [DEBUG] Use va_copy when reusing a va_list

2011-03-15 Thread Herbert Xu
: $ sh -c '' sh: Syntax error: Unterminated quoted string $ sh -o debug -c '' sh: Segmentation fault (core dumped) Make a copy with va_copy to avoid this. Signed-off-by: Jonathan Nieder jrnie...@gmail.com Also applied. -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http

Re: inconsistency with handling of symlinked ttys in background

2011-03-15 Thread Herbert Xu
/3 $ dash -c tty $(readlink -f /dev/stdin) /dev/pts/3 It's completely expected as we close stdin for backgrounded commands. Try: bash -c '{ :; tty /dev/stdin; }' Now who is inconsistent? :) Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au

Re: [PATCH] avoid more undefined handler

2011-07-08 Thread Herbert Xu
. If pip[0] is garbage at this point, then we're the last element in a pipeline and prevfd will never be used again. If you can think of a way of solving this without adding to the code size then I'll gladly apply it :) Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http

Re: [PATCH] [SHELL] Fix klibc DEBUG compilation v2

2011-07-08 Thread Herbert Xu
: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH] [SHELL] Fix klibc DEBUG compilation v3

2011-07-14 Thread Herbert Xu
On Fri, Jul 08, 2011 at 10:05:38AM +, maximilian attems wrote: dash didn't compile in DEBUG mode against klibc for all long time. Now it only fails at link stage for not having setlinebuf(3) and freopen(3). Applied. Thanks! -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http

Re: [PATCH 1/2] [SHELL] Allow building without LINEO support.

2011-08-16 Thread Herbert Xu
On Tue, Aug 16, 2011 at 05:45:02PM -0700, David Miller wrote: Simply specify --disable-lineno to configure. Signed-off-by: David S. Miller da...@davemloft.net Both patches applied. Thanks a lot! -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au

Re: [PATCH 1/2] [SHELL] Allow building without LINEO support.

2011-08-16 Thread Herbert Xu
) { lineno = errlinno; if (funcline) lineno -= funcline - 1; } #endif would make it more palatable. Yes please do it like that. Thanks! -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http

Re: [PATCH] [BUILTIN] Make test -x sane again when run as root

2011-09-27 Thread Herbert Xu
(fix contains just as much information as make sane) and to make it more obvious that this is supposed to have no effect on platforms like Linux. Sorry for the lack of clarity. So pleas exclude the changes on Linux. Thanks, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http

Re: Question about job control in non-interactive shells

2012-01-14 Thread Herbert Xu
they know are part of the job in this case, but dash calls kill() on a process group that is guaranteed not to exist. Right. And you don't even need %1: dash -c sleep 5 kill $! works just fine. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http

Re: [PATCH] var.c: check for valid variable name before printing in export -p

2012-02-25 Thread Herbert Xu
? Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] var.c: check for valid variable name before printing in export -p

2012-02-25 Thread Herbert Xu
, and I'm okay with this patch as-is. Great. From a security point of view I'd rather not pass them through. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from

Re: [PATCH] support ulimit -r

2012-07-03 Thread Herbert Xu
! -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info

Re: Fwd: bug? Spawned childs always remain in zombie state

2013-08-23 Thread Herbert Xu
' line. Uncommenting that line will result in expected behavior where childs are properly reaped. Is this a bug, or is there an alternative solution I'm missing? You need to wait on them as otherwise dash has to keep them around in case you call wait(1) later on. Cheers, -- Email: Herbert Xu

Re: Parameter substitution bug

2013-08-23 Thread Herbert Xu
%${f#?}} --vs-- ${f%${f#?}} Strangely, that is the simplest case I get to fail. The following script walks through the issue, and if run with bash, ksh, or busybox exhibits those two expressions as producing the same result. This should be fixed now. Thanks, -- Email: Herbert Xu herb

Re: [PATCH] [DEBUG] Add newline when tracing in poplocalvars

2013-08-23 Thread Herbert Xu
On Tue, Mar 12, 2013 at 01:22:11PM +, Peter Rosin wrote: Signed-off-by: Peter Rosin p...@lysator.liu.se Patch applied. -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe

Re: Crash on valid input

2013-08-23 Thread Herbert Xu
UNOT similarly to STREZ e.a.: Thanks for the patch. However, I've decided to fix it like this: commit b34499f5c851d1a70db95b56bd02eff0329d4a1a Author: Herbert Xu herb...@gondor.apana.org.au Date: Fri Aug 23 21:58:55 2013 +1000 [BUILTIN] Fixed argument parsing crash in test When nexpr

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-09-03 Thread Herbert Xu
: $ src/dash -c 'test ! ! = !' src/dash: 1: test: =: unexpected operator Agreed. $ src/dash -c 'test ! -o !' src/dash: 1: test: -o: unexpected operator Nope, the rule is quite clear that it only applies to binary primaries, not operators. -o is an operator. Cheers, -- Email: Herbert Xu

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-09-03 Thread Herbert Xu
On Wed, Sep 04, 2013 at 01:20:00PM +1000, Herbert Xu wrote: test ! -o ! is a three-argument test, where $2 (-o) is a binary primary, so it is the binary test of $1 and $3, and the end result is an exit status of 0. Bash and ksh get it right, dash fails. Both zsh and posh do it like

Re: command -p does not correctly limit search to a safe PATH

2014-09-26 Thread Herbert Xu
optimisation patch on top to minimise the size impact. commit d813a572d94455f1d0d43ccad49edfacd13ee2e3 Author: Herbert Xu herb...@gondor.apana.org.au Date: Fri Sep 26 16:42:18 2014 +0800 [BUILTIN] Small optimisation of command -pv change This patch moves the pathval call

Re: command -p does not correctly limit search to a safe PATH

2014-09-26 Thread Herbert Xu
to a path specified at configuration time: Thanks for the patch. But until someone who needs this complexity steps up, I'm going to stick with the simpler version below: commit 842050da1c14d7dbe365cd750032fcd8eaaa1db2 Author: Herbert Xu herb...@gondor.apana.org.au Date: Fri Sep 26 17:18:35 2014

Re: possible bug in job control

2014-09-26 Thread Herbert Xu
:36:53 2013 +0200 getjob: Fix off-by-one error for multiple of four job numbers Patch applied. Thanks! -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list

Re: Bug in man page

2014-09-26 Thread Herbert Xu
commit 63ab7ea86d12ff87f311e9a59dffdc4f1d47ff33 Author: Herbert Xu herb...@gondor.apana.org.au Date: Fri Sep 26 22:16:26 2014 +0800 [MAN] Change characters for printf precision to bytes On Sun, Mar 09, 2014 at 11:11:43AM +, Jeroen van Dijke wrote: There seems

Re: [PATCH 1/2] [MAN] 0 and EXIT both work for exit traps.

2014-09-26 Thread Herbert Xu
Buchbinder adam.buchbin...@gmail.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com Thanks. Both patches applied. -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list

[EVAL] Fix use-after-free in dotrap/evalstring

2014-10-01 Thread Herbert Xu
While going through trap code it occured to me that we have a use-after-free bug. commit 6c3f73bc536082fec38bd36e6c8a121033c68835 Author: Herbert Xu herb...@gondor.apana.org.au Date: Thu Oct 2 08:26:06 2014 +0800 [EVAL] Fix use-after-free in dotrap/evalstring The function dotrap

Re: [PATCH] Support DOS paths in dash

2014-10-01 Thread Herbert Xu
that /cygdrive/c notation is the official way to access drive letters, and that if 'c:/' works it is nice, but it is not a design goal to always have it work. It's fine by me. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key

[TRAP] Make sure evalskip is zero before running traps

2014-10-02 Thread Herbert Xu
d28c13e7119a605ef152a4310e9415dc7ae9b8f3 Author: Herbert Xu herb...@gondor.apana.org.au Date: Thu Oct 2 19:49:48 2014 +0800 [TRAP] Make sure evalskip is zero before running traps As it is if dotrap is called with evalskip set to a nonzero value, it'll try to execute any set traps

[EVAL] Do not clobber exitstatus in evalcommand

2014-10-03 Thread Herbert Xu
commit 0d1fb088a4a16569260de4266d4bd359491c6bcd Author: Herbert Xu herb...@gondor.apana.org.au Date: Fri Oct 3 14:07:07 2014 +0800 [EVAL] Do not clobber exitstatus in evalcommand All originators of EXERROR have been setting the exitstatus for a while now. So it is no longer

Re: [PATCH] Support DOS paths in dash

2014-10-03 Thread Herbert Xu
Edward Lam edw...@sidefx.com wrote: On Oct 1, 2014, at 8:41 PM, Herbert Xu herb...@gondor.apana.org.au wrote: Eric Blake ebl...@redhat.com wrote: I'm not interested in burdening the cygwin build of dash with a one-off patch, so I'd like to gauge the upstream thoughts - is it worth

[BUILTIN] Exit without arguments in a trap should use status outside traps

2014-10-05 Thread Herbert Xu
Please review: commit da30b4b787695fbf77e5d941ff350a66ca572bcb Author: Herbert Xu herb...@gondor.apana.org.au Date: Mon Oct 6 10:39:47 2014 +0800 [BUILTIN] Exit without arguments in a trap should use status outside traps POSIX now requires that exit without arguments in a trap

[EVAL] Move common skipcount logic into skiploop

2014-10-06 Thread Herbert Xu
commit 598d300ffa0b9542a88feae900ccdd29e35374cf Author: Herbert Xu herb...@gondor.apana.org.au Date: Mon Oct 6 20:45:04 2014 +0800 [EVAL] Move common skipcount logic into skiploop The functions evalloop and evalfor share the logic on checking and updating skipcount. This patch

[BUILTIN] Allow return in loop conditional to set exit status

2014-10-06 Thread Herbert Xu
commit f14b4626eb5c1c2fda137e7d1520c5f1cb7e85c4 Author: Herbert Xu herb...@gondor.apana.org.au Date: Mon Oct 6 21:22:43 2014 +0800 [BUILTIN] Allow return in loop conditional to set exit status https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=332954 When return is used

[BUILTIN] Return without arguments in a trap should use status outside traps

2014-10-06 Thread Herbert Xu
commit 70c16dd30d4cf824aa895e9f6c095fec741c65a8 Author: Herbert Xu herb...@gondor.apana.org.au Date: Mon Oct 6 21:51:26 2014 +0800 [BUILTIN] Return without arguments in a trap should use status outside traps POSIX now requires that return without arguments in a trap should

Re: dash security bug

2014-10-06 Thread Herbert Xu
: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info at http

[VAR] Use setvareq to set OPTIND initially

2014-10-07 Thread Herbert Xu
commit f20dcdd0948d7ebb7d462a0288ea218468ad4f6c Author: Herbert Xu herb...@gondor.apana.org.au Date: Tue Oct 7 22:24:42 2014 +0800 [VAR] Use setvareq to set OPTIND initially There is no need to setvarint to set the initial value of OPTIND of one. This patch switchs to setvareq

Re: Failure of nested substring processing inside double-quotes

2014-10-07 Thread Herbert Xu
. If I break it up into two steps it works OK, regardless of whether or not it's quoted. This is dash 0.5.7-4ubuntu1 (from Ubuntu GNOME 14.04). This is already fixed in the current git tree, by the commit: commit a7c21a6f4cb42d967854cae954efd4ee66bdea9c Author: Herbert Xu herb

[BUILTIN] Add printf support for format string a, A, and F

2014-10-26 Thread Herbert Xu
commit c77265b4ea89359c164346e400914bb24a3716d1 Author: Herbert Xu herb...@gondor.apana.org.au Date: Mon Oct 27 11:45:01 2014 +0800 [BUILTIN] Add printf support for format string a, A, and F This patch adds the format string characters a, A and F to the supported set

[0/9] Handle embedded NULs correctly in printf

2014-10-27 Thread Herbert Xu
Hi: This series adds embedded NUL handling to printf, and then tries to squeeze out some fat so we don't end up bloating it up too much. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert

[PATCH 8/9] [BUILTIN] Optimise handling of backslash octals in printf

2014-10-27 Thread Herbert Xu
This patch removes the duplicate octal handling for %b by reusing the existing code in conv_escape. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog |1 + src/bltin/printf.c | 30 -- 2 files changed, 9 insertions(+), 22 deletions

[PATCH 1/9] [BUILTIN] Handle embedded NULs correctly in printf

2014-10-27 Thread Herbert Xu
. Unlike asprintf though, our xasprintf prints to the ash stack rather than using straight malloc memory. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog |1 src/bltin/printf.c | 80 --- src/output.c | 82

[PATCH 2/9] [INPUT] Replace open-coded flushall in preadbuffer

2014-10-27 Thread Herbert Xu
Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog |1 + src/input.c |5 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 379672f..e6d6cbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * Add printf

[PATCH 6/9] [BUILTIN] Remove getintmax in printf

2014-10-27 Thread Herbert Xu
This patch removes getintmax and moves its functionality into getuintmax in order to reduce code duplication. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog |1 + src/bltin/printf.c | 45 +++-- 2 files changed, 12

[PATCH 9/9] [BUILTIN] Simplify echo command

2014-10-27 Thread Herbert Xu
Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog |1 + src/bltin/printf.c | 28 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60fd4b6..f015066 100644 --- a/ChangeLog +++ b/ChangeLog

[PATCH 7/9] [BUILTIN] Use error instead of warnx for fatal errors in printf

2014-10-27 Thread Herbert Xu
This patch replaces uses of warnx where we abort with error since the effect is the same. The exit status however changes from 1 to 2. Non-fatal errors where we continue are unchanged. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog |1 + src/bltin/printf.c

[PATCH 3/9] [OUTPUT] Add likely tag in outmem

2014-10-27 Thread Herbert Xu
The branch in outmem where the string fits in the buffer is the common case and is now marked as likely. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog|1 + src/output.c |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog

[BUILTIN] Handle -- in dotcmd

2014-10-27 Thread Herbert Xu
commit 12ad48bb31b003eb6d3106478b7760a031969a36 Author: Herbert Xu herb...@gondor.apana.org.au Date: Mon Oct 27 16:56:46 2014 +0800 [BUILTIN] Handle -- in dotcmd This patch adds a nextopt call in dotcmd in order to handle --. Reported-by: Stephane Chazelas stephane_chaze

Re: Line continuation and variables

2014-10-29 Thread Herbert Xu
file containing many repeated ${w#\#} will not be parsed correctly. There is a similar bug with repeated $\# but this is not specified by POSIX. Good catch! I guess I'll do something similar to tokpushback to handle this. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page

[0/3] Minor parser fixes/cleanups

2014-11-05 Thread Herbert Xu
Hi: The recent discussion on backslash newline led me to some small fixes and cleanups in the parser which I'm posting now. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 2/3] [PARSER] Simplify EOF/newline handling in list parser

2014-11-05 Thread Herbert Xu
This patch simplifies the EOF and new handling in the list parser. In particular, it eliminates a case where we may leave here-documents unfinished upon EOF. It also removes special EOF/newline handling from parsecmd. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- ChangeLog

  1   2   3   4   >