Skip to contentSkip to conversation

Add interpolated git-daemon virtualization support.

PATCH/RFC Jon Loeliger 1 participant 1 message Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

---

Junio,

Here are my patches for the git daemon virtualization after I rewrote the interpolation code. I think there are still issues with the path/directory specification mechanism, as I end up with crufty inetd invocation:

    git  stream  tcp  nowait  nobody  /usr/bin/git-daemon git-daemon --inetd
        --verbose --syslog
        --export-all --interpolated-path=/pub/%H/%D
	/pub/software /software
	/pub/www.example.com/software
	/pub/www.example.org/software
	/pub

A natural suggestion here is to supply %PeerIP from the connection.

Feel free to extend, augment or make suggestions, of course.

Thanks,
jdl

 Makefile      |    4 ++
 daemon.c      |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 interpolate.c |   83 +++++++++++++++++++++++++++++++++++++++++++++++
 interpolate.h |   13 +++++++
 4 files changed, 188 insertions(+), 13 deletions(-)
Makefile +3 -1
index b15b420..2691a58 100644
@@ -242,7 +242,9 @@ DIFF_OBJS = \
 
 LIB_OBJS = \
 	blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \
-	date.o diff-delta.o entry.o exec_cmd.o ident.o lockfile.o \
+	date.o diff-delta.o entry.o exec_cmd.o ident.o \
+	interpolate.o \
+	lockfile.o \
 	object.o pack-check.o patch-delta.o path.o pkt-line.o \
 	quote.o read-cache.o refs.o run-command.o dir.o object-refs.o \
 	server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
daemon.c +89 -12

175 lines not on this page · raw message

interpolate.c new file +83 -0

83 lines not on this page · raw message

interpolate.h new file +13 -0
new file mode 100644
index 0000000..241af7c
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2006 Jon Loeliger
+ */
+
+struct interp {
+	char *name;
+	char *value;
+};
+
+extern int interpolate(char *result, int reslen,
+		       char *orig,
+		       struct interp *interps, int ninterps);
+