From ca95e956307672484e8c018263600749aa9c4f4d Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair.francis@wdc.com>
Date: Wed, 9 Apr 2025 11:14:52 +1000
Subject: [PATCH] tlshd: Define ALLPERMS if it doesn't exist to fix musl build

ALLPERMS exists in glibc, but not on musl, so we manually define
it if it doesn't exist. This fixes building on musl systems.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Upstream-Status: Submitted [https://github.com/oracle/ktls-utils/pull/88]
---
 src/tlshd/config.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/tlshd/config.c b/src/tlshd/config.c
index 38948e8..e653bd8 100644
--- a/src/tlshd/config.c
+++ b/src/tlshd/config.c
@@ -46,6 +46,14 @@
 
 static GKeyFile *tlshd_configuration;
 
+/**
+ * ALLPERMS exists in glibc, but not on musl, so we
+ * manually define it if it doesn't exist
+ */
+#ifndef ALLPERMS
+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
 /**
  * tlshd_config_init - Read tlshd's config file
  * @pathname: Pathname to config file
-- 
2.49.0

