Hi,

Alle mercoledì 23 febbraio 2011, Samuel Thibault ha scritto:
> Pino's patches are still applying fine to the sid package, and make
> the package build on hurd-i386. Could you please apply them?

There was just a bug in one of the patches (042). Attachking again all 
the patched, incuding the fixed one.

Thanks,
-- 
Pino Toscano
--- a/cf/pthreads.m4
+++ b/cf/pthreads.m4
@@ -42,6 +42,11 @@
 	PTHREADS_CFLAGS=-pthread
 	PTHREAD_LIBADD=-pthread
 	;;
+*-*-gnu*)
+	native_pthread_support=yes
+	PTHREADS_CFLAGS=-pthread
+	PTHREAD_LIBADD="-pthread -lpthread"
+	;;
 *-*-linux* | *-*-linux-gnu)
 	case `uname -r` in
 	2.*)
--- a/lib/roken/getaddrinfo_hostspec.c
+++ b/lib/roken/getaddrinfo_hostspec.c
@@ -45,7 +45,7 @@
 {
     const char *p;
     char portstr[NI_MAXSERV];
-    char host[MAXHOSTNAMELEN];
+    char host[MaxHostNameLen];
     struct addrinfo hints;
     int hostspec_len;
 
--- a/lib/krb5/get_addrs.c
+++ b/lib/krb5/get_addrs.c
@@ -47,7 +47,7 @@
 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))) {
--- a/lib/krb5/get_host_realm.c
+++ b/lib/krb5/get_host_realm.c
@@ -93,7 +93,7 @@
 	       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;
@@ -221,7 +221,7 @@
 		    krb5_realm **realms)
 {
     const char *host = targethost;
-    char hostname[MAXHOSTNAMELEN];
+    char hostname[MaxHostNameLen];
     krb5_error_code ret;
     int use_dns;
 
--- a/lib/krb5/krbhst.c
+++ b/lib/krb5/krbhst.c
@@ -982,7 +982,7 @@
     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);
--- a/lib/krb5/principal.c
+++ b/lib/krb5/principal.c
@@ -1096,8 +1096,8 @@
     const char *p;
     krb5_error_code ret;
     krb5_principal pr;
