summaryrefslogtreecommitdiff
path: root/user/elogind/hostname-length.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/elogind/hostname-length.patch')
-rw-r--r--user/elogind/hostname-length.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/user/elogind/hostname-length.patch b/user/elogind/hostname-length.patch
new file mode 100644
index 000000000..738f3573d
--- /dev/null
+++ b/user/elogind/hostname-length.patch
@@ -0,0 +1,16 @@
+musl defines HOST_NAME_MAX to 255, even though a nodename in Linux can only
+be 64 characters in length. Use the literal value instead of <limits.h>.
+
+--- elogind-252.9/src/basic/hostname-util.c.old 2023-05-15 06:35:29.000000000 -0500
++++ elogind-252.9/src/basic/hostname-util.c 2023-11-27 06:45:02.637584076 -0600
+@@ -128,8 +128,8 @@
+ if (hyphen)
+ return false;
+
+- if (p-s > HOST_NAME_MAX) /* Note that HOST_NAME_MAX is 64 on Linux, but DNS allows domain names up to
+- * 255 characters */
++ if (p-s > 64) /* Note that HOST_NAME_MAX is 64 on Linux, but DNS allows domain names up to
++ * 255 characters */
+ return false;
+
+ return true;