Skip to contentSkip to conversation

Fix corruption of redirections with byte 0x81.

PATCH In review Jilles Tjoelker 2 participants 2 messages May 16, 2010 – May 27, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix corruption of redirections with byte 0x81.

In other ash variants, a partial implementation of ksh-like cmd >file* adds and removes CTLESC bytes ('\x81') in redirection filenames, preserving 8-bit transparency. Long ago, dash removed the code to add the CTLESC bytes, but not the code to remove them, causing corruption of filenames containing CTLESC. This commit removes the code to remove the CTLESC bytes.

The CTLESC byte occurs frequently in UTF-8 encoded non-Latin text.

This bug has been reported various times to Ubuntu and Debian (e.g. Launchpad Ubuntu #422298). This patch is the same as the one submitted by Alexander Korolkov in Ubuntu #422298.

---
 src/expand.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
src/expand.c +0 -2
index 48c45e5..f2f964c 100644
@@ -210,8 +210,6 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
 		exparg.lastp = &exparg.list;
 		expandmeta(exparg.list, flag);
 	} else {
-		if (flag & EXP_REDIR) /*XXX - for now, just remove escapes */
-			rmescapes(p);
 		sp = (struct strlist *)stalloc(sizeof (struct strlist));
 		sp->text = p;
 		*exparg.lastp = sp;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 7 lines · Jilles Tjoelker

In other ash variants, a partial implementation of ksh-like cmd >file* adds and removes CTLESC bytes ('\x81') in redirection filenames, preserving 8-bit transparency. Long ago, dash removed the code to add the CTLESC bytes, but not the code to remove them, causing corruption of filenames containing CTLESC. This commit removes the code to remove the CTLESC bytes.

Quoted 7 lines

The CTLESC byte occurs frequently in UTF-8 encoded non-Latin text.

This bug has been reported various times to Ubuntu and Debian (e.g. Launchpad Ubuntu #422298). This patch is the same as the one submitted by Alexander Korolkov in Ubuntu #422298.

Patch applied. Thanks a lot!

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt