Skip to content

Commit

Permalink
distccd: check for approved compilers in /usr/lib/distcc
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
asheplyakov committed Jul 21, 2021
1 parent ef795d4 commit 7f53439
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/serve.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 7f53439

Please sign in to comment.