commit 3b70620381319263c9c5e4d4ddbc07118aa5fb87 from: Stefan Sperling date: Mon Jan 02 12:22:27 2023 UTC gotd.conf: complain if a repository lacks a path in the configuration file commit - 7683f79a1159f06db89b132aa5fceb5f3146bb2a commit + 3b70620381319263c9c5e4d4ddbc07118aa5fb87 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); }