From b32b0345465cab1aeb613d06bab0b2464909f62d Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Wed, 9 Apr 2025 11:14:52 +1000 Subject: [PATCH] tlshd: Define TLSHD_ACCESSPERMS instead of using ALLPERMS to fix musl build ALLPERMS exists in glibc, but not on musl, so we manually define TLSHD_ACCESSPERMS and use that instaed. This fixes building on musl systems. Signed-off-by: Alistair Francis --- src/tlshd/config.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tlshd/config.c b/src/tlshd/config.c index 38948e8..be5d472 100644 --- a/src/tlshd/config.c +++ b/src/tlshd/config.c @@ -46,6 +46,12 @@ static GKeyFile *tlshd_configuration; +/** + * ALLPERMS exists in glibc, but not on musl, so we + * manually define TLSHD_ACCESSPERMS instead of using ALLPERMS. + */ +#define TLSHD_ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) + /** * tlshd_config_init - Read tlshd's config file * @pathname: Pathname to config file @@ -149,7 +155,7 @@ static bool tlshd_config_read_datum(const char *pathname, gnutls_datum_t *data, if (statbuf.st_uid != owner) tlshd_log_notice("File %s: expected owner %u", pathname, owner); - if ((statbuf.st_mode & ALLPERMS) != mode) + if ((statbuf.st_mode & TLSHD_ACCESSPERMS) != mode) tlshd_log_notice("File %s: expected mode %o", pathname, mode); buf = malloc(size);