[PATCH] ash: do not split the result of tilde expansion
Denys Vlasenko
vda.linux at googlemail.com
Sun Mar 22 15:56:02 UTC 2015
Applied, thanks!
On Mon, Mar 16, 2015 at 3:14 PM, Ron Yorston <rmy at tigress.co.uk> wrote:
> A tilde expansion generates a valid pathname. Splitting it using IFS
> either leaves it unchanged or changes it to something unintended.
>
> Example:
> IFS=m HOME=/tmp; printf "%s\n" ~
>
> Based on this commit authored by Jilles Tjoelker:
>
> http://git.kernel.org/cgit/utils/dash/dash.git/commit/?id=834629283f6c629a4da05ef60bae9445c954a19a
>
> Signed-off-by: Ron Yorston <rmy at tigress.co.uk>
> ---
> shell/ash.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/shell/ash.c b/shell/ash.c
> index 0f9f73e..b568013 100644
> --- a/shell/ash.c
> +++ b/shell/ash.c
> @@ -5791,7 +5791,6 @@ exptilde(char *startp, char *p, int flags)
> struct passwd *pw;
> const char *home;
> int quotes = flags & (EXP_FULL | EXP_CASE | EXP_REDIR);
> - int startloc;
>
> name = p + 1;
>
> @@ -5823,9 +5822,7 @@ exptilde(char *startp, char *p, int flags)
> if (!home || !*home)
> goto lose;
> *p = c;
> - startloc = expdest - (char *)stackblock();
> strtodest(home, SQSYNTAX, quotes);
> - recordregion(startloc, expdest - (char *)stackblock(), 0);
> return p;
> lose:
> *p = c;
> --
> 1.7.1
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
More information about the busybox
mailing list