diff /home/othersrc/got commit - 70c522a63bb0def0601951963f7dfd546c08437a path + /home/othersrc/got blob - 0e5695cd1f8bf1ddc42ba2137e7544ebb541d645 file + gotwebd/gotweb.c --- gotwebd/gotweb.c +++ gotwebd/gotweb.c @@ -2439,14 +2439,10 @@ done: } done: - if (srv->respect_exportok) { - if (asprintf(&dir_test, "%s/%s/git-daemon-export-ok", - srv->repos_path, repo_dir->name) == -1) - return got_error_from_errno("asprintf"); - if (access(dir_test, F_OK) == -1) { - error = got_error_path(repo_dir->name, GOT_ERR_NOT_GIT_REPO); - goto err; - } + if (srv->respect_exportok && + faccessat(dirfd(dt), "git-daemon-export-ok", F_OK, 0) == -1) { + error = got_error_path(repo_dir->name, GOT_ERR_NOT_GIT_REPO); + goto err; }