Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 May 2010 22:52:51 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/bin/sh expand.c src/tools/regression/bin/sh/expansion pathname2.0
Message-ID:  <201005162359.o4GNxVk6005589@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jilles      2010-05-16 22:52:51 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_8)
    bin/sh               expand.c 
  Added files:           (Branch: RELENG_8)
    tools/regression/bin/sh/expansion pathname2.0 
  Log:
  SVN rev 208174 on 2010-05-16 22:52:51Z by jilles
  
  MFC r207944: sh: Fix pathname expansion with quoted slashes like *\/.
  
  These are git commits 36f0fa8fcbc8c7b2b194addd29100fb40e73e4e9 and
  d6d06ff5c2ea0fa44becc5ef4340e5f2f15073e4 in dash.
  
  Because this is the first code I'm importing from dash to expand.c, add the
  Herbert Xu copyright notice which is in dash's expand.c.
  
  When pathname expanding *\/, the CTLESC representing the quoted state was
  erroneously taken as part of the * pathname component. This CTLESC was then
  seen by the pattern matching code as escaping the '\0' terminating the
  string.
  
  The code is slightly different because dash converts the CTLESC characters
  to backslashes and removes all the other CTL* characters to allow
  substituting glob(3).
  
  The effect of the bug was also slightly different from dash (where nothing
  matched at all). Because a CTLESC can escape a '\0' in some way, whether
  files were included despite the bug depended on memory that should not be
  read. In particular, on many machines /*\/ expanded to a strict subset of
  what /*/ expanded to.
  
  Example:
    echo /*"/null"
  
  This should print /dev/null, not /*/null.
  
  PR:             bin/146378
  Obtained from:  dash
  
  Revision  Changes    Path
  1.55.2.2  +15 -9     src/bin/sh/expand.c
  1.1.2.2   +31 -0     src/tools/regression/bin/sh/expansion/pathname2.0 (new)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005162359.o4GNxVk6005589>