commit 859316d03c1ee64b2c2fd2787e727daadf60bcf3 from: Stefan Sperling date: Wed Apr 12 13:05:24 2023 UTC make gotd/gitwrapper start up even if a repository is missing on disk This should result in more useful behaviour when gitwrapper runs and repositories listed in gotd.conf do not yet exist or do no longer exist. commit - cc88020e952af813c1e01b91ab6516969562e972 commit + 859316d03c1ee64b2c2fd2787e727daadf60bcf3 blob - d2433c74f9a4a7dda902b7cb09f1acc7b78ff8d8 blob + 86df002974199b257619f65568a8d0fe77f560af --- gotd/parse.y +++ gotd/parse.y @@ -311,9 +311,19 @@ repoopts1 : PATH STRING { YYERROR; } if (realpath($2, new_repo->path) == NULL) { - yyerror("realpath %s: %s", $2, strerror(errno)); - free($2); - YYERROR; + yyerror("realpath %s: %s", $2, + strerror(errno)); + /* + * Give admin a chance to create + * missing repositories at run-time. + */ + if (errno != ENOENT) { + free($2); + YYERROR; + } else if (strlcpy(new_repo->path, $2, + sizeof(new_repo->path)) >= + sizeof(new_repo->path)) + yyerror("path too long"); } } free($2);