[PATCH v2 1/1] print git version string in footer

Christian Hesse list at eworm.de
Tue Jun 5 17:08:31 CEST 2018


From: Christian Hesse <mail at eworm.de>

This helps tracking what git version cgit uses. The security implications are
low as anybody can look up the version of our submodule anyway. The paranoid
can use a custom footer. :-p

On the other hand this brings potential security issues to the
administrators eyes...

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-shared.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ui-shared.c b/ui-shared.c
index 9d8f66b..8bd1d97 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -10,6 +10,7 @@
 #include "ui-shared.h"
 #include "cmd.h"
 #include "html.h"
+#include "version.h"
 
 static const char cgit_doctype[] =
 "<!DOCTYPE html>\n";
@@ -785,8 +786,9 @@ void cgit_print_docend(void)
 	if (ctx.cfg.footer)
 		html_include(ctx.cfg.footer);
 	else {
-		htmlf("<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit %s</a> at ",
+		htmlf("<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit %s</a> ",
 			cgit_version);
+		htmlf("(<a href='https://git-scm.com/'>git %s</a>) at ", git_version_string);
 		html_txt(show_date(time(NULL), 0, cgit_date_mode(DATE_ISO8601)));
 		html("</div>\n");
 	}


More information about the CGit mailing list