Mike Frysinger | 1 Nov 2009 21:20
Picon
Favicon
Gravatar

export + default value parameter expansion -> broken dash parser

dash is unable to parse:
unset A; export ${A- -E}

results in:
export: 1: -E: bad variable name
-mike
Sven Mascheck | 2 Nov 2009 21:40
Picon

Re: export + default value parameter expansion -> broken dash parser

On Sun, Nov 01, 2009 at 04:20:37PM -0400, Mike Frysinger wrote:
> dash is unable to parse:
> unset A; export ${A- -E}

...let alone:

$ unset A; export ${A- -p}

hell is loose!

no, phew, just a mishap about the parameter
itself going poof when being expanded.
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Eitan Adler | 4 Nov 2009 20:19
Picon

trouble building dash

Here is the output from ./configure && gmake

if gcc -DHAVE_CONFIG_H -I. -I. -I..  -include ../config.h -DBSD=1
-DSHELL -DIFS_BROKEN  -Wall -g -O2 -MT nodes.o -MD -MP -MF
".deps/nodes.Tpo" -c -o nodes.o nodes.c; \
        then mv -f ".deps/nodes.Tpo" ".deps/nodes.Po"; else rm -f
".deps/nodes.Tpo"; exit 1; fi
gcc -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN  -g -O2 -Wall
-o mksignames mksignames.c
./mksignames
gmake[3]: *** [signames.c] Segmentation fault: 11 (core dumped)
gmake[3]: *** Deleting file `signames.c'
gmake[3]: Leaving directory `/home/eitan/dash/dash-0.5.5.1/src'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/home/eitan/dash/dash-0.5.5.1/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/eitan/dash/dash-0.5.5.1'
gmake: *** [all] Error 2

$ uname -a
FreeBSD AlphaBeta 8.0-RC2 FreeBSD 8.0-RC2 #0: Sun Oct 25 08:55:51 UTC
2009     root <at> almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
i386

Can anyone help me figure out whats going on?

(also tiny spelling error in configure --help)
  --enable-static         Build statical linked program
should be
  --enable-static         Build statically linked program
(Continue reading)

Eitan Adler | 8 Nov 2009 08:33
Picon

patch to get dash to build on FreeBSD

mksignames.c fails to build on freeBSD.
If you apply the following patch the shell builds and based on very
limited testing the dash appears to work.

diff -urN dash-0.5.5.1/src/mksignames.c dash/src/mksignames.c
--- dash-0.5.5.1/src/mksignames.c	2009-01-14 01:37:13.000000000 +0200
+++ dash/src/mksignames.c	2009-11-08 09:27:50.000000000 +0200
 <at>  <at>  -34,7 +34,11  <at>  <at> 
  */
 #define LASTSIG NSIG-1

-char *signal_names[2 * NSIG + 3];
+#if defined(__FreeBSD__)
+	char *signal_names[SIGRTMAX];
+#else
+	char *signal_names[2 * NSIG + 3];
+#endif

 #define signal_names_size (sizeof(signal_names)/sizeof(signal_names[0]))

Files dash-0.5.5.1/src/mksignames.core and dash/src/mksignames.core differ
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Alexey Gladkov | 11 Nov 2009 02:19
Picon

Re: Rergession in readcmd (commit 55c46b7)

31.08.2009 14:12, Herbert Xu wrote:
>> $ dash /tmp/z.sh
>> [Include] [common.conf]
>> [FullSpeedCPU] [yesFnf]
> 
> Thanks for the report.  It's an off-by-one error causing the
> NUL termination to disappear.

I found another example:

$ tr -d '[:print:]' < /etc/passwd |tr -d '\t\n' |wc -c
0

$ dash -c 'while read o p; do printf "[%s] [%s]\n" "$o" "$p"; done <
/etc/passwd' |tr -d '[:print:]' |tr -d '[:space:]' |wc -c
61

