summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2021-07-21 14:33:41 +0400
committerGitHub <noreply@github.com>2021-07-21 14:33:41 +0400
commit1b9850947bc6ba9566a5388817d3cf432e3a827e (patch)
treed3b9636c1d51f2732cde9b5bcbaea0d059bfa947
parentb94b751aef444e0e9e5224730891650d03d12a4d (diff)
parent7f5343988089d15c3cced2923a939ea2a9b0d81d (diff)
downloaddistcc-git-1b9850947bc6ba9566a5388817d3cf432e3a827e.tar.gz
Merge pull request #433 from asheplyakov/fix-431
distccd: keep looking for approved compilers in /usr/lib/distcc ...
-rw-r--r--Makefile.in4
-rw-r--r--src/serve.c7
-rwxr-xr-xupdate-distcc-symlinks.py2
3 files changed, 5 insertions, 8 deletions
diff --git a/Makefile.in b/Makefile.in
index 51f4072..db895d0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -515,7 +515,9 @@ lsdistcc@EXEEXT@: $(lsdistcc_obj)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(lsdistcc_obj) $(LIBS)
update-distcc-symlinks: $(update_distcc_symlinks_PY)
- cp $< $@
+ sed -e "s;\@prefix\@;${prefix};g" $< > $@.tmp
+ chmod +x $@.tmp
+ mv $@.tmp $@
h_exten@EXEEXT@: $(h_exten_obj)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(h_exten_obj) $(LIBS)
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) {
diff --git a/update-distcc-symlinks.py b/update-distcc-symlinks.py
index bc5cff2..9f29288 100755
--- a/update-distcc-symlinks.py
+++ b/update-distcc-symlinks.py
@@ -2,7 +2,7 @@
import subprocess, string, os, stat, re
-distcc_dir = "/usr/lib/distcc"
+distcc_dir = "@prefix@/lib/distcc"
gcc_dir = "/usr/lib/gcc"
gcccross_dir = "/usr/lib/gcc-cross"
old_symlinks = set()