kadm_conn.c (72445) | kadm_conn.c (78527) |
---|---|
1/* 2 * Copyright (c) 2000 - 2001 Kungliga Tekniska H�gskolan 3 * (Royal Institute of Technology, Stockholm, Sweden). 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#include "kadmin_locl.h" 35#ifdef HAVE_SYS_WAIT_H 36#include <sys/wait.h> 37#endif 38 | 1/* 2 * Copyright (c) 2000 - 2001 Kungliga Tekniska H�gskolan 3 * (Royal Institute of Technology, Stockholm, Sweden). 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#include "kadmin_locl.h" 35#ifdef HAVE_SYS_WAIT_H 36#include <sys/wait.h> 37#endif 38 |
39RCSID("$Id: kadm_conn.c,v 1.11 2001/01/29 08:43:01 assar Exp $"); | 39RCSID("$Id: kadm_conn.c,v 1.13 2001/05/16 22:06:44 assar Exp $"); |
40 41struct kadm_port { 42 char *port; 43 unsigned short def_port; 44 struct kadm_port *next; 45} *kadm_ports; 46 47static void --- 84 unchanged lines hidden (view full) --- 132 char buf[128]; 133 size_t buf_len; 134 135 s = accept(socks[this_sock], sa, &sa_size); 136 if(s < 0) { 137 krb5_warn(context, errno, "accept"); 138 return 1; 139 } | 40 41struct kadm_port { 42 char *port; 43 unsigned short def_port; 44 struct kadm_port *next; 45} *kadm_ports; 46 47static void --- 84 unchanged lines hidden (view full) --- 132 char buf[128]; 133 size_t buf_len; 134 135 s = accept(socks[this_sock], sa, &sa_size); 136 if(s < 0) { 137 krb5_warn(context, errno, "accept"); 138 return 1; 139 } |
140 e = krb5_sockaddr2address(sa, &addr); | 140 e = krb5_sockaddr2address(context, sa, &addr); |
141 if(e) 142 krb5_warn(context, e, "krb5_sockaddr2address"); 143 else { 144 e = krb5_print_address (&addr, buf, sizeof(buf), 145 &buf_len); 146 if(e) | 141 if(e) 142 krb5_warn(context, e, "krb5_sockaddr2address"); 143 else { 144 e = krb5_print_address (&addr, buf, sizeof(buf), 145 &buf_len); 146 if(e) |
147 krb5_warn(context, e, "krb5_sockaddr2address"); | 147 krb5_warn(context, e, "krb5_print_address"); |
148 else 149 krb5_warnx(context, "connection from %s", buf); 150 krb5_free_address(context, &addr); 151 } 152 153 pid = fork(); 154 if(pid == 0) { 155 for(i = 0; i < num_socks; i++) --- 82 unchanged lines hidden (view full) --- 238 239 e = getaddrinfo(NULL, p->port, &hints, &ai); 240 if(e) { 241 snprintf(portstr, sizeof(portstr), "%u", p->def_port); 242 e = getaddrinfo(NULL, portstr, &hints, &ai); 243 } 244 245 if(e) { | 148 else 149 krb5_warnx(context, "connection from %s", buf); 150 krb5_free_address(context, &addr); 151 } 152 153 pid = fork(); 154 if(pid == 0) { 155 for(i = 0; i < num_socks; i++) --- 82 unchanged lines hidden (view full) --- 238 239 e = getaddrinfo(NULL, p->port, &hints, &ai); 240 if(e) { 241 snprintf(portstr, sizeof(portstr), "%u", p->def_port); 242 e = getaddrinfo(NULL, portstr, &hints, &ai); 243 } 244 245 if(e) { |
246 krb5_warn(context, krb5_eai_to_heim_errno(e), "%s", portstr); | 246 krb5_warn(context, krb5_eai_to_heim_errno(e, errno), 247 "%s", portstr); |
247 continue; 248 } 249 i = 0; 250 for(ap = ai; ap; ap = ap->ai_next) 251 i++; 252 tmp = realloc(socks, (num_socks + i) * sizeof(*socks)); 253 if(tmp == NULL) { 254 krb5_warnx(context, "failed to reallocate %lu bytes", --- 34 unchanged lines hidden --- | 248 continue; 249 } 250 i = 0; 251 for(ap = ai; ap; ap = ap->ai_next) 252 i++; 253 tmp = realloc(socks, (num_socks + i) * sizeof(*socks)); 254 if(tmp == NULL) { 255 krb5_warnx(context, "failed to reallocate %lu bytes", --- 34 unchanged lines hidden --- |