bug is not fixed yet :(

--

-- 
Rgrds, legion

--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Herbert Xu | 26 Nov 2009 04:07
Picon
Picon

Re: patch to get dash to build on FreeBSD

Eitan Adler <eitanadlerlist <at> gmail.com> wrote:
> mksignames.c fails to build on freeBSD.
> If you apply the following patch the shell builds and based on very
> limited testing the dash appears to work.

Thanks, but I don't think this is enough.  We assume in plenty
of other places that NSIG is the maximum for signal numbers, e.g.,
traps.c.  So I think we need to change all those places if this is
to work on FreeBSD.

Cheers,
--

-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> 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 majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Herbert Xu | 26 Nov 2009 04:54
Picon
Picon

Re: Rergession in readcmd (commit 55c46b7)

Alexey Gladkov <gladkov.alexey <at> gmail.com> wrote:
> 
> I found another example:
> 
> $ tr -d '[:print:]' < /etc/passwd |tr -d '\t\n' |wc -c
> 0
> 
> $ dash -c 'while read o p; do printf "[%s] [%s]\n" "$o" "$p"; done <
> /etc/passwd' |tr -d '[:print:]' |tr -d '[:space:]' |wc -c
> 61
> 
> bug is not fixed yet :(

This bug is caused by an off-by-one error in the recordregion
call in readcmd.  It included the terminating NUL in the region
which causes ifsbreakup to include the string after it for scanning.

Setting the correct length fixes the problem.

Signed-off-by: Herbert Xu <herbert <at> gondor.apana.org.au>

diff --git a/ChangeLog b/ChangeLog
index fabb0e1..7be8e86 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,3 +1,7  <at>  <at> 
+2009-11-26  Herbert Xu <herbert <at> gondor.apana.org.au>
+
+	Fix off-by-one recordregion in readcmd.
+
(Continue reading)

William Immendorf | 30 Nov 2009 01:54
Picon

Dash fails to compile on UTF-8 with the Coreutils i18n patch

Hello,

I think you might rember this madness if you were around the LFS/BLFS
lists and this list:

http://linuxfromscratch.org/pipermail/blfs-support/2009-August/065714.html
http://linuxfromscratch.org/pipermail/lfs-dev/2009-August/063125.html
http://www.mail-archive.com/dash <at> vger.kernel.org/msg00151.html

As of now, HEAD still fails with the exact same error!!!!!! The
solution: Change all LC_COLLATES to LC_CTYPES in mkbuiltins, and it
should work on the affected (Both LFS and Fedora), and on ones that
aren't affected. Please, can you dash that fix out for me?

--

-- 
William Immendorf
The ultimate in free computing.
Messages in plain text, please, no HTML.

--------------

"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Herbert Xu | 30 Nov 2009 07:36
Picon
Picon

Re: Dash fails to compile on UTF-8 with the Coreutils i18n patch

William Immendorf <will.immendorf <at> gmail.com> wrote:
> Hello,
> 
> I think you might rember this madness if you were around the LFS/BLFS
> lists and this list:
> 
> http://linuxfromscratch.org/pipermail/blfs-support/2009-August/065714.html
> http://linuxfromscratch.org/pipermail/lfs-dev/2009-August/063125.html
> http://www.mail-archive.com/dash <at> vger.kernel.org/msg00151.html
> 
> As of now, HEAD still fails with the exact same error!!!!!! The
> solution: Change all LC_COLLATES to LC_CTYPES in mkbuiltins, and it
> should work on the affected (Both LFS and Fedora), and on ones that
> aren't affected. Please, can you dash that fix out for me?

Well the fix just papers over the issue.

If you can reproduce the problem, please

1) Confirm that setting LC_CTYPES on the sed command only in
mkbuiltins also fixes the issue;
2) See if [[:lower:]] instead of [a-z] fixes the problem without
LC_CTYPES.

Thanks,
--

-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
(Continue reading)

William Immendorf | 1 Dec 2009 02:27
Picon

Dash fails to compile on UTF-8 with the Coreutils i18n patch

On Mon, Nov 30, 2009 at 12:36 AM, Herbert Xu
<herbert <at> gondor.apana.org.au> wrote:
> If you can reproduce the problem, please
>
> 1) Confirm that setting LC_CTYPES on the sed command only in
> mkbuiltins also fixes the issue;
> 2) See if [[:lower:]] instead of [a-z] fixes the problem without
> LC_CTYPES.
Herbert,

I'm not talking about sed. I'm talking about the sort commands in
mkbuiltins. The known fix is to change both of the LC_COLLATE=C stuff
to LC_CTYPE=C, and that works.

--
William Immendorf
The ultimate in free computing.
Messages in plain text, please, no HTML.

--------------

"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

--

-- 
William Immendorf
The ultimate in free computing.
Messages in plain text, please, no HTML.

--------------
(Continue reading)


Gmane