diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/blogc-git-receiver/post-receive.c | 5 | ||||
-rw-r--r-- | src/blogc-git-receiver/pre-receive.c | 5 | ||||
-rw-r--r-- | src/blogc-git-receiver/shell.c | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/blogc-git-receiver/post-receive.c b/src/blogc-git-receiver/post-receive.c index 3593bb5..93cae25 100644 --- a/src/blogc-git-receiver/post-receive.c +++ b/src/blogc-git-receiver/post-receive.c @@ -76,7 +76,10 @@ bgr_post_receive_hook(int argc, char *argv[]) goto push; } - char *home = getenv("HOME"); + char *home = getenv("BLOGC_GIT_RECEIVER_BASEDIR"); + if (home == NULL) { + home = getenv("HOME"); + } if (home == NULL) { fprintf(stderr, "warning: failed to find user home path, " "mirroring disabled\n"); diff --git a/src/blogc-git-receiver/pre-receive.c b/src/blogc-git-receiver/pre-receive.c index b059753..20c6738 100644 --- a/src/blogc-git-receiver/pre-receive.c +++ b/src/blogc-git-receiver/pre-receive.c @@ -177,7 +177,10 @@ bgr_pre_receive_hook(int argc, char *argv[]) goto cleanup; } - char *home = getenv("HOME"); + char *home = getenv("BLOGC_GIT_RECEIVER_BASEDIR"); + if (home == NULL) { + home = getenv("HOME"); + } if (home == NULL) { fprintf(stderr, "error: failed to find user home path\n"); rv = 3; diff --git a/src/blogc-git-receiver/shell.c b/src/blogc-git-receiver/shell.c index 1ad8f20..eb859e8 100644 --- a/src/blogc-git-receiver/shell.c +++ b/src/blogc-git-receiver/shell.c @@ -35,7 +35,10 @@ bgr_shell(int argc, char *argv[]) } // get home path - char *home = getenv("HOME"); + char *home = getenv("BLOGC_GIT_RECEIVER_BASEDIR"); + if (home == NULL) { + home = getenv("HOME"); + } if (home == NULL) { fprintf(stderr, "error: failed to find user home path\n"); rv = 3; |