]> thyrsus.com Git - rcs-fast-import.git/commit
Fix shell quoting issues with the commit messages
authorMike Fleetwood <mike.fleetwood@googlemail.com>
Fri, 30 Aug 2013 21:35:20 +0000 (22:35 +0100)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 3 Sep 2013 18:21:44 +0000 (14:21 -0400)
commitaf857c1f0586de528f2d52b5b4fa340c52d7b8d6
tree6ad4075002ce7a8956330f968f7c8d6af28a9551
parent5294d9dc3598785078ed4eca33e663f639da2a4b
Fix shell quoting issues with the commit messages

The commit message was subject to shell double quote expansion because
it was passed as a parameter to `ci' and external commands are executed
via a shell.  This could cause commit messages to be modified and to
even fail the import.  Single quote the commit message instead.

Test case:

$ cat test-03-comment-quoting.fastexp
commit refs/heads/master
mark :1
committer Joe Bloggs <joe.bloggs@example.com> 998655365 +0100
data 84
Commit message containing shell double quote special characters (`) ($HOME) and (')

M 644 inline file.txt
data 21
Contents of file.txt

$ rcs-fast-export -v -v -v < test-03-comment-quoting.fastexp
rcs-fast-import: repository fast import creates
/tmp/test/.rs24387
rcs-fast-import:......(0.00 sec) done.
commit refs/heads/master
rcs-fast-import:    :1 M file.txt
rcs-fast-import: linking ../.rs24387/inline-152187820 to file.txt
Assigning 1.1 to file.txt
rcs-fast-import: executing 'ci -l1.1 -d'Fri 24 Aug 2001 13:16:05 +0100'
-m"Committer: Joe Bloggs <joe.bloggs@example.com>
Committer-Date: Fri 24 Aug 2001 13:16:05 +0100
Mark: :1

Commit message containing shell double quote special characters (`) ($HOME) and (')
" file.txt RCS/file.txt,v' modify
/bin/sh: -c: line 4: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 6: syntax error: unexpected end of file
cleaning up......(0.00 sec) done.
rcs-fast-import: cleaning up
/tmp/test/.rs24387......(0.00 sec)
done.
rcs-fast-import: child returned 1.
rcs-fast-import