tCheck for -1 rather than <0 on execlp. - git-restrict - simple utility for git repo permission management (HTM) git clone https://git.parazyd.org/git-restrict (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 4a1545ecfba335e9eecb33dfac5cdae949090a88 (DIR) parent ba0936bd825bf583f4521d4fb09aec4a38f24167 (HTM) Author: parazyd <parazyd@dyne.org> Date: Mon, 19 Apr 2021 02:00:45 +0200 Check for -1 rather than <0 on execlp. Diffstat: M git-restrict.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- (DIR) diff --git a/git-restrict.c b/git-restrict.c t@@ -53,6 +53,7 @@ int main(int argc, char *argv[]) repo[strlen(repo) - 1] = 0; for (i = 1; i < argc; i++) { + /* This is so both "foo" and "foo.git" are supported */ if ((buf = malloc(strlen(repo) + 4)) == NULL) { perror("malloc"); return 1; t@@ -72,7 +73,7 @@ int main(int argc, char *argv[]) if (!authorized) die("fatal: Access to repository denied."); - if (execlp("git-shell", "git-shell", "-c", orig_cmd, (char *)NULL) < 0) + if (execlp("git-shell", "git-shell", "-c", orig_cmd, (char *)NULL) == -1) perror("execlp"); return 1;