commit - 1dec34dfda7ccb3caadab65aca907251ab8fd72e
commit + 83577462cc61708af1c98d70939bb1d6c54a1506
blob - ccde19f88e7b40b792b110a9d7de24f505e67cae
blob + 42253ba60317aec22ed6f18dd8917d823ce845ed
--- gotd/gotd.conf.5
+++ gotd/gotd.conf.5
is granted read access and many concurrent connections will share this
anonymous user identity.
.El
-.It Ic unix_socket Ar path
+.It Ic listen on Ar path
Set the path to the unix socket which
.Xr gotd 8
should listen on.
# Run as the default user:
user _gotd
+# Listen on the default socket:
+listen on "/var/run/gotd.sock"
+
# This repository can be accessed via ssh://user@example.com/src
repository "src" {
path "/var/git/src.git"
blob - 2103f5caa2ef025a6e22f6667363ba2268844af0
blob + a29a7a44f821516812229082c0eb453b05172017
--- gotd/parse.y
+++ gotd/parse.y
%}
-%token PATH ERROR ON UNIX_SOCKET USER REPOSITORY PERMIT DENY
+%token PATH ERROR LISTEN ON USER REPOSITORY PERMIT DENY
%token RO RW CONNECTION LIMIT REQUEST TIMEOUT
%token <v.string> STRING
}
;
-main : UNIX_SOCKET STRING {
+main : LISTEN ON STRING {
if (gotd_proc_id == PROC_LISTEN) {
- if (strlcpy(gotd->unix_socket_path, $2,
+ if (strlcpy(gotd->unix_socket_path, $3,
sizeof(gotd->unix_socket_path)) >=
sizeof(gotd->unix_socket_path)) {
yyerror("%s: unix socket path too long",
__func__);
- free($2);
+ free($3);
YYERROR;
}
}
- free($2);
+ free($3);
}
| USER STRING {
if (strlcpy(gotd->user_name, $2,
{ "connection", CONNECTION },
{ "deny", DENY },
{ "limit", LIMIT },
+ { "listen", LISTEN },
{ "on", ON },
{ "path", PATH },
{ "permit", PERMIT },
{ "ro", RO },
{ "rw", RW },
{ "timeout", TIMEOUT },
- { "unix_socket", UNIX_SOCKET },
{ "user", USER },
};
const struct keywords *p;
blob - c43ea128c1006bf4ed809106ce3ea7d8811bbf90
blob + af62270eac97585fd2c25fe84f7394ea0f036e99
--- regress/gotd/Makefile
+++ regress/gotd/Makefile
fi
start_gotd_ro: ensure_root
- @echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+ @echo 'listen on "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
@echo ' path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf
@$(GOTD_TRAP); sleep .5
start_gotd_ro_group: ensure_root
- @echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+ @echo 'listen on "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
@echo ' path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf
# try a permit rule followed by a deny rule; last matched rule wins
start_gotd_ro_denied_user: ensure_root
- @echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+ @echo 'listen on "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
@echo ' path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf
# try a permit rule followed by a deny rule; last matched rule wins
start_gotd_ro_denied_group: ensure_root
- @echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+ @echo 'listen on "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
@echo ' path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf
# $GOTD_DEVUSER should not equal $GOTD_USER
start_gotd_ro_bad_user: ensure_root
- @echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+ @echo 'listen on "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
@echo ' path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf
# $GOTD_DEVUSER should not be in group wheel
start_gotd_ro_bad_group: ensure_root
- @echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+ @echo 'listen on "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
@echo ' path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf
@$(GOTD_TRAP); sleep .5
start_gotd_rw: ensure_root
- @echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+ @echo 'listen on "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
@echo ' path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf