Changeset 22 for trunk/src/sh_forward.c
- Timestamp:
- Feb 23, 2006, 12:03:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_forward.c
r20 r22 345 345 } 346 346 347 int sh_forward_setlogserver (c har * address)347 int sh_forward_setlogserver (const char * address) 348 348 { 349 349 SL_ENTER(_("sh_forward_setlogserver")); … … 1911 1911 1912 1912 1913 int sh_forward_use_clt_class (c har * c)1913 int sh_forward_use_clt_class (const char * c) 1914 1914 { 1915 1915 int i; … … 1919 1919 } 1920 1920 1921 int sh_forward_use_clt_sev (c har * c)1921 int sh_forward_use_clt_sev (const char * c) 1922 1922 { 1923 1923 int i; … … 1950 1950 } 1951 1951 1952 extern int safe_logger (int signal, int method, pid_t thepid); 1953 1954 int sh_forward_register_client (char * str) 1952 1953 int sh_forward_register_client (const char * str) 1955 1954 { 1956 1955 client_t * newclt; 1957 1956 client_t * testclt; 1958 1957 1959 c har* ptr;1958 const char * ptr; 1960 1959 int sepnum = 0; 1961 1960 int sep[2]; … … 1980 1979 if (all_clients == NULL) 1981 1980 { 1982 (void) safe_logger (0, 0, getpid());1981 (void) safe_logger (0, 0, NULL); 1983 1982 aud__exit(FIL__, __LINE__, EXIT_FAILURE); 1984 1983 } … … 2012 2011 newclt->status_arr[i] = CLT_INACTIVE; 2013 2012 sl_strlcpy(newclt->timestamp[CLT_INACTIVE], sh_unix_time(0), TIM_MAX); 2013 /* truncate */ 2014 2014 sl_strlcpy(newclt->hostname, &str[0], sep[0]+1); 2015 /* truncate */ 2015 2016 sl_strlcpy(newclt->salt, &str[sep[0]+1], sep[1]-sep[0]); 2016 2017 sl_strlcpy(newclt->verifier, &str[sep[1]+1], sl_strlen(str)-sep[1]+1); … … 2386 2387 2387 2388 #if defined(WITH_EXTERNAL) 2388 sprintf(msg, _("%s %s %s"), /* known to fit */ 2389 conn->hostname, 2390 conn->timestamp[status], 2391 _(clt_stat[status])); 2389 sl_snprintf(msg, sizeof(msg), _("%s %s %s"), 2390 conn->hostname, conn->timestamp[status], _(clt_stat[status])); 2392 2391 sh_ext_execute('s', 'r', 'v', msg, 0); 2393 2392 #endif … … 2398 2397 static time_t time_client_limit = 86400; 2399 2398 2400 int sh_forward_set_time_limit (c har * c)2399 int sh_forward_set_time_limit (const char * c) 2401 2400 { 2402 2401 long val; … … 2448 2447 static int lookup_err = SH_ERR_SEVERE; 2449 2448 2450 int sh_forward_lookup_level (c har * c)2449 int sh_forward_lookup_level (const char * c) 2451 2450 { 2452 2451 int ci = sh_error_convert_level (c); … … 2603 2602 static int UseSocketPeer = S_FALSE; 2604 2603 2605 int set_socket_peer (c har * c)2604 int set_socket_peer (const char * c) 2606 2605 { 2607 2606 return sh_util_flagval(c, &UseSocketPeer); … … 2731 2730 char hash[SH_MAXMSGLEN + KEY_LEN + KEY_LEN + 1]; 2732 2731 char * buffer; 2733 long len;2734 2732 2735 2733 int clt_sev; … … 2737 2735 2738 2736 UINT32 ticks; 2737 size_t len; 2739 2738 int i; 2740 2739 char * test; … … 2821 2820 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FAUTH, 2822 2821 &(conn->buf[KEY_LEN])); 2823 strcpy(conn->buf, /* known to fit */ 2824 &(conn->buf[KEY_LEN])); 2822 len = sl_strlen(&(conn->buf[KEY_LEN])) + 1; 2823 /* &(conn->buf[KEY_LEN]) is hostname */ 2824 /* may overlap, thus only memmove is correct */ 2825 memmove(conn->buf, &(conn->buf[KEY_LEN]), len); 2825 2826 this_client->session_key[0] = '\0'; 2826 2827 this_client->session_key_timer = (time_t) 1; … … 2835 2836 conn->K = NULL; 2836 2837 } 2837 i= sl_strlen(&(conn->buf[KEY_LEN])) + KEY_LEN + 1;2838 conn->K = SH_ALLOC( i);2838 len = sl_strlen(&(conn->buf[KEY_LEN])) + KEY_LEN + 1; 2839 conn->K = SH_ALLOC(len); 2839 2840 2840 2841 sl_strlcpy (conn->K, … … 2914 2915 conn->A = SH_ALLOC(3*KEY_LEN+1); 2915 2916 sl_strlcpy (conn->A, conn->K, KEY_LEN+1); 2916 sl_strlcat(conn->A, conn->buf, /* ignore remainder*/2917 sl_strlcat(conn->A, conn->buf, /* truncate */ 2917 2918 2*KEY_LEN+1); 2918 2919 sl_strlcat(conn->A, conn->client_entry->session_key, … … 3278 3279 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FAUTH, 3279 3280 &(conn->buf[KEY_LEN])); 3280 strcpy(conn->buf, /* known to fit */ 3281 &(conn->buf[KEY_LEN])); 3281 len = sl_strlen(&(conn->buf[KEY_LEN])) + 1; 3282 /* &(conn->buf[KEY_LEN]) is hostname */ 3283 /* may overlap, thus only memmove is correct */ 3284 memmove(conn->buf, &(conn->buf[KEY_LEN]), len); 3282 3285 this_client->session_key[0] = '\0'; 3283 3286 this_client->session_key_timer = (time_t) 1; … … 3293 3296 conn->K = NULL; 3294 3297 } 3295 i= sl_strlen(&(conn->buf[KEY_LEN])) + KEY_LEN + 1;3296 conn->K = SH_ALLOC( i);3298 len = sl_strlen(&(conn->buf[KEY_LEN])) + KEY_LEN + 1; 3299 conn->K = SH_ALLOC(len); 3297 3300 3298 3301 sl_strlcpy (conn->K, … … 4600 4603 static unsigned int server_port = SH_DEFAULT_PORT; 4601 4604 4602 int sh_forward_set_port (c har * str)4605 int sh_forward_set_port (const char * str) 4603 4606 { 4604 4607 int retval = 0; 4605 4608 unsigned long i; 4606 char * endptr = str;4609 char * endptr; 4607 4610 4608 4611 SL_ENTER(_("sh_forward_set_port")); … … 4621 4624 static int use_server_interface = 0; 4622 4625 4623 int sh_forward_set_interface (c har * str)4626 int sh_forward_set_interface (const char * str) 4624 4627 { 4625 4628 if (0 == strcmp(str, _("INADDR_ANY"))) … … 4814 4817 */ 4815 4818 new_act.sa_handler = SIG_IGN; 4819 sigemptyset( &new_act.sa_mask ); /* set an empty mask */ 4820 new_act.sa_flags = 0; /* init sa_flags */ 4816 4821 retry_sigaction (FIL__, __LINE__, SIGPIPE, &new_act, &old_act); 4817 4822 … … 5571 5576 } 5572 5577 5573 int set_syslog_active(c har * c)5578 int set_syslog_active(const char * c) 5574 5579 { 5575 5580 return sh_util_flagval(c, &enable_syslog_socket);
Note:
See TracChangeset
for help on using the changeset viewer.