[darcs-users] Re: Can I disable \xx quoting in record --interactive?
Junio C Hamano
junkio at cox.net
Sun Mar 20 18:45:51 UTC 2005
>>>>> "TP" == Tommy Pettersson <ptp at lysator.liu.se> writes:
TP> On Sat, Mar 19, 2005 at 10:00:47PM -0800, Junio C Hamano wrote:
>> What evil patches? My question is about "darcs record" showing
TP> It is possible to insert escape codes in any terminal output
TP> that will put...
Yes I knew that was what you meant when you said "evil patches";
on certain terminals, you can have the terminal echo arbitrary
string to its input, effectively causing user "type" it.
But the point is that the topic is about "darcs record", where
the interactive command is used to pick hunks from *my* own
changes, not "darcs apply" where I have to pick hunks from
others. For the latter I agree that darcs should help users
protect themselves. For the former darcs should avoid getting
in the way. Ideally they should use different hunk display
And even for the "apply" case, hex escaping is not always safer
than not escaping. It hides a different kind of "attack".
Let's say you are the release coordinator for OSS Frobomaster
2000 project. The project is updating the software name from
Frobomaster 2004 to Frobomaster 2005, so you are taking a lot of
message change patches. One of the patches you received from
your i18n team looks like this:
- printf("Thanks for using Frobomaster 2004.\n");
+ printf("You are an idiot if you use Frobomaster 2005.\n");
Obviously you would not apply it before talking to the sender of
the patch. But you might miss it if it were presented this way:
- printf("\54\68\61\6e\6b\73 \66\6f\72 \75\73\69\6e\67 Frobomaster 2004.\n");
+ printf("\59\6f\75 \61\72\65 \69\64\69\6f\74 \69\66 \79\6f\75 \75\73\65 Frobomaster 2005.\n");
You would probably need "show human readable without munging"
even in the apply case as an option (it should not be the
default in the apply case for safety). Maybe the list of "what
do you want to do with this hunk" choice can include "view it
without hex munging"?
More information about the darcs-users