aboutsummaryrefslogtreecommitdiff
Avoid using MAXPATHLEN and MAXHOSTLEN on the Hurd.

Taken from https://salsa.debian.org/debian/krb5/-/blob/master/debian/patches/debian-local/0001-Debian-HURD-compatibility.patch

From: Sam Hartman <hartmans@debian.org>
Date: Mon, 26 Dec 2011 18:05:13 -0500
Subject: Debian: HURD compatibility

HURD has no MAXPATHLEN or MAXHOSTLEN.

Patch-Category: debian-local
---
 src/clients/ksu/ksu.h                       | 4 ++++
 src/include/k5-int.h                        | 3 +++
 src/kadmin/ktutil/ktutil_funcs.c            | 4 ++++
 src/kprop/kprop_util.c                      | 4 ++++
 src/lib/gssapi/spnego/spnego_mech.c         | 3 +++
 src/lib/krb5/os/sn2princ.c                  | 4 ++++
 src/plugins/kdb/db2/libdb2/include/db-int.h | 4 ++++
 src/tests/resolve/resolve.c                 | 4 ++++
 8 files changed, 30 insertions(+)

$ diff -u krb5-1.18/src/util/ss/help.c.orig krb5-1.18/src/util/ss/help.c
--- krb5-1.18/src/util/ss/help.c.orig	2020-03-07 23:25:52.712418587 +0100
+++ krb5-1.18/src/util/ss/help.c	2020-03-07 23:26:25.764941122 +0100
@@ -6,6 +6,9 @@
  */
 
 #include <sys/param.h>
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
 #include <sys/types.h>
 #include <errno.h>
 #include <sys/file.h>
$ diff -u krb5-1.18/src/lib/krb5/os/hostrealm.c.orig krb5-1.18/src/lib/krb5/os/hostrealm.c
--- krb5-1.18/src/lib/krb5/os/hostrealm.c.orig	2020-03-07 23:33:19.931420994 +0100
+++ krb5-1.18/src/lib/krb5/os/hostrealm.c	2020-03-07 23:33:58.628026424 +0100
@@ -42,6 +42,10 @@
 #endif
 #endif
 
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
 struct hostrealm_module_handle {
     struct krb5_hostrealm_vtable_st vt;
     krb5_hostrealm_moddata data;
diff --git a/src/clients/ksu/ksu.h b/src/clients/ksu/ksu.h
index 3bf0bd4..f680b33 100644
--- a/src/clients/ksu/ksu.h
+++ b/src/clients/ksu/ksu.h
@@ -56,6 +56,10 @@
 #define MAX_CMD 2048 /* this is temp, should use realloc instead,
                         as done in most of the code */
 
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
+
 
 extern int optind;
 extern char * optarg;
diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index 6522422..e4f1678 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -589,6 +589,9 @@ extern char *strdup (const char *);
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>                  /* MAXPATHLEN */
 #endif
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
 
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>                   /* prototypes for file-related
diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c
index 6d119a2..fb7fa22 100644
--- a/src/kadmin/ktutil/ktutil_funcs.c
+++ b/src/kadmin/ktutil/ktutil_funcs.c
@@ -34,6 +34,10 @@
 #include <string.h>
 #include <ctype.h>
 
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
+
 /*
  * Free a kt_list
  */
diff --git a/src/kprop/kprop_util.c b/src/kprop/kprop_util.c
index c32d174..d72ab18 100644
--- a/src/kprop/kprop_util.c
+++ b/src/kprop/kprop_util.c
@@ -32,6 +32,10 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
 /*
  * Convert an IPv4 or IPv6 socket address to a newly allocated krb5_address.
  * There is similar code elsewhere in the tree, so this should possibly become
diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c
index 9d6027c..585d8a6 100644
--- a/src/lib/gssapi/spnego/spnego_mech.c
+++ b/src/lib/gssapi/spnego/spnego_mech.c
@@ -65,6 +65,9 @@
 #include	"gssapiP_spnego.h"
 #include	<gssapi_err_generic.h>
 
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
 
 #undef g_token_size
 #undef g_verify_token_header
diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c
index 5932fd9..187daa8 100644
--- a/src/lib/krb5/os/sn2princ.c
+++ b/src/lib/krb5/os/sn2princ.c
@@ -126,6 +126,10 @@ find_trailer(const char *hostname)
     return p;
 }
 
+#ifndef MAXHOSTNAMELEN
+# define MAXHOSTNAMELEN 256
+#endif
+
 krb5_error_code KRB5_CALLCONV
 krb5_sname_to_principal(krb5_context context, const char *hostname,
                         const char *sname, krb5_int32 type,
diff --git a/src/plugins/kdb/db2/libdb2/include/db-int.h b/src/plugins/kdb/db2/libdb2/include/db-int.h
index 7e981d4..d83b3b6 100644
--- a/src/plugins/kdb/db2/libdb2/include/db-int.h
+++ b/src/plugins/kdb/db2/libdb2/include/db-int.h
@@ -280,4 +280,8 @@ void	 __dbpanic __P((DB *dbp));
 #ifndef O_BINARY
 #define O_BINARY	0		/* Needed for Win32 compiles */
 #endif
+
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
 #endif /* _DB_INT_H_ */
ackages/compression.scm, gnu/packages/connman.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dav.scm, gnu/packages/direct-connect.scm, gnu/packages/disk.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/docker.scm, gnu/packages/ebook.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/finance.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/freedesktop.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/geo.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/gtk.scm, gnu/packages/ham-radio.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/kde-frameworks.scm, gnu/packages/key-mon.scm, gnu/packages/libffi.scm, gnu/packages/libreoffice.scm, gnu/packages/libusb.scm, gnu/packages/lirc.scm, gnu/packages/logging.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/medical.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/nutrition.scm, gnu/packages/openldap.scm, gnu/packages/openstack.scm, gnu/packages/package-management.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/photo.scm, gnu/packages/polkit.scm, gnu/packages/protobuf.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/qt.scm, gnu/packages/rdf.scm, gnu/packages/ruby.scm, gnu/packages/search.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/simulation.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/storage.scm, gnu/packages/sync.scm, gnu/packages/terminals.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/tryton.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/virtualization.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wicd.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: Update module references. Ricardo Wurmus 2018-06-26gnu: glog: Return #t from all phases....* gnu/packages/logging.scm (glog)[arguments]: Substitute INVOKE for SYSTEM*. Tobias Geerinckx-Rice 2018-03-09gnu: 'autoconf-wrapper' is no longer a procedure....Fixes <https://bugs.gnu.org/30710>. Suggested by Björn Höfling <bjoern.hoefling@bjoernhoefling.de>. * gnu/packages/autotools.scm (autoconf-wrapper): Rename to... (make-autoconf-wrapper): ... this. Add 'properties' field. (autoconf-wrapper): New variable. * gnu/packages/gnunet.scm (guile-gnunet): Adjust accordingly. * gnu/packages/gnupg.scm (signing-party): Likewise. * gnu/packages/guile.scm (guile-ics, guile-bash): Likewise. * gnu/packages/libevent.scm (libuv): Likewise. * gnu/packages/logging.scm (glog): Likewise. * gnu/packages/mail.scm (libetpan): Likewise. * gnu/packages/mate.scm (mate-icon-theme-faenza) (mate-screensaver): Likewise. * gnu/packages/package-management.scm (guix): Likewise. * gnu/packages/sawfish.scm (librep): Likewise. * gnu/packages/video.scm (motion): Likewise. * gnu/packages/zile.scm (zile-on-guile): Likewise. Ludovic Courtès