X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Fgnuserv.c;h=0c8cf22dc40253cc66059e2a94cb50f14a2ba92e;hb=c17cfefd00f49430bd139e11bfc580734091d728;hp=b90443d9b0450cd9d2b0dd970c25a6d7cbd093a5;hpb=3198ed8319f99e19a14447745f4f93e4b4522961;p=chise%2Fxemacs-chise.git.1 diff --git a/lib-src/gnuserv.c b/lib-src/gnuserv.c index b90443d..0c8cf22 100644 --- a/lib-src/gnuserv.c +++ b/lib-src/gnuserv.c @@ -378,7 +378,7 @@ handle_response (void) #ifdef INTERNET_DOMAIN_SOCKETS struct entry { - u_long host_addr; + unsigned long host_addr; struct entry *next; }; @@ -450,7 +450,7 @@ timed_read (int fd, char *buf, int max, int timeout, int one_line) permitted -- return whether a given host is allowed to connect to the server. */ static int -permitted (u_long host_addr, int fd) +permitted (unsigned long host_addr, int fd) { int key; struct entry *entry; @@ -458,8 +458,6 @@ permitted (u_long host_addr, int fd) char auth_protocol[128]; char buf[1024]; int auth_data_len; - int auth_data_pos; - int auth_mismatches; if (fd > 0) { @@ -492,7 +490,7 @@ permitted (u_long host_addr, int fd) auth_data_len = atoi(buf); - if (auth_data_len <= 0 || auth_data_len > sizeof(buf)) + if (auth_data_len <= 0 || auth_data_len > (int) sizeof(buf)) { return FALSE; } @@ -502,10 +500,11 @@ permitted (u_long host_addr, int fd) #ifdef AUTH_MAGIC_COOKIE if (server_xauth && server_xauth->data) - { + { /* Do a compare without comprising info about the size of the cookie */ - auth_mismatches = + int auth_data_pos; + int auth_mismatches = ( auth_data_len ^ server_xauth->data_length ); @@ -518,7 +517,7 @@ permitted (u_long host_addr, int fd) return TRUE; for(;rand() % 1000;); - } + } #else printf ("client tried Xauth, but server is not compiled with Xauth\n"); @@ -560,7 +559,7 @@ permitted (u_long host_addr, int fd) already there. */ static void -add_host (u_long host_addr) +add_host (unsigned long host_addr) { int key; struct entry *new_entry; @@ -596,8 +595,9 @@ setup_table (void) FILE *host_file; char *file_name; char hostname[HOSTNAMSZ]; - u_int host_addr; + unsigned int host_addr; int i, hosts=0; + int t; /* Make sure every entry is null */ for (i=0; i