credential-cache--daemon: disallow relative socket path
[gitweb.git] / credential-cache--daemon.c
index 118d04f137fad72e7bc3aa5693129d75e0aa3b83..fe3779472cedc159dd8d6960f498c5f742782933 100644 (file)
@@ -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);