bug-patch
[Top][All Lists]
Advanced

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

Re: [bug-patch] [PATCH] do not validate target name when it is specified


From: Andreas Gruenbacher
Subject: Re: [bug-patch] [PATCH] do not validate target name when it is specified on the command line
Date: Wed, 16 Feb 2011 17:57:47 +0100
User-agent: KMail/1.12.4 (Linux/2.6.36-rc7+; KDE/4.3.5; i686; ; )

On Wednesday 16 February 2011 17:39:07 Jim Meyering wrote:
> However, if somehow you can come up with input that contains 3 bad
> file names, A, B, A, then yes, you would inappropriately see two
> warnings about A.

Yes, this is what happens.  A patch like this won't be very common, but still:

cat > d.diff <<EOF
--- ../x
+++ ../y
@@ -0,0 +1 @@
+x
EOF

touch ../x ../y
check 'patch -f -p0 --dry-run < d.diff || echo status: $?' <<EOF
Ignoring potentially dangerous file name ../x
Ignoring potentially dangerous file name ../y
Ignoring potentially dangerous file name ../x
Ignoring potentially dangerous file name ../y
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ../x
|+++ ../y
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
status: 1
EOF


Andreas



reply via email to

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