Package: heimdal / 7.1.0+dfsg-13+deb9u3

041_hurd_maxhostnamelen Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
diff --git a/appl/gssmask/gssmask.c b/appl/gssmask/gssmask.c
index d686556..e7f98bc 100644
--- a/appl/gssmask/gssmask.c
+++ b/appl/gssmask/gssmask.c
@@ -55,7 +55,7 @@ struct client {
     struct handle *handles;
     struct sockaddr_storage sa;
     socklen_t salen;
-    char servername[MAXHOSTNAMELEN];
+    char servername[MaxHostNameLen];
 };
 
 FILE *logfile;
@@ -1099,7 +1099,7 @@ create_client(krb5_socket_t sock, int port, const char *moniker)
     if (moniker) {
 	c->moniker = estrdup(moniker);
     } else {
-	char hostname[MAXHOSTNAMELEN];
+	char hostname[MaxHostNameLen];
 	gethostname(hostname, sizeof(hostname));
 	ret = asprintf(&c->moniker, "gssmask: %s:%d", hostname, port);
 	if (ret == -1)
diff --git a/appl/kf/kfd.c b/appl/kf/kfd.c
index 9099bab..5af66a8 100644
--- a/appl/kf/kfd.c
+++ b/appl/kf/kfd.c
@@ -128,7 +128,7 @@ proto (int sock, const char *svc)
     krb5_ticket *ticket;
     char *name;
     char ret_string[10];
-    char hostname[MAXHOSTNAMELEN];
+    char hostname[MaxHostNameLen];
     krb5_data data;
     krb5_data remotename;
     krb5_data tk_file;
diff --git a/appl/test/tcp_server.c b/appl/test/tcp_server.c
index 50d1bf4..e4b4df7 100644
--- a/appl/test/tcp_server.c
+++ b/appl/test/tcp_server.c
@@ -52,7 +52,7 @@ proto (int sock, const char *service)
     krb5_principal server;
     krb5_ticket *ticket;
     char *name;
-    char hostname[MAXHOSTNAMELEN];
+    char hostname[MaxHostNameLen];
     krb5_data packet;
     krb5_data data;
     uint32_t len, net_len;
diff --git a/lib/gssapi/spnego/accept_sec_context.c b/lib/gssapi/spnego/accept_sec_context.c
index 48b786c..63940c8 100644
--- a/lib/gssapi/spnego/accept_sec_context.c
+++ b/lib/gssapi/spnego/accept_sec_context.c
@@ -366,7 +366,7 @@ select_mech(OM_uint32 *minor_status, MechType *mechType, int verify_p,
     if (verify_p) {
 	gss_name_t name = GSS_C_NO_NAME;
 	gss_buffer_desc namebuf;
-	char *str = NULL, *host, hostname[MAXHOSTNAMELEN];
+	char *str = NULL, *host, hostname[MaxHostNameLen];
 
 	host = getenv("GSSAPI_SPNEGO_NAME");
 	if (host == NULL || issuid()) {
diff --git a/lib/krb5/get_addrs.c b/lib/krb5/get_addrs.c
index 8246504..f25925e 100644
--- a/lib/krb5/get_addrs.c
+++ b/lib/krb5/get_addrs.c
@@ -47,7 +47,7 @@ static krb5_error_code
 gethostname_fallback (krb5_context context, krb5_addresses *res)
 {
     krb5_error_code ret;
-    char hostname[MAXHOSTNAMELEN];
+    char hostname[MaxHostNameLen];
     struct hostent *hostent;
 
     if (gethostname (hostname, sizeof(hostname))) {
diff --git a/lib/krb5/get_host_realm.c b/lib/krb5/get_host_realm.c
index 35edaec..58fd87e 100644
--- a/lib/krb5/get_host_realm.c
+++ b/lib/krb5/get_host_realm.c
@@ -93,7 +93,7 @@ dns_find_realm(krb5_context context,
 	       krb5_realm **realms)
 {
     static const char *default_labels[] = { "_kerberos", NULL };
-    char dom[MAXHOSTNAMELEN];
+    char dom[MaxHostNameLen];
     struct rk_dns_reply *r;
     const char **labels;
     char **config_labels;
@@ -218,7 +218,7 @@ krb5_get_host_realm(krb5_context context,
 		    krb5_realm **realms)
 {
     const char *host = targethost;
-    char hostname[MAXHOSTNAMELEN];
+    char hostname[MaxHostNameLen];
     krb5_error_code ret;
     int use_dns;
 
diff --git a/lib/krb5/krbhst-test.c b/lib/krb5/krbhst-test.c
index 873734f..8445acf 100644
--- a/lib/krb5/krbhst-test.c
+++ b/lib/krb5/krbhst-test.c
@@ -85,7 +85,7 @@ main(int argc, char **argv)
     krb5_init_context (&context);
     for(i = 0; i < argc; i++) {
 	krb5_krbhst_handle handle;
-	char host[MAXHOSTNAMELEN];
+	char host[MaxHostNameLen];
 
 	for (j = 0; j < sizeof(types)/sizeof(*types); ++j) {
 	    printf ("%s for %s:\n", type_str[j], argv[i]);
diff --git a/lib/krb5/krbhst.c b/lib/krb5/krbhst.c
index 44689ff..e7d6cf5 100644
--- a/lib/krb5/krbhst.c
+++ b/lib/krb5/krbhst.c
@@ -1061,7 +1061,7 @@ gethostlist(krb5_context context, const char *realm,
     krb5_error_code ret;
     int nhost = 0;
     krb5_krbhst_handle handle;
-    char host[MAXHOSTNAMELEN];
+    char host[MaxHostNameLen];
     krb5_krbhst_info *hostinfo;
 
     ret = krb5_krbhst_init(context, realm, type, &handle);
diff --git a/lib/krb5/principal.c b/lib/krb5/principal.c
index 2ce5c7c..4040175 100644
--- a/lib/krb5/principal.c
+++ b/lib/krb5/principal.c
@@ -1029,7 +1029,7 @@ krb5_sname_to_principal_old(krb5_context context,
 			    krb5_principal *ret_princ)
 {
     krb5_error_code ret;
-    char localhost[MAXHOSTNAMELEN];
+    char localhost[MaxHostNameLen];
     char **realms = NULL, *host = NULL;
 
     if(type != KRB5_NT_SRV_HST && type != KRB5_NT_UNKNOWN) {
@@ -1299,7 +1299,7 @@ krb5_sname_to_principal(krb5_context context,
     char *realm, *remote_host;
     krb5_error_code ret;
     register char *cp;
-    char localname[MAXHOSTNAMELEN];
+    char localname[MaxHostNameLen];
 
     *ret_princ = NULL;
 
@@ -1308,8 +1308,8 @@ krb5_sname_to_principal(krb5_context context,
 	return KRB5_SNAME_UNSUPP_NAMETYPE;
 
     /* if hostname is NULL, use local hostname */
-    if (hostname == NULL) {
-	if (gethostname(localname, MAXHOSTNAMELEN))
+    if (!hostname) {
+	if (gethostname(localname, MaxHostNameLen))
 	    return errno;
 	hostname = localname;
     }
diff --git a/lib/krb5/verify_init.c b/lib/krb5/verify_init.c
index 128502f..2171f53 100644
--- a/lib/krb5/verify_init.c
+++ b/lib/krb5/verify_init.c
@@ -89,7 +89,7 @@ krb5_verify_init_creds(krb5_context context,
     krb5_data_zero (&req);
 
     if (ap_req_server == NULL) {
-	char local_hostname[MAXHOSTNAMELEN];
+	char local_hostname[MaxHostNameLen];
 
 	if (gethostname (local_hostname, sizeof(local_hostname)) < 0) {
 	    ret = errno;
diff --git a/lib/roken/getaddrinfo_hostspec.c b/lib/roken/getaddrinfo_hostspec.c
index 4541219..70aca71 100644
--- a/lib/roken/getaddrinfo_hostspec.c
+++ b/lib/roken/getaddrinfo_hostspec.c
@@ -45,7 +45,7 @@ roken_getaddrinfo_hostspec2(const char *hostspec,
 {
     const char *p;
     char portstr[NI_MAXSERV];
-    char host[MAXHOSTNAMELEN];
+    char host[MaxHostNameLen];
     struct addrinfo hints;
     int hostspec_len;
 
diff --git a/lib/krb5/test_plugin.c b/lib/krb5/test_plugin.c
index ed6a9e7f1..c18db5686 100644
--- a/lib/krb5/test_plugin.c
+++ b/lib/krb5/test_plugin.c
@@ -88,7 +88,7 @@ main(int argc, char **argv)
     krb5_error_code ret;
     krb5_context context;
     krb5_krbhst_handle handle;
-    char host[MAXHOSTNAMELEN];
+    char host[MaxHostNameLen];
     int found = 0;
 
     setprogname(argv[0]);