提交 bd93b8d9 编写于 作者: J Jon Griffiths 提交者: Junio C Hamano

credential-cache--daemon: disallow relative socket path

Relative socket paths are dangerous since the user cannot generally
control when the daemon starts (initially, after a timeout, kill or
crash). Since the daemon creates but does not delete the socket
directory, this could lead to spurious directory creation relative
to the users cwd.
Suggested-by: NJeff King <peff@peff.net>
Signed-off-by: NJon Griffiths <jon_p_griffiths@yahoo.com>
Signed-off-by: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 a6e5e286
......@@ -36,7 +36,7 @@ OPTIONS
cache daemon if one is not started). Defaults to
`~/.git-credential-cache/socket`. If your home directory is on a
network-mounted filesystem, you may need to change this to a
local filesystem.
local filesystem. You must specify an absolute path.
CONTROLLING THE DAEMON
----------------------
......
......@@ -262,6 +262,9 @@ int main(int argc, const char **argv)
if (!socket_path)
usage_with_options(usage, options);
if (!is_absolute_path(socket_path))
die("socket directory must be an absolute path");
init_socket_directory(socket_path);
register_tempfile(&socket_file, socket_path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册