Commit | Line | Data |
---|---|---|
770ea94c JN |
1 | Avoid using MAXPATHLEN and MAXHOSTLEN on the Hurd. |
2 | ||
3 | Taken from https://salsa.debian.org/debian/krb5/-/blob/master/debian/patches/debian-local/0001-Debian-HURD-compatibility.patch | |
4 | ||
5 | From: Sam Hartman <hartmans@debian.org> | |
6 | Date: Mon, 26 Dec 2011 18:05:13 -0500 | |
7 | Subject: Debian: HURD compatibility | |
8 | ||
9 | HURD has no MAXPATHLEN or MAXHOSTLEN. | |
10 | ||
11 | Patch-Category: debian-local | |
12 | --- | |
13 | src/clients/ksu/ksu.h | 4 ++++ | |
14 | src/include/k5-int.h | 3 +++ | |
15 | src/kadmin/ktutil/ktutil_funcs.c | 4 ++++ | |
16 | src/kprop/kprop_util.c | 4 ++++ | |
17 | src/lib/gssapi/spnego/spnego_mech.c | 3 +++ | |
18 | src/lib/krb5/os/sn2princ.c | 4 ++++ | |
19 | src/plugins/kdb/db2/libdb2/include/db-int.h | 4 ++++ | |
20 | src/tests/resolve/resolve.c | 4 ++++ | |
21 | 8 files changed, 30 insertions(+) | |
22 | ||
23 | $ diff -u krb5-1.18/src/util/ss/help.c.orig krb5-1.18/src/util/ss/help.c | |
24 | --- krb5-1.18/src/util/ss/help.c.orig 2020-03-07 23:25:52.712418587 +0100 | |
25 | +++ krb5-1.18/src/util/ss/help.c 2020-03-07 23:26:25.764941122 +0100 | |
26 | @@ -6,6 +6,9 @@ | |
27 | */ | |
28 | ||
29 | #include <sys/param.h> | |
30 | +#ifndef MAXPATHLEN | |
31 | +# define MAXPATHLEN 4096 | |
32 | +#endif | |
33 | #include <sys/types.h> | |
34 | #include <errno.h> | |
35 | #include <sys/file.h> | |
36 | $ diff -u krb5-1.18/src/lib/krb5/os/hostrealm.c.orig krb5-1.18/src/lib/krb5/os/hostrealm.c | |
37 | --- krb5-1.18/src/lib/krb5/os/hostrealm.c.orig 2020-03-07 23:33:19.931420994 +0100 | |
38 | +++ krb5-1.18/src/lib/krb5/os/hostrealm.c 2020-03-07 23:33:58.628026424 +0100 | |
39 | @@ -42,6 +42,10 @@ | |
40 | #endif | |
41 | #endif | |
42 | ||
43 | +#ifndef MAXHOSTNAMELEN | |
44 | +#define MAXHOSTNAMELEN 256 | |
45 | +#endif | |
46 | + | |
47 | struct hostrealm_module_handle { | |
48 | struct krb5_hostrealm_vtable_st vt; | |
49 | krb5_hostrealm_moddata data; | |
50 | diff --git a/src/clients/ksu/ksu.h b/src/clients/ksu/ksu.h | |
51 | index 3bf0bd4..f680b33 100644 | |
52 | --- a/src/clients/ksu/ksu.h | |
53 | +++ b/src/clients/ksu/ksu.h | |
54 | @@ -56,6 +56,10 @@ | |
55 | #define MAX_CMD 2048 /* this is temp, should use realloc instead, | |
56 | as done in most of the code */ | |
57 | ||
58 | +#ifndef MAXPATHLEN | |
59 | +# define MAXPATHLEN 4096 | |
60 | +#endif | |
61 | + | |
62 | ||
63 | extern int optind; | |
64 | extern char * optarg; | |
65 | diff --git a/src/include/k5-int.h b/src/include/k5-int.h | |
66 | index 6522422..e4f1678 100644 | |
67 | --- a/src/include/k5-int.h | |
68 | +++ b/src/include/k5-int.h | |
69 | @@ -589,6 +589,9 @@ extern char *strdup (const char *); | |
70 | #ifdef HAVE_SYS_PARAM_H | |
71 | #include <sys/param.h> /* MAXPATHLEN */ | |
72 | #endif | |
73 | +#ifndef MAXPATHLEN | |
74 | +# define MAXPATHLEN 4096 | |
75 | +#endif | |
76 | ||
77 | #ifdef HAVE_SYS_FILE_H | |
78 | #include <sys/file.h> /* prototypes for file-related | |
79 | diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c | |
80 | index 6d119a2..fb7fa22 100644 | |
81 | --- a/src/kadmin/ktutil/ktutil_funcs.c | |
82 | +++ b/src/kadmin/ktutil/ktutil_funcs.c | |
83 | @@ -34,6 +34,10 @@ | |
84 | #include <string.h> | |
85 | #include <ctype.h> | |
86 | ||
87 | +#ifndef MAXPATHLEN | |
88 | +# define MAXPATHLEN 4096 | |
89 | +#endif | |
90 | + | |
91 | /* | |
92 | * Free a kt_list | |
93 | */ | |
94 | diff --git a/src/kprop/kprop_util.c b/src/kprop/kprop_util.c | |
95 | index c32d174..d72ab18 100644 | |
96 | --- a/src/kprop/kprop_util.c | |
97 | +++ b/src/kprop/kprop_util.c | |
98 | @@ -32,6 +32,10 @@ | |
99 | #include <sys/types.h> | |
100 | #include <sys/socket.h> | |
101 | ||
102 | +#ifndef MAXHOSTNAMELEN | |
103 | +#define MAXHOSTNAMELEN 256 | |
104 | +#endif | |
105 | + | |
106 | /* | |
107 | * Convert an IPv4 or IPv6 socket address to a newly allocated krb5_address. | |
108 | * There is similar code elsewhere in the tree, so this should possibly become | |
109 | diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c | |
110 | index 9d6027c..585d8a6 100644 | |
111 | --- a/src/lib/gssapi/spnego/spnego_mech.c | |
112 | +++ b/src/lib/gssapi/spnego/spnego_mech.c | |
113 | @@ -65,6 +65,9 @@ | |
114 | #include "gssapiP_spnego.h" | |
115 | #include <gssapi_err_generic.h> | |
116 | ||
117 | +#ifndef MAXHOSTNAMELEN | |
118 | +#define MAXHOSTNAMELEN 256 | |
119 | +#endif | |
120 | ||
121 | #undef g_token_size | |
122 | #undef g_verify_token_header | |
123 | diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c | |
124 | index 5932fd9..187daa8 100644 | |
125 | --- a/src/lib/krb5/os/sn2princ.c | |
126 | +++ b/src/lib/krb5/os/sn2princ.c | |
127 | @@ -126,6 +126,10 @@ find_trailer(const char *hostname) | |
128 | return p; | |
129 | } | |
130 | ||
131 | +#ifndef MAXHOSTNAMELEN | |
132 | +# define MAXHOSTNAMELEN 256 | |
133 | +#endif | |
134 | + | |
135 | krb5_error_code KRB5_CALLCONV | |
136 | krb5_sname_to_principal(krb5_context context, const char *hostname, | |
137 | const char *sname, krb5_int32 type, | |
138 | diff --git a/src/plugins/kdb/db2/libdb2/include/db-int.h b/src/plugins/kdb/db2/libdb2/include/db-int.h | |
139 | index 7e981d4..d83b3b6 100644 | |
140 | --- a/src/plugins/kdb/db2/libdb2/include/db-int.h | |
141 | +++ b/src/plugins/kdb/db2/libdb2/include/db-int.h | |
142 | @@ -280,4 +280,8 @@ void __dbpanic __P((DB *dbp)); | |
143 | #ifndef O_BINARY | |
144 | #define O_BINARY 0 /* Needed for Win32 compiles */ | |
145 | #endif | |
146 | + | |
147 | +#ifndef MAXPATHLEN | |
148 | +# define MAXPATHLEN 4096 | |
149 | +#endif | |
150 | #endif /* _DB_INT_H_ */ | |
151 | diff --git a/src/tests/resolve/resolve.c b/src/tests/resolve/resolve.c | |
152 | index 7339d21..38f7253 100644 | |
153 | --- a/src/tests/resolve/resolve.c | |
154 | +++ b/src/tests/resolve/resolve.c | |
155 | @@ -73,6 +73,10 @@ char *strchr(); | |
156 | #include <netinet/in.h> | |
157 | #include <netdb.h> | |
158 | ||
159 | +#ifndef MAXHOSTNAMELEN | |
160 | +# define MAXHOSTNAMELEN 256 | |
161 | +#endif | |
162 | + | |
163 | int | |
164 | main(argc, argv) | |
165 | int argc; |