commit 88f1bb6ddf803e7ceb1f2f7a72253a46d12ae6c6 from: Stefan Sperling via: Thomas Adam date: Mon Jan 02 15:03:00 2023 UTC gotd.conf: complain if a repository lacks a path in the configuration file commit - a42b418b1416531932c59f608ef8cc9cfb442cc9 commit + 88f1bb6ddf803e7ceb1f2f7a72253a46d12ae6c6 blob - 5227ab25941ce1ee09f25658ae621317a7cc6341 blob + 612eac16fcff173392e5868ae2bfa04f9cee4b0f --- gotd/gotd.conf.5 +++ gotd/gotd.conf.5 @@ -114,6 +114,7 @@ to Numeric IDs are also accepted. .It Ic path Ar path Set the path to the Git repository. +Must be specified. .It Ic permit Ar mode Ar identity Permit repository access to users with the username .Ar identity . blob - 04a0a05924fa027b951915a3a70ba7d6524d21c5 blob + 31152bd34eaf810e24f6a49f1151c8b3927bec5c --- gotd/parse.y +++ gotd/parse.y @@ -612,6 +612,7 @@ parse_config(const char *filename, enum gotd_procid pr struct gotd *env) { struct sym *sym, *next; + struct gotd_repo *repo; memset(env, 0, sizeof(*env)); @@ -662,6 +663,14 @@ parse_config(const char *filename, enum gotd_procid pr if (errors) return (-1); + TAILQ_FOREACH(repo, &gotd->repos, entry) { + if (repo->path[0] == '\0') { + log_warnx("%s: repository \"%s\": no path provided in " + "configuration file", getprogname(), repo->name); + return (-1); + } + } + return (0); }