bug-sed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20796: [PATCH] Keep special meaning of "-" even for "sed -i"


From: Jim Meyering
Subject: bug#20796: [PATCH] Keep special meaning of "-" even for "sed -i"
Date: Mon, 22 Jun 2015 08:03:52 -0700

On Mon, Jun 22, 2015 at 7:40 AM, Stanislav Brabec <address@hidden> wrote:
> "sed -i -" does not fail, but it also does not do what one would expect.
> It attempts to access file "./-" and edit it in place.
>
> Keep special meaning of "-" even for "sed -i". It will cause failure,
> which is what most people would expect:
>
> sed: couldn't edit /dev/stdin: is a terminal
>
> Note that the previous behavior could have security implications:
> ln -s /etc/passwd -- -
> echo root | sed -i --follow-symlinks s/root/parrot/ -
>
> Signed-off-by: Stanislav Brabec <address@hidden>
> ---
>  sed/execute.c        |  2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sed/execute.c b/sed/execute.c

Thanks for the patch.
I guess you didn't see that I posted one yesterday?

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20796#8





reply via email to

[Prev in Thread] Current Thread [Next in Thread]