Skip to content

Commit b32b034

Browse files
committed
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 <[email protected]>
1 parent 7043a68 commit b32b034

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/tlshd/config.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646

4747
static GKeyFile *tlshd_configuration;
4848

49+
/**
50+
* ALLPERMS exists in glibc, but not on musl, so we
51+
* manually define TLSHD_ACCESSPERMS instead of using ALLPERMS.
52+
*/
53+
#define TLSHD_ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
54+
4955
/**
5056
* tlshd_config_init - Read tlshd's config file
5157
* @pathname: Pathname to config file
@@ -149,7 +155,7 @@ static bool tlshd_config_read_datum(const char *pathname, gnutls_datum_t *data,
149155
if (statbuf.st_uid != owner)
150156
tlshd_log_notice("File %s: expected owner %u",
151157
pathname, owner);
152-
if ((statbuf.st_mode & ALLPERMS) != mode)
158+
if ((statbuf.st_mode & TLSHD_ACCESSPERMS) != mode)
153159
tlshd_log_notice("File %s: expected mode %o",
154160
pathname, mode);
155161
buf = malloc(size);

0 commit comments

Comments
 (0)