summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2011-10-04 16:02:00 -0400
committerJunio C Hamano <gitster@pobox.com>2011-10-04 13:30:38 -0700
commit1c64b48e67c2c83508c45817002468a9a633c991 (patch)
treed7e686833a848e65e6093c86325a68199271e75c /daemon.c
parent703f05ad5835cff92b12c29aecf8d724c8c847e2 (diff)
downloadgit-1c64b48e67c2c83508c45817002468a9a633c991.tar.gz
enter_repo: do not modify input
entr_repo(..., 0) currently modifies the input to strip away trailing slashes. This means that we some times need to copy the input to keep the original. Change it to unconditionally copy it into the used_path buffer so we can safely use the input without having to copy it. Also store a working copy in validated_path up-front before we start resolving anything. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Phil Hord <hordp@cisco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/daemon.c b/daemon.c
index 4c8346d5a1..9253192aec 100644
--- a/daemon.c
+++ b/daemon.c
@@ -108,11 +108,11 @@ static void NORETURN daemon_die(const char *err, va_list params)
exit(1);
}
-static char *path_ok(char *directory)
+static const char *path_ok(char *directory)
{
static char rpath[PATH_MAX];
static char interp_path[PATH_MAX];
- char *path;
+ const char *path;
char *dir;
dir = directory;