summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Sheplyakov <asheplyakov@altlinux.org>2021-07-21 12:03:47 +0400
committerAlexey Sheplyakov <asheplyakov@altlinux.org>2021-07-21 12:07:37 +0400
commit7f5343988089d15c3cced2923a939ea2a9b0d81d (patch)
treed3b9636c1d51f2732cde9b5bcbaea0d059bfa947
parentef795d4fa8b04ee0227377a207514221f5b33451 (diff)
downloaddistcc-git-7f5343988089d15c3cced2923a939ea2a9b0d81d.tar.gz
distccd: check for approved compilers in /usr/lib/distcc
`dcc_check_compiler_whitelist` bails out if $prefix/lib/distcc directory does not exists. With this patch it keeps looking in /usr/lib/distcc instead. Closes: #431
-rw-r--r--src/serve.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/serve.c b/src/serve.c
index fc6b782..7dd4647 100644
--- a/src/serve.c
+++ b/src/serve.c
@@ -395,13 +395,8 @@ static int dcc_check_compiler_whitelist(char *_compiler_name)
#ifdef HAVE_FSTATAT
int dirfd = open(LIBDIR "/distcc", O_RDONLY);
- if (dirfd < 0) {
- if (errno == ENOENT)
- rs_log_crit("no %s", LIBDIR "/distcc");
- return EXIT_DISTCC_FAILED;
- }
- if (faccessat(dirfd, compiler_name, X_OK, 0) < 0) {
+ if (dirfd < 0 || faccessat(dirfd, compiler_name, X_OK, 0) < 0) {
char *compiler_path = NULL;
if (asprintf(&compiler_path, "/usr/lib/distcc/%s", compiler_name) >= 0) {
if (access(compiler_path, X_OK) < 0) {