提交 a4d17973 编写于 作者: J Junio C Hamano

Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  doc/git-daemon: add missing arguments to options
  init: Do not segfault on big GIT_TEMPLATE_DIR environment variable
...@@ -48,7 +48,7 @@ OPTIONS ...@@ -48,7 +48,7 @@ OPTIONS
'git-daemon' will refuse to start when this option is enabled and no 'git-daemon' will refuse to start when this option is enabled and no
whitelist is specified. whitelist is specified.
--base-path:: --base-path=path::
Remap all the path requests as relative to the given path. Remap all the path requests as relative to the given path.
This is sort of "GIT root" - if you run 'git-daemon' with This is sort of "GIT root" - if you run 'git-daemon' with
'--base-path=/srv/git' on example.com, then if you later try to pull '--base-path=/srv/git' on example.com, then if you later try to pull
...@@ -81,8 +81,8 @@ OPTIONS ...@@ -81,8 +81,8 @@ OPTIONS
Incompatible with --port, --listen, --user and --group options. Incompatible with --port, --listen, --user and --group options.
--listen=host_or_ipaddr:: --listen=host_or_ipaddr::
Listen on an a specific IP address or hostname. IP addresses can Listen on a specific IP address or hostname. IP addresses can
be either an IPv4 address or an IPV6 address if supported. If IPv6 be either an IPv4 address or an IPv6 address if supported. If IPv6
is not supported, then --listen=hostname is also not supported and is not supported, then --listen=hostname is also not supported and
--listen must be given an IPv4 address. --listen must be given an IPv4 address.
Incompatible with '--inetd' option. Incompatible with '--inetd' option.
...@@ -90,15 +90,15 @@ OPTIONS ...@@ -90,15 +90,15 @@ OPTIONS
--port=n:: --port=n::
Listen on an alternative port. Incompatible with '--inetd' option. Listen on an alternative port. Incompatible with '--inetd' option.
--init-timeout:: --init-timeout=n::
Timeout between the moment the connection is established and the Timeout between the moment the connection is established and the
client request is received (typically a rather low value, since client request is received (typically a rather low value, since
that should be basically immediate). that should be basically immediate).
--timeout:: --timeout=n::
Timeout for specific client sub-requests. This includes the time Timeout for specific client sub-requests. This includes the time
it takes for the server to process the sub-request and time spent it takes for the server to process the sub-request and the time spent
waiting for next client's request. waiting for the next client's request.
--max-connections:: --max-connections::
Maximum number of concurrent clients, defaults to 32. Set it to Maximum number of concurrent clients, defaults to 32. Set it to
...@@ -150,7 +150,7 @@ the facility of inet daemon to achieve the same before spawning ...@@ -150,7 +150,7 @@ the facility of inet daemon to achieve the same before spawning
Enable/disable the service site-wide per default. Note Enable/disable the service site-wide per default. Note
that a service disabled site-wide can still be enabled that a service disabled site-wide can still be enabled
per repository if it is marked overridable and the per repository if it is marked overridable and the
repository enables the service with an configuration repository enables the service with a configuration
item. item.
--allow-override=service:: --allow-override=service::
......
...@@ -122,8 +122,10 @@ static void copy_templates(const char *template_dir) ...@@ -122,8 +122,10 @@ static void copy_templates(const char *template_dir)
template_dir = system_path(DEFAULT_GIT_TEMPLATE_DIR); template_dir = system_path(DEFAULT_GIT_TEMPLATE_DIR);
if (!template_dir[0]) if (!template_dir[0])
return; return;
template_len = strlen(template_dir);
if (PATH_MAX <= (template_len+strlen("/config")))
die("insanely long template path %s", template_dir);
strcpy(template_path, template_dir); strcpy(template_path, template_dir);
template_len = strlen(template_path);
if (template_path[template_len-1] != '/') { if (template_path[template_len-1] != '/') {
template_path[template_len++] = '/'; template_path[template_len++] = '/';
template_path[template_len] = 0; template_path[template_len] = 0;
......
...@@ -199,4 +199,13 @@ test_expect_success 'init honors global core.sharedRepository' ' ...@@ -199,4 +199,13 @@ test_expect_success 'init honors global core.sharedRepository' '
x`git config -f shared-honor-global/.git/config core.sharedRepository` x`git config -f shared-honor-global/.git/config core.sharedRepository`
' '
test_expect_success 'init rejects insanely long --template' '
(
insane=$(printf "x%09999dx" 1) &&
mkdir test &&
cd test &&
test_must_fail git init --template=$insane
)
'
test_done test_done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册