[PATCH/RFCv1] git-p4: handle files with shell metacharacters

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

 



git-p4 uses the shell to execute perforce and git. This leads to problems
where files contain shell metacharacters or spaces. I first hit this
when someone checked in files with dollars ($) in their name, but in theory
you could cause complete havoc with other characters: backticks in a
filename would be especially entertaining.

Make git-p4 use subprocess.Popen() and subprocess.call() instead, and
pass in argv[] style arrays instead, at least for cases where filenames
are involved. Add test cases.

Notes:

This patch is based on Pete Wyckoff's recent patch series for refactoring
the git-p4 test harness, so it won't apply to the current next or master
branches.

I tried testing it on Cygwin as well, but the test harness appears to be
very broken on that platform as it is unable to start p4d.

Luke Diamand (1):
  git-p4: handle files with shell metacharacters

 contrib/fast-import/git-p4     |  174 +++++++++++++++++++++++++---------------
 t/t9800-git-p4.sh              |    2 +-
 t/t9803-git-shell-metachars.sh |   70 ++++++++++++++++
 3 files changed, 179 insertions(+), 67 deletions(-)
 create mode 100755 t/t9803-git-shell-metachars.sh

-- 
1.7.6.347.g4db0d

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]