Commit graph

155 commits

Author SHA1 Message Date
Junio C Hamano b10d0ec732 [PATCH] Use sq_quote() to properly quote the parameter to call shell.
This tries to be more lenient to the users and stricter to the
attackers by quoting the input properly for shell safety,
instead of forbidding certain characters from the input.

Things to note:

 - We do not quote "prog" parameter (which comes from --exec).
   The user should know what he is doing.  --exec='echo foo'
   will supply the first two parameters to the resulting
   command, while --exec="'echo foo'" will give the first
   parameter, a single string with a space inside.

 - We do not care too much about leaking the sq_quote() output
   just before running exec().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-08 11:01:10 -07:00
Linus Torvalds 924e121954 Mark more characters shell-safe.
I still worry about just quoting things when passing it off to "ssh" or
"sh -c", so I'm being anal.  But _, ^ and , are certainly ok and while
both ~ and @ can have speacial meaning to shell/ssh they are benign.
2005-07-07 17:59:23 -07:00
Linus Torvalds 41cb7488b9 Move "get_ack()" to common git_connect functions
git-clone-pack will want it too. Soon.
2005-07-05 15:44:09 -07:00
Linus Torvalds 013e7c7ff4 Move ref path matching to connect.c library
It's a generic thing for matching refs from the other side.
2005-07-04 13:24:30 -07:00
Linus Torvalds f71925983d Factor out the ssh connection stuff from send-pack.c
I want to use it for git-fetch-pack too.
2005-07-04 11:57:58 -07:00