-    char host[MAXHOSTNAMELEN];
-    char local_hostname[MAXHOSTNAMELEN];
+    char host[MaxHostNameLen];
+    char local_hostname[MaxHostNameLen];
 
     /* do the following: if the name is found in the
        `v4_name_convert:host' part, is assumed to be a `host' type
@@ -1468,7 +1468,7 @@
 			 krb5_principal *ret_princ)
 {
     krb5_error_code ret;
-    char localhost[MAXHOSTNAMELEN];
+    char localhost[MaxHostNameLen];
     char **realms, *host = NULL;
 	
     if(type != KRB5_NT_SRV_HST && type != KRB5_NT_UNKNOWN) {
--- a/lib/krb5/verify_init.c
+++ b/lib/krb5/verify_init.c
@@ -86,7 +86,7 @@
     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;
--- a/lib/krb5/krbhst-test.c
+++ b/lib/krb5/krbhst-test.c
@@ -85,7 +85,7 @@
     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]);
--- a/lib/gssapi/spnego/accept_sec_context.c
+++ b/lib/gssapi/spnego/accept_sec_context.c
@@ -364,7 +364,7 @@
     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()) {
--- a/appl/login/login_access.c
+++ b/appl/login/login_access.c
@@ -163,11 +163,11 @@
 
 static char *myhostname(void)
 {
-    static char name[MAXHOSTNAMELEN + 1] = "";
+    static char name[MaxHostNameLen + 1] = "";
 
     if (name[0] == 0) {
 	gethostname(name, sizeof(name));
-	name[MAXHOSTNAMELEN] = 0;
+	name[MaxHostNameLen] = 0;
     }
     return (name);
 }
--- a/appl/gssmask/gssmask.c
+++ b/appl/gssmask/gssmask.c
@@ -55,7 +55,7 @@
     struct handle *handles;
     struct sockaddr_storage sa;
     socklen_t salen;
-    char servername[MAXHOSTNAMELEN];
+    char servername[MaxHostNameLen];
 };
 
 FILE *logfile;
@@ -1109,7 +1109,7 @@
     if (moniker) {
 	c->moniker = estrdup(moniker);
     } else {
-	char hostname[MAXHOSTNAMELEN];
+	char hostname[MaxHostNameLen];
 	gethostname(hostname, sizeof(hostname));
 	asprintf(&c->moniker, "gssmask: %s:%d", hostname, port);
     }
--- a/appl/test/tcp_server.c
+++ b/appl/test/tcp_server.c
@@ -44,7 +44,7 @@
     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;
--- a/appl/kf/kfd.c
+++ b/appl/kf/kfd.c
@@ -128,7 +128,7 @@
     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;
--- a/lib/sl/slc-gram.y
+++ b/lib/sl/slc-gram.y
@@ -670,8 +670,8 @@
     cprint(0, "\n");
 }
 
-char cname[PATH_MAX];
-char hname[PATH_MAX];
+char *cname = NULL;
+char *hname = NULL;
 
 static void
 gen(struct assignment *as)
@@ -721,6 +721,8 @@
 
     int optidx = 0;
 
+    size_t cname_len = 0;
+
     setprogname(argv[0]);
     if(getarg(args, num_args, argc, argv, &optidx))
 	usage(1);
@@ -739,16 +741,22 @@
     if(yyin == NULL)
 	err(1, "%s", filename);
     p = strrchr(filename, '/');
-    if(p)
-	strlcpy(cname, p + 1, sizeof(cname));
-    else
-	strlcpy(cname, filename, sizeof(cname));
+    if(p) {
+	cname_len = strlen(p + 1) + 2 + 1;
+	cname = malloc(cname_len);
+	strlcpy(cname, p + 1, cname_len);
+    } else {
+	cname_len = strlen(filename) + 2 + 1;
+	cname = malloc(cname_len);
+	strlcpy(cname, filename, cname_len);
+    }
     p = strrchr(cname, '.');
     if(p)
 	*p = '\0';
-    strlcpy(hname, cname, sizeof(hname));
-    strlcat(cname, ".c", sizeof(cname));
-    strlcat(hname, ".h", sizeof(hname));
+    hname = malloc(cname_len);
+    strlcpy(hname, cname, cname_len);
+    strlcat(cname, ".c", cname_len);
+    strlcat(hname, ".h", cname_len);
     yyparse();
     if(error_flag)
 	exit(1);
@@ -764,5 +772,7 @@
 	fclose(hfile);
     }
     fclose(yyin);
+    free(cname);
+    free(hname);
     return 0;
 }
--- a/lib/kafs/kafs.h
+++ b/lib/kafs/kafs.h
@@ -46,6 +46,9 @@
 #define AFSCALL_SETPAG 21
 
 #ifndef _VICEIOCTL
+#ifdef __GNU__
+#define _IOT_ViceIoctl _IOT(_IOTS(caddr_t), 2, _IOTS(short), 2, 0, 0)
+#endif
 #define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
 #define _AFSCIOCTL(id)  ((unsigned int ) _IOW('C', id, struct ViceIoctl))
 #endif /* _VICEIOCTL */
--- a/lib/kafs/afssys.c
+++ b/lib/kafs/afssys.c
@@ -40,7 +40,10 @@
     unsigned long param1;
     unsigned long syscall;
 };
-#define VIOC_SYSCALL_PROC _IOW('C', 1, void *)
+#ifdef __GNU__
+#define _IOT_procdata _IOT(_IOTS(long), 5, 0, 0, 0, 0)
+#endif
+#define VIOC_SYSCALL_PROC _IOW('C', 1, struct procdata)
 
 struct devdata {
     unsigned long syscall;
@@ -52,6 +55,9 @@
     unsigned long param6;
     unsigned long retval;
 };
+#ifdef __GNU__
+#define _IOT_devdata _IOT(_IOTS(long), 8, 0, 0, 0, 0)
+#endif
 #ifdef _IOWR
 #define VIOC_SYSCALL_DEV _IOWR('C', 2, struct devdata)
 #define VIOC_SYSCALL_DEV_OPENAFS _IOWR('C', 1, struct devdata)

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to