- Timestamp:
- Apr 30, 2008, 11:56:45 PM (17 years ago)
- Location:
- trunk/src
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cutest_sh_tiger0.c
r151 r170 10 10 11 11 #if defined(HAVE_PTHREAD) && defined(SH_STEALTH) 12 extern void sh_g_init( );12 extern void sh_g_init(void); 13 13 #endif 14 14 15 15 16 static void init( ) {16 static void init(void) { 17 17 18 18 extern unsigned char TcpFlag[8][PW_LEN+1]; -
trunk/src/samhain.c
r169 r170 167 167 } 168 168 169 void sh_g_init( )169 void sh_g_init(void) 170 170 { 171 171 if (0 != pthread_key_create(&g_key, sh_g_destroy)) … … 695 695 #endif 696 696 #if defined(SH_WITH_SERVER) 697 extern int sh_socket_remove ( );697 extern int sh_socket_remove (void); 698 698 #endif 699 699 … … 800 800 #if defined(__linux__) || defined(sun) || defined(__sun) || defined(__sun__) 801 801 #include <dirent.h> 802 static pid_t * procdirSamhain ( )802 static pid_t * procdirSamhain (void) 803 803 { 804 volatile pid_t * pidlist = malloc(sizeof(pid_t) * 65535); 805 pid_t * dummy; 804 pid_t * pidlist; 806 805 struct dirent * d; 807 806 DIR * dp; 808 807 long ino; 809 808 struct stat buf; 810 int i = 0;809 int i; 811 810 pid_t pid, mypid = getpid(); 812 811 char * tail; 813 812 char exef[128]; 814 813 815 if (!pidlist)816 return NULL;817 818 for (i = 0; i < 65535; ++i) pidlist[i] = 0;819 i = 0;820 821 814 if (0 != stat(SH_INSTALL_PATH, &buf)) 822 815 { 823 dummy = (pid_t *)pidlist;824 free(dummy);825 816 return NULL; 826 817 } … … 830 821 if (NULL == (dp = opendir("/proc"))) 831 822 { 832 dummy = (pid_t *)pidlist;833 free(dummy);834 823 return NULL; 835 824 } … … 837 826 SH_MUTEX_LOCK(mutex_readdir); 838 827 828 pidlist = malloc(sizeof(pid_t) * 65535); 829 if (!pidlist) 830 goto unlock_and_out; 831 832 for (i = 0; i < 65535; ++i) pidlist[i] = 0; 833 834 i = 0; 839 835 while (NULL != (d = readdir(dp)) && i < 65535) 840 836 { … … 858 854 } 859 855 856 unlock_and_out: 857 ; 860 858 SH_MUTEX_UNLOCK(mutex_readdir); 861 859 862 860 closedir(dp); 863 return (pid_t *)pidlist;861 return pidlist; 864 862 } 865 863 #else 866 static pid_t * procdirSamhain ( )864 static pid_t * procdirSamhain (void) 867 865 { 868 866 return NULL; … … 1191 1189 #endif 1192 1190 #if defined(SH_WITH_SERVER) 1193 extern int sh_create_tcp_socket( );1191 extern int sh_create_tcp_socket(void); 1194 1192 #endif 1195 1193 … … 1208 1206 1209 1207 volatile time_t told; 1210 time_t tcurrent;1208 volatile time_t tcurrent; 1211 1209 size_t tzlen; 1212 1210 char * tzptr; -
trunk/src/samhain_setpwd.c
r22 r170 231 231 int oldf; 232 232 int newf; 233 int ret; 233 234 234 235 unsigned long bytecount; … … 396 397 397 398 398 write (newf, buf, dat); 399 ret = write (newf, buf, dat); 400 if (dat > 0 && ret < 0) 401 { 402 fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn); 403 fflush(stdout); 404 return EXIT_FAILURE; 405 } 399 406 } 400 407 … … 418 425 419 426 dat = read (oldf, buf, (GRAB_SIZE / 2)); 420 write (newf, buf, dat); 427 ret = write (newf, buf, dat); 428 if (dat > 0 && ret < 0) 429 { 430 fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn); 431 fflush(stdout); 432 return EXIT_FAILURE; 433 } 421 434 422 435 bytecount = 0; … … 469 482 } 470 483 471 write (newf, buf, dat); 484 ret = write (newf, buf, dat); 485 if (dat > 0 && ret < 0) 486 { 487 fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn); 488 fflush(stdout); 489 return EXIT_FAILURE; 490 } 472 491 } 473 492 -
trunk/src/sh_calls.c
r169 r170 59 59 typedef struct cht_struct 60 60 { 61 c har * str;61 const char * str; 62 62 unsigned long val; 63 63 } cht_type; … … 109 109 /* Need to catch EINTR for these functions. 110 110 */ 111 long int retry_sigaction(c har * file, int line,111 long int retry_sigaction(const char * file, int line, 112 112 int signum, const struct sigaction *act, 113 113 struct sigaction *oldact) … … 156 156 157 157 158 long int retry_connect(c har * file, int line, int sockfd,158 long int retry_connect(const char * file, int line, int sockfd, 159 159 struct sockaddr *serv_addr, int addrlen) 160 160 { … … 209 209 } 210 210 211 long int retry_accept(c har * file, int line, int fd,211 long int retry_accept(const char * file, int line, int fd, 212 212 struct sockaddr *serv_addr, int * addrlen) 213 213 { … … 236 236 } 237 237 238 long int retry_lstat(c har * file, int line,238 long int retry_lstat(const char * file, int line, 239 239 const char *file_name, struct stat *buf) 240 240 { … … 259 259 } 260 260 261 long int retry_stat(c har * file, int line,261 long int retry_stat(const char * file, int line, 262 262 const char *file_name, struct stat *buf) 263 263 { … … 282 282 } 283 283 284 long int retry_fstat(c har * file, int line, int filed, struct stat *buf)284 long int retry_fstat(const char * file, int line, int filed, struct stat *buf) 285 285 { 286 286 int error; … … 303 303 } 304 304 305 long int retry_fcntl(c har * file, int line, int fd, int cmd, long arg)305 long int retry_fcntl(const char * file, int line, int fd, int cmd, long arg) 306 306 { 307 307 int error; … … 389 389 ***************************************************/ 390 390 391 long int retry_aud_execve (c har * file, int line,391 long int retry_aud_execve (const char * file, int line, 392 392 const char *dateiname, char * argv[], 393 393 char * envp[]) … … 419 419 420 420 421 long int retry_aud_utime (c har * file, int line,422 421 long int retry_aud_utime (const char * file, int line, 422 char * path, struct utimbuf *buf) 423 423 { 424 424 long int val_return; … … 450 450 } 451 451 452 long int retry_aud_unlink (c har * file, int line,452 long int retry_aud_unlink (const char * file, int line, 453 453 char * path) 454 454 { … … 477 477 } 478 478 479 long int retry_aud_dup2 (c har * file, int line,479 long int retry_aud_dup2 (const char * file, int line, 480 480 int fd, int fd2) 481 481 { … … 504 504 } 505 505 506 long int retry_aud_dup (c har * file, int line,506 long int retry_aud_dup (const char * file, int line, 507 507 int fd) 508 508 { … … 532 532 533 533 534 long int retry_aud_chdir (c har * file, int line,534 long int retry_aud_chdir (const char * file, int line, 535 535 const char *path) 536 536 { … … 560 560 561 561 562 long int aud_open_noatime (c har * file, int line, int privs,562 long int aud_open_noatime (const char * file, int line, int privs, 563 563 const char *pathname, int flags, mode_t mode, 564 564 int * o_noatime) … … 601 601 } 602 602 603 long int aud_open (c har * file, int line, int privs,603 long int aud_open (const char * file, int line, int privs, 604 604 const char *pathname, int flags, mode_t mode) 605 605 { … … 635 635 } 636 636 637 long int aud_kill (c har * file, int line, pid_t pid, int sig)637 long int aud_kill (const char * file, int line, pid_t pid, int sig) 638 638 { 639 639 int myerror; … … 657 657 658 658 /*@noreturn@*/ 659 void aud_exit (c har * file, int line, int fd)659 void aud_exit (const char * file, int line, int fd) 660 660 { 661 661 if (sh.flag.audit != 0 && (sh.flag.aud_mask & AUD_EXIT) != 0) … … 670 670 671 671 /*@noreturn@*/ 672 void aud__exit (c har * file, int line, int fd)672 void aud__exit (const char * file, int line, int fd) 673 673 { 674 674 if (sh.flag.audit != 0 && (sh.flag.aud_mask & AUD_EXIT) != 0) … … 682 682 } 683 683 684 pid_t aud_fork (c har * file, int line)684 pid_t aud_fork (const char * file, int line) 685 685 { 686 686 int error; … … 703 703 } 704 704 705 int aud_setuid (c har * file, int line, uid_t uid)705 int aud_setuid (const char * file, int line, uid_t uid) 706 706 { 707 707 int error = 0; … … 731 731 } 732 732 733 int aud_setgid (c har * file, int line, gid_t gid)733 int aud_setgid (const char * file, int line, gid_t gid) 734 734 { 735 735 int error = 0; … … 760 760 } 761 761 762 int aud_pipe (c har * file, int line, int * modus)762 int aud_pipe (const char * file, int line, int * modus) 763 763 { 764 764 int error; -
trunk/src/sh_cat.c
r169 r170 8 8 /*@-nullassign@*/ 9 9 10 c har * class_cat[] = {10 const char * class_cat[] = { 11 11 N_("AUD"), /* 0 */ 12 12 N_("PANIC"), /* 1 */ … … 263 263 { MSG_E_READ, SH_ERR_ERR, ERR, N_("msg=\"Not accessible or not a regular file\" path=\"%s\"")}, 264 264 { MSG_E_TIMEOUT, SH_ERR_ERR, ERR, N_("msg=\"Timeout (%d sec) while checksumming file\" path=\"%s\"")}, 265 { MSG_NODEV, SH_ERR_ERR, ERR, N_("msg=\"Device not available \" userid=\"%ld\" path=\"%s\"")},265 { MSG_NODEV, SH_ERR_ERR, ERR, N_("msg=\"Device not available or timeout during read attempt\" userid=\"%ld\" path=\"%s\"")}, 266 266 { MSG_LOCKED, SH_ERR_ERR, ERR, N_("msg=\"File lock error\" userid=\"%ld\" path=\"%s\" obj=\"%s\"")}, 267 267 { MSG_PIDFILE, SH_ERR_ERR, ERR, N_("msg=\"Could not write PID file\" userid=\"%ld\" path=\"%s\"")}, … … 580 580 { MSG_E_READ, SH_ERR_ERR, ERR, N_("msg=<Not accessible or not a regular file>, path=<%s>")}, 581 581 { MSG_E_TIMEOUT, SH_ERR_ERR, ERR, N_("msg=<Timeout (%d sec) while checksumming file>, path=<%s>")}, 582 { MSG_NODEV, SH_ERR_ERR, ERR, N_("msg=<Device not available >, userid=<%ld>, path=<%s>")},582 { MSG_NODEV, SH_ERR_ERR, ERR, N_("msg=<Device not available or timeout during read attempt>, userid=<%ld>, path=<%s>")}, 583 583 { MSG_LOCKED, SH_ERR_ERR, ERR, N_("msg=<File lock error>, userid=<%ld>, path=<%s>, obj=<%s>")}, 584 584 { MSG_PIDFILE, SH_ERR_ERR, ERR, N_("msg=<Could not write PID file>, userid=<%ld>, path=<%s>")}, -
trunk/src/sh_database.c
r116 r170 61 61 char msg[1024]; 62 62 char sev[8]; 63 char path[ 12288];63 char path[MAX_PATH_STORE+1]; 64 64 char user[9]; 65 65 char group[9]; … … 82 82 char interface[64]; 83 83 char ltime[64]; 84 char dir[ 1024];85 char linked_path[ 1024];84 char dir[MAX_PATH_STORE+1]; 85 char linked_path[MAX_PATH_STORE+1]; 86 86 char service[64]; 87 87 char facility[32]; … … 107 107 char chksum_old[50]; 108 108 char chksum_new[50]; 109 char link_old[ 1024];110 char link_new[ 1024];109 char link_old[MAX_PATH_STORE+1]; 110 char link_new[MAX_PATH_STORE+1]; 111 111 char acl_old[1024]; 112 112 char acl_new[1024]; … … 134 134 { NULL, N_("msg"), 0, 4, 1024, 0, offsetof(struct dbins_, msg) }, 135 135 136 { NULL, N_("path"), 0, 5, 12288, 0, offsetof(struct dbins_, path) },136 { NULL, N_("path"), 0, 5,MAX_PATH_STORE+1, 0, offsetof(struct dbins_, path) }, 137 137 /* username -> userid; replace (long) 'userid' - below - by 'dummy' */ 138 138 { NULL, N_("userid"), 0, 6, 9, 0, offsetof(struct dbins_, user) }, … … 155 155 { NULL, N_("interface"), 0, 24, 64, 0, offsetof(struct dbins_, interface)}, 156 156 { NULL, N_("time"), 0, 25, 64, 0, offsetof(struct dbins_, ltime) }, 157 { NULL, N_("dir"), 0, 26, 1024, 0, offsetof(struct dbins_, dir) },158 { NULL, N_("linked_path"), 0, 27, 1024, 0, offsetof(struct dbins_, linked_path)},157 { NULL, N_("dir"), 0, 26, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, dir) }, 158 { NULL, N_("linked_path"), 0, 27, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, linked_path)}, 159 159 { NULL, N_("service"), 0, 29, 64, 0, offsetof(struct dbins_, service)}, 160 160 { NULL, N_("facility"), 0, 30, 32, 0, offsetof(struct dbins_, facility) }, … … 178 178 { NULL, N_("chksum_old"), 0, 47, 50, 0, offsetof(struct dbins_, chksum_old)}, 179 179 { NULL, N_("chksum_new"), 0, 48, 50, 0, offsetof(struct dbins_, chksum_new)}, 180 { NULL, N_("link_old"), 0, 49, 1024, 0, offsetof(struct dbins_, link_old)},181 { NULL, N_("link_new"), 0, 50, 1024, 0, offsetof(struct dbins_, link_new)},180 { NULL, N_("link_old"), 0, 49, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, link_old)}, 181 { NULL, N_("link_new"), 0, 50, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, link_new)}, 182 182 183 183 { NULL, N_("size_old"), 0, 51, 0, 0, 0 }, … … 1034 1034 static int connection_status = S_FALSE; 1035 1035 1036 void sh_database_reset( )1036 void sh_database_reset(void) 1037 1037 { 1038 1038 connection_status = S_FALSE; … … 1226 1226 } 1227 1227 1228 #define SH_QUERY_MAX 16383 1228 #define SH_QUERY_MAX SH_MSG_BUF 1229 /* define SH_QUERY_MAX 16383 */ 1229 1230 1230 1231 static … … 1450 1451 static int sh_database_comp_attr (const void *m1, const void *m2) 1451 1452 { 1452 my_attr *mi1 = (my_attr *) m1;1453 my_attr *mi2 = (my_attr *) m2;1453 const my_attr *mi1 = (const my_attr *) m1; 1454 const my_attr *mi2 = (const my_attr *) m2; 1454 1455 return strcmp(mi1->attr, mi2->attr); 1455 1456 } 1456 1457 1457 1458 1458 static void init_attr_table( )1459 static void init_attr_table(void) 1459 1460 { 1460 1461 static int first = S_TRUE; -
trunk/src/sh_entropy.c
r154 r170 281 281 #include "sh_pthread.h" 282 282 283 int read_mbytes(int timeout_val, c har * path, char * nbuf, int nbytes)283 int read_mbytes(int timeout_val, const char * path, char * nbuf, int nbytes) 284 284 { 285 285 int m_count; -
trunk/src/sh_err_console.c
r153 r170 127 127 #define MY_MAX_MSG 1022 128 128 129 static int push_message_queue (c har * msg)129 static int push_message_queue (const char * msg) 130 130 { 131 131 struct sh_msgbuf* recv_msg = NULL; … … 258 258 259 259 #if defined(WITH_TRACE) || defined(WITH_TPT) 260 char * sh_log_console_name ( )260 char * sh_log_console_name (void) 261 261 { 262 262 if (! sh.srvcons.name || sh.srvcons.name[0] == '\0' || … … 273 273 /* ---- Print out a message. ---- 274 274 */ 275 int sh_log_console ( /*@null@*/char *errmsg)275 int sh_log_console (const /*@null@*/char *errmsg) 276 276 { 277 277 static int service_failure[2] = { 0, 0}; -
trunk/src/sh_err_log.c
r153 r170 184 184 #endif 185 185 186 buf = (char *) SH_ALLOC( 2*SH_ BUFSIZE+1 );187 bufc = (char *) SH_ALLOC( 2*SH_ BUFSIZE+1 );186 buf = (char *) SH_ALLOC( 2*SH_MSG_BUF+1 ); 187 bufc = (char *) SH_ALLOC( 2*SH_MSG_BUF+1 ); 188 188 189 189 while (1 == 1) … … 191 191 /* get the log message 192 192 */ 193 if (sh_unix_getline (fd, buf, (2*SH_ BUFSIZE)) < 0)193 if (sh_unix_getline (fd, buf, (2*SH_MSG_BUF)) < 0) 194 194 break; 195 195 … … 222 222 start = 1; 223 223 do { 224 if ( sh_unix_getline (fd, buf, (2*SH_ BUFSIZE)) < 0)224 if ( sh_unix_getline (fd, buf, (2*SH_MSG_BUF)) < 0) 225 225 break; 226 226 } while (buf[0] == '\0' || buf[0] == '\n'); … … 293 293 { 294 294 do { 295 if ( sh_unix_getline (fd, bufc, (2*SH_ BUFSIZE)) < 0)295 if ( sh_unix_getline (fd, bufc, (2*SH_MSG_BUF)) < 0) 296 296 break; 297 297 } while (bufc[0] == '\0' || bufc[0] == '\n'); … … 301 301 /* A continuation line. Add the newline. 302 302 */ 303 (void) sl_strlcat(buf, "\n", 2*SH_ BUFSIZE+1);303 (void) sl_strlcat(buf, "\n", 2*SH_MSG_BUF+1); 304 304 ++len; 305 (void) sl_strlcat(buf, bufc, 2*SH_ BUFSIZE+1);305 (void) sl_strlcat(buf, bufc, 2*SH_MSG_BUF+1); 306 306 len += (int) sl_strlen(bufc); 307 307 } … … 437 437 } 438 438 439 (void) sl_strlcat ( buf, key, 2*SH_ BUFSIZE+ 1);439 (void) sl_strlcat ( buf, key, 2*SH_MSG_BUF + 1); 440 440 441 441 #ifdef SH_STEALTH -
trunk/src/sh_err_syslog.c
r22 r170 31 31 32 32 typedef struct log_fac_struct { 33 c har * name;33 const char * name; 34 34 int facility; 35 35 } logfct; -
trunk/src/sh_error.c
r159 r170 105 105 static int sh_error_string (struct _log_t * lmsg, va_list vl); 106 106 107 extern int sh_log_console (/*@null@*/c har *message);107 extern int sh_log_console (/*@null@*/const char *message); 108 108 extern int sh_log_syslog (int severity, /*@null@*/char *message); 109 109 extern int sh_log_file (/*@null@*/char *message, … … 173 173 174 174 static 175 void compute_flag_err_debug( )175 void compute_flag_err_debug(void) 176 176 { 177 177 if ((errFlags.loglevel & SH_ERR_ALL) != 0) … … 197 197 198 198 static 199 void compute_flag_err_info( )199 void compute_flag_err_info(void) 200 200 { 201 201 if ((errFlags.loglevel & SH_ERR_INFO) != 0) … … 220 220 } 221 221 222 void sh_error_dbg_switch( )222 void sh_error_dbg_switch(void) 223 223 { 224 224 if (dbg_flag == 0) … … 466 466 typedef struct eef 467 467 { 468 c har * str;468 const char * str; 469 469 int val; 470 470 } eef_struc; … … 797 797 /* init or re-init log facilities that need it 798 798 */ 799 void sh_error_fixup( )799 void sh_error_fixup(void) 800 800 { 801 801 #if defined(HAVE_LIBPRELUDE_9) … … 813 813 /* to be called from sh_prelude_reset 814 814 */ 815 void sh_error_init_prelude( )815 void sh_error_init_prelude(void) 816 816 { 817 817 #if defined(HAVE_LIBPRELUDE_9) … … 865 865 SH_MUTEX_RECURSIVE(mutex_err_handle); 866 866 867 void sh_error_handle (int sev, c har * file, long line,867 void sh_error_handle (int sev, const char * file, long line, 868 868 long status, unsigned long msg_id, ...) 869 869 { … … 875 875 char * fmt; 876 876 877 int flag_inet = S_FALSE;877 int flag_inet; 878 878 879 879 #ifdef SH_WITH_SERVER … … 974 974 { 975 975 flag_inet = S_TRUE; 976 } 977 else 978 { 979 flag_inet = S_FALSE; 976 980 } 977 981 … … 1355 1359 *priority = (int) msg_cat[i].priority; 1356 1360 *class = (unsigned int) msg_cat[i].class; 1357 SL_RETURN ( _(msg_cat[i].format), _("get_format"));1361 SL_RETURN (((char *) _(msg_cat[i].format)), _("get_format")); 1358 1362 } 1359 1363 ++i; … … 1545 1549 /*@i@*/required = sl_vsnprintf(&(lmsg->msg[len]), 1546 1550 (lmsg->msg_len - len), lmsg->format, vl); 1551 1547 1552 if ((required >= 0) && 1548 1553 sl_ok_adds(required, len) && … … 1556 1561 lmsg->msg_len = required + len + 4; 1557 1562 (void) sl_vsnprintf(&(lmsg->msg[len]), 1558 (required + len +1), lmsg->format, vl2);1563 (required + 1), lmsg->format, vl2); 1559 1564 } 1560 1565 va_end(vl2); -
trunk/src/sh_extern.c
r169 r170 825 825 if (!ext_com) 826 826 { 827 SL_RETURN( NULL, ("command_init"));827 SL_RETURN( NULL, _("command_init")); 828 828 } 829 829 … … 853 853 ext_com->next = NULL; 854 854 855 SL_RETURN( ext_com, ("command_init"));855 SL_RETURN( ext_com, _("command_init")); 856 856 } 857 857 … … 1170 1170 if (ext_coms == NULL || ext_failed == (-1) || str == NULL) 1171 1171 { 1172 SL_RETURN (-1, ("sh_ext_deadtime"));1172 SL_RETURN (-1, _("sh_ext_deadtime")); 1173 1173 } 1174 1174 deadtime = strtol(str, &tail, 10); 1175 1175 if (tail == str || deadtime < 0 || deadtime == LONG_MAX) 1176 1176 { 1177 SL_RETURN (-1, ("sh_ext_deadtime"));1177 SL_RETURN (-1, _("sh_ext_deadtime")); 1178 1178 } 1179 1179 1180 1180 ext_coms->deadtime = (time_t) deadtime; 1181 SL_RETURN (0, ("sh_ext_deadtime"));1181 SL_RETURN (0, _("sh_ext_deadtime")); 1182 1182 } 1183 1183 -
trunk/src/sh_files.c
r167 r170 1482 1482 char * relativeName) 1483 1483 { 1484 struct sh_dirent * dirlist = NULL;1485 struct sh_dirent * dirlist_orig = NULL;1484 struct sh_dirent * dirlist; 1485 struct sh_dirent * dirlist_orig; 1486 1486 1487 1487 DIR * thisDir = NULL; … … 1646 1646 */ 1647 1647 SH_MUTEX_LOCK(mutex_readdir); 1648 1649 dirlist = NULL; 1650 dirlist_orig = NULL; 1648 1651 1649 1652 do { … … 2273 2276 } 2274 2277 2275 extern void aud_exit (c har * file, int line, int fd);2278 extern void aud_exit (const char * file, int line, int fd); 2276 2279 2277 2280 int sh_files_test_setup () -
trunk/src/sh_forward.c
r137 r170 2220 2220 /* -- Mark all clients as dead. 2221 2221 */ 2222 void sh_forward_mark_dead ( )2222 void sh_forward_mark_dead (void) 2223 2223 { 2224 2224 zAVLCursor avlcursor; … … 2238 2238 /* -- Clean tree from dead clients. 2239 2239 */ 2240 void sh_forward_clean_tree ( )2240 void sh_forward_clean_tree (void) 2241 2241 { 2242 2242 zAVLCursor avlcursor; … … 2499 2499 /* -- Check for time limit exceeded. -- 2500 2500 */ 2501 static int client_time_check( )2501 static int client_time_check(void) 2502 2502 { 2503 2503 zAVLCursor avlcursor; … … 4814 4814 static int sh_tcp_sock = -1; 4815 4815 4816 int sh_create_tcp_socket ( )4816 int sh_create_tcp_socket (void) 4817 4817 { 4818 4818 struct sockaddr_in addr; … … 5382 5382 } 5383 5383 5384 void free_client_tree ( )5384 void free_client_tree (void) 5385 5385 { 5386 5386 SL_ENTER(_("free_client_tree")); -
trunk/src/sh_getopt.c
r169 r170 52 52 53 53 typedef struct options { 54 c har * longopt;54 const char * longopt; 55 55 const char shortopt; 56 c har * usage;56 const char * usage; 57 57 int hasArg; 58 58 int (*func)(const char * opt); … … 313 313 314 314 315 static void sh_getopt_print_log_facilities ( )315 static void sh_getopt_print_log_facilities (void) 316 316 { 317 317 fputs (_("Compiled-in log facilities:"), stdout); … … 372 372 } 373 373 374 static void sh_getopt_print_options ( )374 static void sh_getopt_print_options (void) 375 375 { 376 376 int num = 0; … … 484 484 } 485 485 486 static void sh_getopt_print_modules ( )486 static void sh_getopt_print_modules (void) 487 487 { 488 488 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) … … 686 686 static int sh_getopt_forever (const char * dummy) 687 687 { 688 dummy = (void *) dummy;688 (void) dummy; 689 689 SL_ENTER(_("sh_getopt_forever")); 690 690 sh.flag.loop = S_TRUE; -
trunk/src/sh_gpg.c
r159 r170 214 214 static struct startup_info startInfo = { 0, NULL, 0, NULL, NULL, NULL }; 215 215 216 void sh_gpg_log_startup ( )216 void sh_gpg_log_startup (void) 217 217 { 218 218 if (startInfo.program != NULL) -
trunk/src/sh_hash.c
r169 r170 246 246 247 247 248 /* MAX_PATH_STORE must be >= KEY_LEN249 */250 #define MAX_PATH_STORE 12287251 252 248 typedef struct store_info { 253 249 … … 294 290 } sh_file_t; 295 291 296 static c har *policy[] = {292 static const char *policy[] = { 297 293 N_("[]"), 298 294 N_("[ReadOnly]"), … … 426 422 char * str; 427 423 char hashbuf[KEYBUF_SIZE]; 428 int retval = 0;424 int retval; 429 425 430 426 /* -------- find the entry for the file ---------------- */ 431 427 432 428 SH_MUTEX_LOCK(mutex_hash); 429 430 retval = 0; 433 431 434 432 if (sl_strlen(fullpath) <= MAX_PATH_STORE) … … 786 784 } 787 785 788 static void sh_hash_getline_end ( )786 static void sh_hash_getline_end (void) 789 787 { 790 788 fclose (sh_fin_fd); … … 1123 1121 1124 1122 sh_file_t * p; 1125 SL_TICKET fd = (-1);1123 SL_TICKET fd; 1126 1124 long i; 1127 1125 int count = 0; … … 1134 1132 char * buf = NULL; 1135 1133 int bufc; 1136 int flag_pgp = S_FALSE;1137 int flag_nohead = S_FALSE;1134 int flag_pgp; 1135 int flag_nohead; 1138 1136 SL_TICKET fdTmp = (-1); 1139 1137 SL_TICKET open_tmp (void); … … 1144 1142 1145 1143 SH_MUTEX_LOCK(mutex_hash); 1144 1145 #if defined(WITH_GPG) || defined(WITH_PGP) 1146 flag_pgp = S_FALSE; 1147 flag_nohead = S_FALSE; 1148 #endif 1146 1149 1147 1150 if (IsInit == 1) … … 1149 1152 goto unlock_and_return; 1150 1153 } 1154 1155 fd = (-1); 1151 1156 1152 1157 #if defined(SH_WITH_CLIENT) … … 1308 1313 /* } new 1.4.8 check sig also for files downloaded from server */ 1309 1314 1310 line = SH_ALLOC(MAX_PATH_STORE+ 1);1315 line = SH_ALLOC(MAX_PATH_STORE+2); 1311 1316 1312 1317 /* fast forward to start of data 1313 1318 */ 1314 sh_hash_setdataent(fd, line, MAX_PATH_STORE , file_path('D', 'R'));1319 sh_hash_setdataent(fd, line, MAX_PATH_STORE+1, file_path('D', 'R')); 1315 1320 1316 1321 for (i = 0; i < TABSIZE; ++i) … … 1326 1331 } 1327 1332 1328 p = sh_hash_getdataent (fd, line, MAX_PATH_STORE );1333 p = sh_hash_getdataent (fd, line, MAX_PATH_STORE+1); 1329 1334 if (p != NULL) 1330 1335 { … … 1922 1927 { 1923 1928 sh_file_t * p; 1924 int retval = 0;1929 int retval; 1925 1930 1926 1931 if (IsInit != 1) … … 1928 1933 1929 1934 SH_MUTEX_LOCK(mutex_hash); 1935 1936 retval = 0; 1937 1930 1938 p = sh_hash_have_it_int (newname); 1931 1939 … … 1944 1952 { 1945 1953 sh_file_t * p; 1946 int retval = -1;1954 int retval; 1947 1955 1948 1956 if (IsInit != 1) … … 1953 1961 1954 1962 SH_MUTEX_LOCK(mutex_hash); 1963 1964 retval = (-1); 1965 1955 1966 p = sh_hash_have_it_int (newname); 1956 1967 if (p) … … 1973 1984 { 1974 1985 sh_file_t * p; 1975 int retval = -1;1986 int retval; 1976 1987 1977 1988 if (IsInit != 1) … … 1982 1993 if (p) 1983 1994 retval = p->fflags; 1995 else 1996 retval = -1; 1984 1997 SH_MUTEX_UNLOCK(mutex_hash); 1985 1998 return retval; … … 1989 2002 { 1990 2003 sh_file_t * p; 1991 int retval = -1;2004 int retval; 1992 2005 1993 2006 if (IsInit != 1) … … 2001 2014 retval = 0; 2002 2015 } 2016 else 2017 retval = -1; 2003 2018 SH_MUTEX_UNLOCK(mutex_hash); 2004 2019 return retval; … … 2035 2050 sh_file_t * p; 2036 2051 char hashbuf[KEYBUF_SIZE]; 2037 int retval = -1;2052 int retval; 2038 2053 2039 2054 SL_ENTER(_("sh_hash_set_visited_int")); … … 2072 2087 retval = 0; 2073 2088 } 2089 else 2090 retval = -1; 2074 2091 2075 2092 SH_MUTEX_UNLOCK(mutex_hash); … … 2373 2390 char * format; 2374 2391 2375 char * tmp = SH_ALLOC(SH_ BUFSIZE);2376 char * msg = SH_ALLOC(SH_ BUFSIZE);2392 char * tmp = SH_ALLOC(SH_MSG_BUF); 2393 char * msg = SH_ALLOC(SH_MSG_BUF); 2377 2394 2378 2395 tmp[0] = '\0'; … … 2385 2402 else 2386 2403 format = _("mode_old=\"%s\" attr_old=\"%s\" imode_old=\"%ld\" iattr_old=\"%ld\" "); 2387 sl_snprintf(tmp, SH_ BUFSIZE, format,2404 sl_snprintf(tmp, SH_MSG_BUF, format, 2388 2405 theFile->c_mode, 2389 2406 theFile->c_attributes, … … 2397 2414 format = _("mode_old=\"%s\" imode_old=\"%ld\" "); 2398 2415 2399 sl_snprintf(tmp, SH_ BUFSIZE, format,2416 sl_snprintf(tmp, SH_MSG_BUF, format, 2400 2417 theFile->c_mode, 2401 2418 (long) theFile->mode 2402 2419 ); 2403 2420 #endif 2404 sl_strlcat(msg, tmp, SH_ BUFSIZE);2421 sl_strlcat(msg, tmp, SH_MSG_BUF); 2405 2422 2406 2423 if (is_new) … … 2408 2425 else 2409 2426 format = _("hardlinks_old=\"%lu\" "); 2410 sl_snprintf(tmp, SH_ BUFSIZE, format,2427 sl_snprintf(tmp, SH_MSG_BUF, format, 2411 2428 (unsigned long) theFile->hardlinks); 2412 sl_strlcat(msg, tmp, SH_ BUFSIZE);2429 sl_strlcat(msg, tmp, SH_MSG_BUF); 2413 2430 2414 2431 … … 2417 2434 else 2418 2435 format = _("idevice_old=\"%lu\" "); 2419 sl_snprintf(tmp, SH_ BUFSIZE, format, (unsigned long) theFile->rdev);2420 sl_strlcat(msg, tmp, SH_ BUFSIZE);2436 sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->rdev); 2437 sl_strlcat(msg, tmp, SH_MSG_BUF); 2421 2438 2422 2439 … … 2425 2442 else 2426 2443 format = _("inode_old=\"%lu\" "); 2427 sl_snprintf(tmp, SH_ BUFSIZE, format, (unsigned long) theFile->ino);2428 sl_strlcat(msg, tmp, SH_ BUFSIZE);2444 sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->ino); 2445 sl_strlcat(msg, tmp, SH_MSG_BUF); 2429 2446 2430 2447 /* … … 2436 2453 else 2437 2454 format = _("dev_old=\"%lu,%lu\" "); 2438 sl_snprintf(tmp, SH_ BUFSIZE, format,2455 sl_snprintf(tmp, SH_MSG_BUF, format, 2439 2456 (unsigned long) major(theFile->dev), 2440 2457 (unsigned long) minor(theFile->dev)); 2441 sl_strlcat(msg, tmp, SH_ BUFSIZE);2458 sl_strlcat(msg, tmp, SH_MSG_BUF); 2442 2459 #endif 2443 2460 … … 2447 2464 else 2448 2465 format = _("owner_old=\"%s\" iowner_old=\"%ld\" "); 2449 sl_snprintf(tmp, SH_ BUFSIZE, format,2466 sl_snprintf(tmp, SH_MSG_BUF, format, 2450 2467 theFile->c_owner, (long) theFile->owner); 2451 sl_strlcat(msg, tmp, SH_ BUFSIZE);2468 sl_strlcat(msg, tmp, SH_MSG_BUF); 2452 2469 2453 2470 … … 2456 2473 else 2457 2474 format = _("group_old=\"%s\" igroup_old=\"%ld\" "); 2458 sl_snprintf(tmp, SH_ BUFSIZE, format,2475 sl_snprintf(tmp, SH_MSG_BUF, format, 2459 2476 theFile->c_group, (long) theFile->group); 2460 sl_strlcat(msg, tmp, SH_ BUFSIZE);2477 sl_strlcat(msg, tmp, SH_MSG_BUF); 2461 2478 2462 2479 2463 2480 if (is_new) 2464 sl_snprintf(tmp, SH_ BUFSIZE, sh_hash_size_format(),2481 sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(), 2465 2482 (UINT64) 0, (UINT64) theFile->size); 2466 2483 else 2467 sl_snprintf(tmp, SH_ BUFSIZE, sh_hash_size_format(),2484 sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(), 2468 2485 (UINT64) theFile->size, (UINT64) 0); 2469 sl_strlcat(msg, tmp, SH_ BUFSIZE);2486 sl_strlcat(msg, tmp, SH_MSG_BUF); 2470 2487 2471 2488 2472 2489 (void) sh_unix_gmttime (theFile->ctime, timstr1c, sizeof(timstr1c)); 2473 2490 if (is_new) 2474 sl_snprintf(tmp, SH_ BUFSIZE, _("ctime_new=\"%s\" "), timstr1c);2475 else 2476 sl_snprintf(tmp, SH_ BUFSIZE, _("ctime_old=\"%s\" "), timstr1c);2477 sl_strlcat(msg, tmp, SH_ BUFSIZE);2491 sl_snprintf(tmp, SH_MSG_BUF, _("ctime_new=\"%s\" "), timstr1c); 2492 else 2493 sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=\"%s\" "), timstr1c); 2494 sl_strlcat(msg, tmp, SH_MSG_BUF); 2478 2495 2479 2496 (void) sh_unix_gmttime (theFile->atime, timstr1a, sizeof(timstr1a)); 2480 2497 if (is_new) 2481 sl_snprintf(tmp, SH_ BUFSIZE, _("atime_new=\"%s\" "), timstr1a);2482 else 2483 sl_snprintf(tmp, SH_ BUFSIZE, _("atime_old=\"%s\" "), timstr1a);2484 sl_strlcat(msg, tmp, SH_ BUFSIZE);2498 sl_snprintf(tmp, SH_MSG_BUF, _("atime_new=\"%s\" "), timstr1a); 2499 else 2500 sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=\"%s\" "), timstr1a); 2501 sl_strlcat(msg, tmp, SH_MSG_BUF); 2485 2502 2486 2503 (void) sh_unix_gmttime (theFile->mtime, timstr1m, sizeof(timstr1m)); 2487 2504 if (is_new) 2488 sl_snprintf(tmp, SH_ BUFSIZE, _("mtime_new=\"%s\" "), timstr1m);2489 else 2490 sl_snprintf(tmp, SH_ BUFSIZE, _("mtime_old=\"%s\" "), timstr1m);2491 sl_strlcat(msg, tmp, SH_ BUFSIZE);2505 sl_snprintf(tmp, SH_MSG_BUF, _("mtime_new=\"%s\" "), timstr1m); 2506 else 2507 sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=\"%s\" "), timstr1m); 2508 sl_strlcat(msg, tmp, SH_MSG_BUF); 2492 2509 2493 2510 if (is_new) 2494 sl_snprintf(tmp, SH_ BUFSIZE, _("chksum_new=\"%s\" "), fileHash);2495 else 2496 sl_snprintf(tmp, SH_ BUFSIZE, _("chksum_old=\"%s\" "), fileHash);2497 sl_strlcat(msg, tmp, SH_ BUFSIZE);2511 sl_snprintf(tmp, SH_MSG_BUF, _("chksum_new=\"%s\" "), fileHash); 2512 else 2513 sl_snprintf(tmp, SH_MSG_BUF, _("chksum_old=\"%s\" "), fileHash); 2514 sl_strlcat(msg, tmp, SH_MSG_BUF); 2498 2515 2499 2516 if (theFile->c_mode[0] == 'l' || … … 2504 2521 { 2505 2522 if (is_new) 2506 sl_snprintf(tmp, SH_ BUFSIZE, _("link_new=\"%s\" "), tmp_lnk);2523 sl_snprintf(tmp, SH_MSG_BUF, _("link_new=\"%s\" "), tmp_lnk); 2507 2524 else 2508 sl_snprintf(tmp, SH_ BUFSIZE, _("link_old=\"%s\" "), tmp_lnk);2525 sl_snprintf(tmp, SH_MSG_BUF, _("link_old=\"%s\" "), tmp_lnk); 2509 2526 SH_FREE(tmp_lnk); 2510 sl_strlcat(msg, tmp, SH_ BUFSIZE);2527 sl_strlcat(msg, tmp, SH_MSG_BUF); 2511 2528 } 2512 2529 } … … 2518 2535 { 2519 2536 if (is_new) 2520 sl_snprintf(tmp, SH_ BUFSIZE, _("acl_new=\"%s\" "), tmp_lnk);2537 sl_snprintf(tmp, SH_MSG_BUF, _("acl_new=\"%s\" "), tmp_lnk); 2521 2538 else 2522 sl_snprintf(tmp, SH_ BUFSIZE, _("acl_old=\"%s\" "), tmp_lnk);2539 sl_snprintf(tmp, SH_MSG_BUF, _("acl_old=\"%s\" "), tmp_lnk); 2523 2540 SH_FREE(tmp_lnk); 2524 sl_strlcat(msg, tmp, SH_ BUFSIZE);2541 sl_strlcat(msg, tmp, SH_MSG_BUF); 2525 2542 } 2526 2543 } … … 2540 2557 char * format; 2541 2558 2542 char * tmp = SH_ALLOC(SH_ BUFSIZE);2543 char * msg = SH_ALLOC(SH_ BUFSIZE);2559 char * tmp = SH_ALLOC(SH_MSG_BUF); 2560 char * msg = SH_ALLOC(SH_MSG_BUF); 2544 2561 2545 2562 tmp[0] = '\0'; … … 2552 2569 else 2553 2570 format = _("mode_old=<%s>, attr_old=<%s>, imode_old=<%ld>, iattr_old=<%ld>, "); 2554 sl_snprintf(tmp, SH_ BUFSIZE, format,2571 sl_snprintf(tmp, SH_MSG_BUF, format, 2555 2572 theFile->c_mode, 2556 2573 theFile->c_attributes, … … 2564 2581 format = _("mode_old=<%s>, imode_old=<%ld>, "); 2565 2582 2566 sl_snprintf(tmp, SH_ BUFSIZE, format,2583 sl_snprintf(tmp, SH_MSG_BUF, format, 2567 2584 theFile->c_mode, 2568 2585 (long) theFile->mode 2569 2586 ); 2570 2587 #endif 2571 sl_strlcat(msg, tmp, SH_ BUFSIZE);2588 sl_strlcat(msg, tmp, SH_MSG_BUF); 2572 2589 2573 2590 if (is_new) … … 2575 2592 else 2576 2593 format = _("hardlinks_old=<%lu>, "); 2577 sl_snprintf(tmp, SH_ BUFSIZE, format,2594 sl_snprintf(tmp, SH_MSG_BUF, format, 2578 2595 (unsigned long) theFile->hardlinks); 2579 sl_strlcat(msg, tmp, SH_ BUFSIZE);2596 sl_strlcat(msg, tmp, SH_MSG_BUF); 2580 2597 2581 2598 … … 2584 2601 else 2585 2602 format = _("idevice_old=<%lu>, "); 2586 sl_snprintf(tmp, SH_ BUFSIZE, format, (unsigned long) theFile->rdev);2587 sl_strlcat(msg, tmp, SH_ BUFSIZE);2603 sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->rdev); 2604 sl_strlcat(msg, tmp, SH_MSG_BUF); 2588 2605 2589 2606 … … 2592 2609 else 2593 2610 format = _("inode_old=<%lu>, "); 2594 sl_snprintf(tmp, SH_ BUFSIZE, format, (unsigned long) theFile->ino);2595 sl_strlcat(msg, tmp, SH_ BUFSIZE);2611 sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->ino); 2612 sl_strlcat(msg, tmp, SH_MSG_BUF); 2596 2613 2597 2614 … … 2604 2621 else 2605 2622 format = _("dev_old=<%lu,%lu>, "); 2606 sl_snprintf(tmp, SH_ BUFSIZE, format,2623 sl_snprintf(tmp, SH_MSG_BUF, format, 2607 2624 (unsigned long) major(theFile->dev), 2608 2625 (unsigned long) minor(theFile->dev)); 2609 sl_strlcat(msg, tmp, SH_ BUFSIZE);2626 sl_strlcat(msg, tmp, SH_MSG_BUF); 2610 2627 #endif 2611 2628 … … 2614 2631 else 2615 2632 format = _("owner_old=<%s>, iowner_old=<%ld>, "); 2616 sl_snprintf(tmp, SH_ BUFSIZE, format,2633 sl_snprintf(tmp, SH_MSG_BUF, format, 2617 2634 theFile->c_owner, (long) theFile->owner); 2618 sl_strlcat(msg, tmp, SH_ BUFSIZE);2635 sl_strlcat(msg, tmp, SH_MSG_BUF); 2619 2636 2620 2637 … … 2623 2640 else 2624 2641 format = _("group_old=<%s>, igroup_old=<%ld>, "); 2625 sl_snprintf(tmp, SH_ BUFSIZE, format,2642 sl_snprintf(tmp, SH_MSG_BUF, format, 2626 2643 theFile->c_group, (long) theFile->group); 2627 sl_strlcat(msg, tmp, SH_ BUFSIZE);2644 sl_strlcat(msg, tmp, SH_MSG_BUF); 2628 2645 2629 2646 2630 2647 if (is_new) 2631 sl_snprintf(tmp, SH_ BUFSIZE, sh_hash_size_format(),2648 sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(), 2632 2649 (UINT64) 0, (UINT64) theFile->size); 2633 2650 else 2634 sl_snprintf(tmp, SH_ BUFSIZE, sh_hash_size_format(),2651 sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(), 2635 2652 (UINT64) theFile->size, (UINT64) 0); 2636 sl_strlcat(msg, tmp, SH_ BUFSIZE);2653 sl_strlcat(msg, tmp, SH_MSG_BUF); 2637 2654 2638 2655 2639 2656 (void) sh_unix_gmttime (theFile->ctime, timstr1c, sizeof(timstr1c)); 2640 2657 if (is_new) 2641 sl_snprintf(tmp, SH_ BUFSIZE, _("ctime_new=<%s>, "), timstr1c);2642 else 2643 sl_snprintf(tmp, SH_ BUFSIZE, _("ctime_old=<%s>, "), timstr1c);2644 sl_strlcat(msg, tmp, SH_ BUFSIZE);2658 sl_snprintf(tmp, SH_MSG_BUF, _("ctime_new=<%s>, "), timstr1c); 2659 else 2660 sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=<%s>, "), timstr1c); 2661 sl_strlcat(msg, tmp, SH_MSG_BUF); 2645 2662 2646 2663 (void) sh_unix_gmttime (theFile->atime, timstr1a, sizeof(timstr1a)); 2647 2664 if (is_new) 2648 sl_snprintf(tmp, SH_ BUFSIZE, _("atime_new=<%s>, "), timstr1a);2649 else 2650 sl_snprintf(tmp, SH_ BUFSIZE, _("atime_old=<%s>, "), timstr1a);2651 sl_strlcat(msg, tmp, SH_ BUFSIZE);2665 sl_snprintf(tmp, SH_MSG_BUF, _("atime_new=<%s>, "), timstr1a); 2666 else 2667 sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=<%s>, "), timstr1a); 2668 sl_strlcat(msg, tmp, SH_MSG_BUF); 2652 2669 2653 2670 (void) sh_unix_gmttime (theFile->mtime, timstr1m, sizeof(timstr1m)); 2654 2671 if (is_new) 2655 sl_snprintf(tmp, SH_ BUFSIZE, _("mtime_new=<%s>, "), timstr1m);2656 else 2657 sl_snprintf(tmp, SH_ BUFSIZE, _("mtime_old=<%s>, "), timstr1m);2658 sl_strlcat(msg, tmp, SH_ BUFSIZE);2672 sl_snprintf(tmp, SH_MSG_BUF, _("mtime_new=<%s>, "), timstr1m); 2673 else 2674 sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=<%s>, "), timstr1m); 2675 sl_strlcat(msg, tmp, SH_MSG_BUF); 2659 2676 2660 2677 if (is_new) 2661 sl_snprintf(tmp, SH_ BUFSIZE, _("chksum_new=<%s>"), fileHash);2662 else 2663 sl_snprintf(tmp, SH_ BUFSIZE, _("chksum_old=<%s>"), fileHash);2664 sl_strlcat(msg, tmp, SH_ BUFSIZE);2678 sl_snprintf(tmp, SH_MSG_BUF, _("chksum_new=<%s>"), fileHash); 2679 else 2680 sl_snprintf(tmp, SH_MSG_BUF, _("chksum_old=<%s>"), fileHash); 2681 sl_strlcat(msg, tmp, SH_MSG_BUF); 2665 2682 2666 2683 if (theFile->c_mode[0] == 'l' || … … 2671 2688 { 2672 2689 if (is_new) 2673 sl_snprintf(tmp, SH_ BUFSIZE, _(", link_new=<%s> "), tmp_lnk);2690 sl_snprintf(tmp, SH_MSG_BUF, _(", link_new=<%s> "), tmp_lnk); 2674 2691 else 2675 sl_snprintf(tmp, SH_ BUFSIZE, _(", link_old=<%s> "), tmp_lnk);2692 sl_snprintf(tmp, SH_MSG_BUF, _(", link_old=<%s> "), tmp_lnk); 2676 2693 SH_FREE(tmp_lnk); 2677 sl_strlcat(msg, tmp, SH_ BUFSIZE);2694 sl_strlcat(msg, tmp, SH_MSG_BUF); 2678 2695 } 2679 2696 } … … 2685 2702 { 2686 2703 if (is_new) 2687 sl_snprintf(tmp, SH_ BUFSIZE, _(", acl_new=<%s> "), tmp_lnk);2704 sl_snprintf(tmp, SH_MSG_BUF, _(", acl_new=<%s> "), tmp_lnk); 2688 2705 else 2689 sl_snprintf(tmp, SH_ BUFSIZE, _(", acl_old=<%s> "), tmp_lnk);2706 sl_snprintf(tmp, SH_MSG_BUF, _(", acl_old=<%s> "), tmp_lnk); 2690 2707 SH_FREE(tmp_lnk); 2691 sl_strlcat(msg, tmp, SH_ BUFSIZE);2708 sl_strlcat(msg, tmp, SH_MSG_BUF); 2692 2709 } 2693 2710 } … … 2747 2764 int i; 2748 2765 2749 unsigned long modi_mask = 0;2766 unsigned long modi_mask; 2750 2767 2751 2768 char log_policy[32]; … … 2753 2770 char hashbuf[KEYBUF_SIZE]; 2754 2771 2755 int retval = 0;2772 int retval; 2756 2773 2757 2774 SL_ENTER(_("sh_hash_compdata")); … … 2770 2787 2771 2788 SH_MUTEX_LOCK(mutex_hash); 2789 2790 modi_mask = 0; 2791 retval = 0; 2772 2792 2773 2793 if (sl_strlen(theFile->fullpath) <= MAX_PATH_STORE) … … 3044 3064 if (modi_mask != 0 && (!SH_FFLAG_REPORTED_SET(p->fflags))) 3045 3065 { 3046 tmp = SH_ALLOC(SH_ BUFSIZE);3047 msg = SH_ALLOC(SH_ BUFSIZE);3066 tmp = SH_ALLOC(SH_MSG_BUF); 3067 msg = SH_ALLOC(SH_MSG_BUF); 3048 3068 msg[0] = '\0'; 3049 3069 … … 3056 3076 { 3057 3077 #if defined(__linux__) || defined(HAVE_STAT_FLAGS) 3058 sl_snprintf(tmp, SH_ BUFSIZE,3078 sl_snprintf(tmp, SH_MSG_BUF, 3059 3079 #ifdef SH_USE_XML 3060 3080 _("mode_old=\"%s\" mode_new=\"%s\" attr_old=\"%s\" attr_new=\"%s\" imode_old=\"%ld\" imode_new=\"%ld\" iattr_old=\"%ld\" iattr_new=\"%ld\" "), … … 3072 3092 #else 3073 3093 #ifdef SH_USE_XML 3074 sl_snprintf(tmp, SH_ BUFSIZE,3094 sl_snprintf(tmp, SH_MSG_BUF, 3075 3095 _("mode_old=\"%s\" mode_new=\"%s\" imode_old=\"%ld\" imode_new=\"%ld\" "), 3076 3096 p->theFile.c_mode, theFile->c_mode, 3077 3097 (long) p->theFile.mode, (long) theFile->mode); 3078 3098 #else 3079 sl_snprintf(tmp, SH_ BUFSIZE, _("mode_old=<%s>, mode_new=<%s>, "),3099 sl_snprintf(tmp, SH_MSG_BUF, _("mode_old=<%s>, mode_new=<%s>, "), 3080 3100 p->theFile.c_mode, theFile->c_mode); 3081 3101 #endif 3082 3102 #endif 3083 sl_strlcat(msg, tmp, SH_ BUFSIZE);3103 sl_strlcat(msg, tmp, SH_MSG_BUF); 3084 3104 3085 3105 #if defined(USE_ACL) || defined(USE_XATTR) 3086 3106 if (theFile->attr_string != NULL || p->attr_string != NULL) 3087 3107 { 3088 sl_snprintf(tmp, SH_ BUFSIZE,3108 sl_snprintf(tmp, SH_MSG_BUF, 3089 3109 #ifdef SH_USE_XML 3090 3110 _("acl_old=\"%s\" acl_new=\"%s\" "), … … 3095 3115 (theFile->attr_string) ? theFile->attr_string : _("none")); 3096 3116 3097 sl_strlcat(msg, tmp, SH_ BUFSIZE);3117 sl_strlcat(msg, tmp, SH_MSG_BUF); 3098 3118 } 3099 3119 #endif … … 3135 3155 if ((modi_mask & MODI_HLN) != 0) 3136 3156 { 3137 sl_snprintf(tmp, SH_ BUFSIZE,3157 sl_snprintf(tmp, SH_MSG_BUF, 3138 3158 #ifdef SH_USE_XML 3139 3159 _("hardlinks_old=\"%lu\" hardlinks_new=\"%lu\" "), … … 3143 3163 (unsigned long) p->theFile.hardlinks, 3144 3164 (unsigned long) theFile->hardlinks); 3145 sl_strlcat(msg, tmp, SH_ BUFSIZE);3165 sl_strlcat(msg, tmp, SH_MSG_BUF); 3146 3166 #ifdef REPLACE_OLD 3147 3167 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3152 3172 if ((modi_mask & MODI_RDEV) != 0) 3153 3173 { 3154 sl_snprintf(tmp, SH_ BUFSIZE,3174 sl_snprintf(tmp, SH_MSG_BUF, 3155 3175 #ifdef SH_USE_XML 3156 3176 _("device_old=\"%lu,%lu\" device_new=\"%lu,%lu\" idevice_old=\"%lu\" idevice_new=\"%lu\" "), … … 3167 3187 #endif 3168 3188 ); 3169 sl_strlcat(msg, tmp, SH_ BUFSIZE);3189 sl_strlcat(msg, tmp, SH_MSG_BUF); 3170 3190 #ifdef REPLACE_OLD 3171 3191 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3176 3196 if ((modi_mask & MODI_INO) != 0) 3177 3197 { 3178 sl_snprintf(tmp, SH_ BUFSIZE,3198 sl_snprintf(tmp, SH_MSG_BUF, 3179 3199 #ifdef SH_USE_XML 3180 3200 _("inode_old=\"%lu\" inode_new=\"%lu\" "), … … 3184 3204 (unsigned long) p->theFile.ino, 3185 3205 (unsigned long) theFile->ino); 3186 sl_strlcat(msg, tmp, SH_ BUFSIZE);3206 sl_strlcat(msg, tmp, SH_MSG_BUF); 3187 3207 #ifdef REPLACE_OLD 3188 3208 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3201 3221 if ((modi_mask & MODI_INO) != 0) 3202 3222 { 3203 sl_snprintf(tmp, SH_ BUFSIZE,3223 sl_snprintf(tmp, SH_MSG_BUF, 3204 3224 #ifdef SH_USE_XML 3205 3225 _("dev_old=\"%lu,%lu\" dev_new=\"%lu,%lu\" "), … … 3212 3232 (unsigned long) minor(theFile->dev) 3213 3233 ); 3214 sl_strlcat(msg, tmp, SH_ BUFSIZE);3234 sl_strlcat(msg, tmp, SH_MSG_BUF); 3215 3235 #ifdef REPLACE_OLD 3216 3236 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3227 3247 { 3228 3248 #ifdef SH_USE_XML 3229 sl_snprintf(tmp, SH_ BUFSIZE,3249 sl_snprintf(tmp, SH_MSG_BUF, 3230 3250 _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "), 3231 3251 #else 3232 sl_snprintf(tmp, SH_ BUFSIZE,3252 sl_snprintf(tmp, SH_MSG_BUF, 3233 3253 _("owner_old=<%s>, owner_new=<%s>, iowner_old=<%ld>, iowner_new=<%ld>, "), 3234 3254 #endif … … 3236 3256 (long) p->theFile.owner, (long) theFile->owner 3237 3257 ); 3238 sl_strlcat(msg, tmp, SH_ BUFSIZE);3258 sl_strlcat(msg, tmp, SH_MSG_BUF); 3239 3259 #ifdef REPLACE_OLD 3240 3260 if ((modi_mask & MODI_USR) != 0) { … … 3255 3275 { 3256 3276 #ifdef SH_USE_XML 3257 sl_snprintf(tmp, SH_ BUFSIZE,3277 sl_snprintf(tmp, SH_MSG_BUF, 3258 3278 _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "), 3259 3279 p->theFile.c_group, theFile->c_group, 3260 3280 (long) p->theFile.group, (long) theFile->group); 3261 3281 #else 3262 sl_snprintf(tmp, SH_ BUFSIZE,3282 sl_snprintf(tmp, SH_MSG_BUF, 3263 3283 _("group_old=<%s>, group_new=<%s>, igroup_old=<%ld>, igroup_new=<%ld>, "), 3264 3284 p->theFile.c_group, theFile->c_group, … … 3266 3286 #endif 3267 3287 3268 sl_strlcat(msg, tmp, SH_ BUFSIZE);3288 sl_strlcat(msg, tmp, SH_MSG_BUF); 3269 3289 #ifdef REPLACE_OLD 3270 3290 if ((modi_mask & MODI_GRP) != 0) { … … 3280 3300 if ((modi_mask & MODI_SIZ) != 0) 3281 3301 { 3282 sl_snprintf(tmp, SH_ BUFSIZE, sh_hash_size_format(),3302 sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(), 3283 3303 (UINT64) p->theFile.size, 3284 3304 (UINT64) theFile->size); 3285 sl_strlcat(msg, tmp, SH_ BUFSIZE);3305 sl_strlcat(msg, tmp, SH_MSG_BUF); 3286 3306 #ifdef REPLACE_OLD 3287 3307 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3295 3315 (void) sh_unix_gmttime (theFile->ctime, timstr2c, sizeof(timstr2c)); 3296 3316 #ifdef SH_USE_XML 3297 sl_snprintf(tmp, SH_ BUFSIZE, _("ctime_old=\"%s\" ctime_new=\"%s\" "),3317 sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=\"%s\" ctime_new=\"%s\" "), 3298 3318 timstr1c, timstr2c); 3299 3319 #else 3300 sl_snprintf(tmp, SH_ BUFSIZE, _("ctime_old=<%s>, ctime_new=<%s>, "),3320 sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=<%s>, ctime_new=<%s>, "), 3301 3321 timstr1c, timstr2c); 3302 3322 #endif 3303 sl_strlcat(msg, tmp, SH_ BUFSIZE);3323 sl_strlcat(msg, tmp, SH_MSG_BUF); 3304 3324 #ifdef REPLACE_OLD 3305 3325 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3313 3333 (void) sh_unix_gmttime (theFile->atime, timstr2a, sizeof(timstr2a)); 3314 3334 #ifdef SH_USE_XML 3315 sl_snprintf(tmp, SH_ BUFSIZE, _("atime_old=\"%s\" atime_new=\"%s\" "),3335 sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=\"%s\" atime_new=\"%s\" "), 3316 3336 timstr1a, timstr2a); 3317 3337 #else 3318 sl_snprintf(tmp, SH_ BUFSIZE, _("atime_old=<%s>, atime_new=<%s>, "),3338 sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=<%s>, atime_new=<%s>, "), 3319 3339 timstr1a, timstr2a); 3320 3340 #endif 3321 sl_strlcat(msg, tmp, SH_ BUFSIZE);3341 sl_strlcat(msg, tmp, SH_MSG_BUF); 3322 3342 #ifdef REPLACE_OLD 3323 3343 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3331 3351 (void) sh_unix_gmttime (theFile->mtime, timstr2m, sizeof(timstr2m)); 3332 3352 #ifdef SH_USE_XML 3333 sl_snprintf(tmp, SH_ BUFSIZE, _("mtime_old=\"%s\" mtime_new=\"%s\" "),3353 sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=\"%s\" mtime_new=\"%s\" "), 3334 3354 timstr1m, timstr2m); 3335 3355 #else 3336 sl_snprintf(tmp, SH_ BUFSIZE, _("mtime_old=<%s>, mtime_new=<%s>, "),3356 sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=<%s>, mtime_new=<%s>, "), 3337 3357 timstr1m, timstr2m); 3338 3358 #endif 3339 sl_strlcat(msg, tmp, SH_ BUFSIZE);3359 sl_strlcat(msg, tmp, SH_MSG_BUF); 3340 3360 #ifdef REPLACE_OLD 3341 3361 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3347 3367 if ((modi_mask & MODI_CHK) != 0) 3348 3368 { 3349 sl_snprintf(tmp, SH_ BUFSIZE,3369 sl_snprintf(tmp, SH_MSG_BUF, 3350 3370 #ifdef SH_USE_XML 3351 3371 _("chksum_old=\"%s\" chksum_new=\"%s\" "), … … 3354 3374 #endif 3355 3375 p->theFile.checksum, fileHash); 3356 sl_strlcat(msg, tmp, SH_ BUFSIZE);3376 sl_strlcat(msg, tmp, SH_MSG_BUF); 3357 3377 #ifdef REPLACE_OLD 3358 3378 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3381 3401 tmp_lnk_old = sh_util_strdup("-"); 3382 3402 #ifdef SH_USE_XML 3383 sl_snprintf(tmp, SH_ BUFSIZE, _("link_old=\"%s\" link_new=\"%s\" "),3403 sl_snprintf(tmp, SH_MSG_BUF, _("link_old=\"%s\" link_new=\"%s\" "), 3384 3404 tmp_lnk_old, tmp_lnk); 3385 3405 #else 3386 sl_snprintf(tmp, SH_ BUFSIZE, _("link_old=<%s>, link_new=<%s>"),3406 sl_snprintf(tmp, SH_MSG_BUF, _("link_old=<%s>, link_new=<%s>"), 3387 3407 tmp_lnk_old, tmp_lnk); 3388 3408 #endif 3389 3409 SH_FREE(tmp_lnk); 3390 3410 SH_FREE(tmp_lnk_old); 3391 sl_strlcat(msg, tmp, SH_ BUFSIZE);3411 sl_strlcat(msg, tmp, SH_MSG_BUF); 3392 3412 #ifdef REPLACE_OLD 3393 3413 if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) … … 3908 3928 (unsigned char *)linkpath, 3909 3929 strlen(linkpath)); 3930 3910 3931 clen = dlen * 2 + 1; 3932 3911 3933 do { 3912 3934 if (decompressed) … … 3920 3942 { fprintf(stderr, _("Error: Data corrupt or incomplete\n")); return -1; } 3921 3943 } while (res == Z_BUF_ERROR || clen == clen_o); 3944 3922 3945 decompressed[clen] = '\0'; 3923 3946 fputs( (char*) decompressed, stdout); … … 3957 3980 } 3958 3981 3959 line = SH_ALLOC(MAX_PATH_STORE+ 1);3982 line = SH_ALLOC(MAX_PATH_STORE+2); 3960 3983 3961 3984 if ( SL_ISERROR(fd = sl_open_read(db_file, SL_YESPRIV))) … … 3969 3992 /* fast forward to start of data 3970 3993 */ 3971 sh_hash_setdataent(fd, line, MAX_PATH_STORE , db_file);3994 sh_hash_setdataent(fd, line, MAX_PATH_STORE+1, db_file); 3972 3995 3973 3996 while (1) 3974 3997 { 3975 p = sh_hash_getdataent (fd, line, MAX_PATH_STORE );3998 p = sh_hash_getdataent (fd, line, MAX_PATH_STORE+1); 3976 3999 if ((p != NULL) && (p->fullpath[0] == '/')) 3977 4000 { … … 4022 4045 if (flag == 0) 4023 4046 { 4024 fprintf(stderr, _(" No filefound\n"));4047 fprintf(stderr, _("File not found\n")); 4025 4048 _exit(EXIT_FAILURE); 4026 4049 } -
trunk/src/sh_html.c
r131 r170 277 277 278 278 static 279 int sh_html_get_entry ( )279 int sh_html_get_entry (void) 280 280 { 281 281 long retval = SL_ENONE; … … 390 390 int comp_arr (const void * ao, const void * bo) 391 391 { 392 sort_arr * a;393 sort_arr * b;392 const sort_arr * a; 393 const sort_arr * b; 394 394 395 395 if (ao == NULL && bo == NULL) … … 400 400 return (1); 401 401 402 a = ( sort_arr *) ao;403 b = ( sort_arr *) bo;402 a = (const sort_arr *) ao; 403 b = (const sort_arr *) bo; 404 404 405 405 return ((-1) * sl_strcmp(a->tim, b->tim)); -
trunk/src/sh_ignore.c
r22 r170 157 157 } 158 158 159 int sh_ignore_clean ( )159 int sh_ignore_clean (void) 160 160 { 161 161 struct sh_ignore_list * new; -
trunk/src/sh_mail.c
r137 r170 131 131 } 132 132 133 buf = SH_ALLOC( (size_t)(SH_ BUFSIZE+1));134 bufc = SH_ALLOC( (size_t)(SH_M AXBUF+1));133 buf = SH_ALLOC( (size_t)(SH_MSG_BUF+SH_BUFSIZE+1)); 134 bufc = SH_ALLOC( (size_t)(SH_MSG_BUF+SH_MAXBUF+1)); 135 135 136 136 while (1 == 1) … … 144 144 sizeof("-----BEGIN MESSAGE-----")-1)) 145 145 { 146 (void) sh_unix_getline (fd, buf, SH_ BUFSIZE);146 (void) sh_unix_getline (fd, buf, SH_MSG_BUF+SH_BUFSIZE); 147 147 if (buf[0] == '\0') 148 148 { … … 163 163 while (1 == 1) 164 164 { 165 (void) sh_unix_getline (fd, buf, SH_ BUFSIZE);165 (void) sh_unix_getline (fd, buf, SH_MSG_BUF+SH_BUFSIZE); 166 166 if (0 == sl_strncmp(buf, _("-----BEGIN SIGNATURE-----"), 167 167 sizeof("-----BEGIN SIGNATURE-----")-1)) … … 169 169 if (buf[0] == '\0') 170 170 _exit (EXIT_FAILURE); 171 (void) sh_util_compress(bufc, buf, SH_M AXBUF-KEY_LEN);171 (void) sh_util_compress(bufc, buf, SH_MSG_BUF+SH_MAXBUF-KEY_LEN); 172 172 } 173 173 … … 283 283 size_t s; 284 284 285 char * dup ;285 char * dupp; 286 286 char * p; 287 287 char * end; … … 314 314 *ntok = 0; 315 315 316 dup = sh_util_strdup(argstring);317 p = dup ;316 dupp = sh_util_strdup(argstring); 317 p = dupp; 318 318 319 319 do … … 369 369 370 370 *ntok = i; 371 SH_FREE(dup );371 SH_FREE(dupp); 372 372 373 373 SL_RETURN (0, _("sh_filter_filteradd")); … … 1888 1888 HEADER * header; 1889 1889 int type, rdlength, pref; 1890 unsigned int count, index;1890 unsigned int count, theindex; 1891 1891 dnsrep * retval; 1892 1892 … … 1953 1953 */ 1954 1954 count = ntohs (header->qdcount); 1955 for ( index = 0; index < count; ++index)1955 for (theindex = 0; theindex < count; ++theindex) 1956 1956 { 1957 1957 ret = dn_skipname (comp_dn, eom); … … 2101 2101 static dnsrep * return_mx (char *domain) 2102 2102 { 2103 struct hostent *host = NULL;2103 struct hostent *host; 2104 2104 dnsrep * answers = NULL; 2105 2105 mx * result; 2106 dnsrep * retval = NULL;2106 dnsrep * retval; 2107 2107 char errmsg[128]; 2108 2108 size_t len; … … 2144 2144 2145 2145 SH_MUTEX_LOCK(mutex_resolv); 2146 2147 host = NULL; 2148 retval = NULL; 2149 2146 2150 if (domain != NULL) 2147 2151 host = /*@-unrecog@*/sh_gethostbyname (domain)/*@+unrecog@*/; -
trunk/src/sh_mem.c
r154 r170 43 43 #include "sh_pthread.h" 44 44 45 extern int safe_logger (int signal, int method, char * details);45 extern int safe_logger (int thesignal, int method, char * details); 46 46 47 47 #undef FIL__ … … 258 258 259 259 260 void sh_mem_free (void * a , char * file, int line)261 { 262 volatile memlist_t * this = memlist;263 volatile memlist_t * before = memlist;260 void sh_mem_free (void * aa, char * file, int line) 261 { 262 memlist_t * this; 263 memlist_t * before; 264 264 unsigned long size = 0; 265 265 void * a; 266 266 SL_ENTER(_("sh_mem_free")); 267 267 … … 269 269 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 270 270 271 a = aa; 272 this = memlist; 273 before = memlist; 274 271 275 if ( a == NULL ) 272 276 { … … 315 319 free(a); 316 320 if (this) 317 free( (void*)this);321 free(this); 318 322 ++Free_Count; 319 323 --Now_Alloc_Count; -
trunk/src/sh_portcheck.c
r169 r170 179 179 } 180 180 181 val = (val <= 0 ? 60 : val);182 183 181 sh_portchk_interval = (time_t) val; 184 182 SL_RETURN(0, _("sh_portchk_set_interval")); … … 251 249 /* Interface to initialize port check 252 250 */ 253 int sh_portchk_init ( );251 int sh_portchk_init (struct mod_type * arg); 254 252 255 253 /* Interface to reset port check 256 254 */ 257 int sh_portchk_reset ( );255 int sh_portchk_reset (void); 258 256 259 257 /* Interface to run port check 260 258 */ 261 int sh_portchk_check ( );259 int sh_portchk_check (void); 262 260 263 261 … … 317 315 * Thereafter, we check for entries that are still UNKN. 318 316 */ 319 static void sh_portchk_reset_lists ( )317 static void sh_portchk_reset_lists (void) 320 318 { 321 319 struct sh_portentry * portlist; … … 364 362 } 365 363 364 /* These variables are not used anywhere. They only exist 365 * to assign &pre, &ptr to them, which keeps gcc from 366 * putting it into a register, and avoids the 'clobbered 367 * by longjmp' warning. And no, 'volatile' proved insufficient. 368 */ 369 static void * sh_dummy_pre = NULL; 370 static void * sh_dummy_ptr = NULL; 371 366 372 /* check the list of open ports for any that are marked as UNKN 367 373 */ … … 372 378 char errbuf[256]; 373 379 380 /* Take the address to keep gcc from putting them into registers. 381 * Avoids the 'clobbered by longjmp' warning. 382 */ 383 sh_dummy_pre = (void*) ⪯ 384 sh_dummy_ptr = (void*) &ptr; 385 374 386 while (ptr) 375 387 { … … 817 829 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 818 830 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 819 write (fd, _("SSH-2.0-Foobar"), 14);820 write (fd, "\r\n", 2);831 retval = write (fd, _("SSH-2.0-Foobar"), 14); 832 if (retval > 0) retval = write (fd, "\r\n", 2); 821 833 } 822 834 else if (port == 25) /* smtp */ … … 824 836 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 825 837 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 826 write (fd, _("QUIT"), 4);827 write (fd, "\r\n", 2);838 retval = write (fd, _("QUIT"), 4); 839 if (retval > 0) retval = write (fd, "\r\n", 2); 828 840 } 829 841 else if (port == 79) /* finger */ … … 831 843 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 832 844 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 833 write (fd, "\r\n", 2);845 retval = write (fd, "\r\n", 2); 834 846 } 835 847 else if (port == 110) /* pop3 */ … … 837 849 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 838 850 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 839 write (fd, _("QUIT"), 4);840 write (fd, "\r\n", 2);851 retval = write (fd, _("QUIT"), 4); 852 if (retval > 0) retval = write (fd, "\r\n", 2); 841 853 } 842 854 else if (port == 143) /* imap */ … … 844 856 flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 845 857 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK); 846 write (fd, _("A01 LOGOUT"), 10); 847 write (fd, "\r\n", 2); 848 } 858 retval = write (fd, _("A01 LOGOUT"), 10); 859 if (retval > 0) retval = write (fd, "\r\n", 2); 860 } 861 862 if (portchk_debug && retval < 0) 863 fprintf(stderr, _("check port: error writing to port %5d\n"), 864 port); 849 865 } 850 866 close (fd); … … 878 894 { 879 895 struct hostent * hent; 880 int i = 0;896 volatile int i; /* might be clobbered by âlongjmpâ or âvforkâ*/ 881 897 char errbuf[256]; 882 898 … … 899 915 SH_MUTEX_LOCK(mutex_resolv); 900 916 hent = sh_gethostbyname(portchk_hostname); 901 917 i = 0; 902 918 while (hent && hent->h_addr_list[i] && (iface_list.used < SH_IFACE_MAX)) 903 919 { … … 945 961 946 962 #if !defined(TEST_ONLY) 947 int sh_portchk_reconf ( )963 int sh_portchk_reconf (void) 948 964 { 949 965 SH_MUTEX_LOCK(mutex_port_check); … … 962 978 } 963 979 964 int sh_portchk_cleanup ( )980 int sh_portchk_cleanup (void) 965 981 { 966 982 return sh_portchk_reconf (); … … 983 999 static int check_port_generic (int port, int type, int protocol) 984 1000 { 985 inti = 0;1001 volatile int i = 0; 986 1002 int sock = -1; 987 1003 int flag = 1; /* non-zero to enable an option */ … … 1002 1018 if ((sock = socket(AF_INET, type, protocol)) < 0 ) 1003 1019 { 1020 ++i; 1004 1021 #ifdef TEST_ONLY 1005 1022 if (portchk_debug) … … 1010 1027 sh_error_message(errno, errbuf, sizeof(errbuf)), _("socket")); 1011 1028 SH_MUTEX_UNLOCK(mutex_thread_nolog); 1012 ++i; 1029 #endif 1013 1030 continue; 1014 #endif1015 1031 } 1016 1032 if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, 1017 1033 (void *) &flag, sizeof(flag)) < 0 ) 1018 1034 { 1035 ++i; 1019 1036 #ifdef TEST_ONLY 1020 1037 if (portchk_debug) … … 1026 1043 SH_MUTEX_UNLOCK(mutex_thread_nolog); 1027 1044 #endif 1028 ++i;1029 1045 continue; 1030 1046 } … … 1056 1072 1057 1073 1058 static int sh_portchk_scan_ports_generic (int min_port, int max_port , int type, int protocol)1074 static int sh_portchk_scan_ports_generic (int min_port, int max_port_arg, int type, int protocol) 1059 1075 { 1060 1076 /* … … 1063 1079 */ 1064 1080 1065 int port; 1081 volatile int port; /* might be clobbered by âlongjmpâ or âvforkâ*/ 1082 volatile int max_port = max_port_arg; 1066 1083 int retval; 1067 1084 int sock = -1; … … 1444 1461 int sh_portchk_check () 1445 1462 { 1446 int min_port = 0;1463 volatile int min_port; 1447 1464 1448 1465 SH_MUTEX_LOCK(mutex_port_check); 1466 1467 min_port = 0; 1468 1449 1469 if (sh_portchk_active != S_FALSE) 1450 1470 { -
trunk/src/sh_prelude.c
r169 r170 723 723 *tmp = '\0'; 724 724 725 /* Get interface 726 */ 725 727 ip = strdup(ptr); 726 728 if ( ip ) { … … 769 771 *tmp = '\0'; 770 772 773 /* Get port number 774 */ 771 775 port = strtol(ptr, &end, 0); 772 776 if ( *ptr && *end == '\0' && port >= 0 && port < 65536) { … … 810 814 *tmp = '\0'; 811 815 816 /* Get service 817 */ 812 818 srv = strdup(ptr); 813 819 if ( srv ) { … … 830 836 } 831 837 832 ret = idmef_service_new_ ident(service, &str);838 ret = idmef_service_new_name(service, &str); 833 839 if ( ret < 0 ) { 834 840 free(srv); -
trunk/src/sh_processcheck.c
r169 r170 394 394 } 395 395 396 /* These variables are not used anywhere. They only exist 397 * to assign &userold, &user to them, which keeps gcc from 398 * putting them into a register, and avoids the 'clobbered 399 * by longjmp' warning. And no, 'volatile' proved insufficient. 400 */ 401 static void * sh_dummy_watchlist = NULL; 402 396 403 static void check_watchlist (short * res) 397 404 { … … 399 406 char * tmp; 400 407 size_t indx; 408 409 /* Take the address to keep gcc from putting them into registers. 410 * Avoids the 'clobbered by longjmp' warning. 411 */ 412 sh_dummy_watchlist = (void*) &list; 401 413 402 414 while (list) … … 409 421 { 410 422 SH_MUTEX_LOCK(mutex_thread_nolog); 423 tmp = sh_util_safe_name (list->str); 411 424 sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 412 425 MSG_PCK_MISS, 413 list->str);426 tmp); 414 427 SH_MUTEX_UNLOCK(mutex_thread_nolog); 415 428 } … … 428 441 if (S_FALSE == is_in_list(&list_missing, list->str, 0)) 429 442 { 443 SH_MUTEX_LOCK(mutex_thread_nolog); 430 444 tmp = sh_util_safe_name (list->str); 431 SH_MUTEX_LOCK(mutex_thread_nolog);432 445 sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 433 446 MSG_PCK_MISS, … … 594 607 } 595 608 596 val = (val <= 0 ? 60 : val);597 598 609 sh_prochk_interval = (time_t) val; 599 610 SL_RETURN(0, _("sh_prochk_set_interval")); … … 625 636 static int proc_max_pid (size_t * procpid) 626 637 { 638 char * ret; 627 639 unsigned long pid; 628 640 FILE * fd; … … 640 652 { 641 653 str[0] = '\0'; 642 fgets(str, 128, fd);643 if ( *str != '\0')654 ret = fgets(str, 128, fd); 655 if (ret && *str != '\0') 644 656 { 645 657 pid = strtoul(str, &ptr, 0); … … 1055 1067 static int sh_process_check_int (short * res) 1056 1068 { 1057 size_t i, j; 1069 volatile size_t i; 1070 size_t j; 1058 1071 char tests[512]; 1059 int retval;1072 volatile int retval; 1060 1073 1061 1074 pid_t this_pid; … … 1207 1220 /* Initialise. 1208 1221 */ 1209 static int sh_prochk_init_internal( )1222 static int sh_prochk_init_internal(void) 1210 1223 { 1211 1224 SL_ENTER(_("sh_prochk_init")); … … 1267 1280 int sh_prochk_check(void) 1268 1281 { 1269 int status = 0;1282 int status; 1270 1283 1271 1284 SL_ENTER(_("sh_prochk_check")); 1272 1285 1273 1286 SH_MUTEX_LOCK(mutex_proc_check); 1287 1288 status = 0; 1289 1274 1290 if( ShProchkActive != S_FALSE ) 1275 1291 { -
trunk/src/sh_pthread.c
r143 r170 22 22 } 23 23 24 int sh_pthread_init_threadspecific( )24 int sh_pthread_init_threadspecific(void) 25 25 { 26 26 int rc = 0; 27 27 #ifdef SH_STEALTH 28 extern int sh_g_thread( );28 extern int sh_g_thread(void); 29 29 30 30 rc = sh_g_thread(); -
trunk/src/sh_readconf.c
r169 r170 96 96 97 97 typedef struct str_ListSections { 98 c har * name;98 const char * name; 99 99 int type; 100 100 } sh_str_ListSections; … … 721 721 722 722 typedef struct _cfg_options { 723 c har * optname;723 const char * optname; 724 724 ShSectionType section; 725 725 ShSectionType alt_section; … … 1111 1111 { 1112 1112 char * key; 1113 c har * value;1113 const char * value; 1114 1114 char * tmp; 1115 1115 int i; … … 1120 1120 #endif 1121 1121 1122 static c har *dummy = N_("dummy");1123 1124 static c har *closing[] = {1122 static const char *dummy = N_("dummy"); 1123 1124 static const char *closing[] = { 1125 1125 N_("closecommand"), 1126 1126 NULL 1127 1127 }; 1128 1128 1129 static c har *ident[] = {1129 static const char *ident[] = { 1130 1130 N_("severityreadonly"), 1131 1131 N_("severitylogfiles"), -
trunk/src/sh_socket.c
r132 r170 178 178 static void sh_socket_add2list (struct socket_cmd * in); 179 179 180 static void sh_socket_probe4reload ( )180 static void sh_socket_probe4reload (void) 181 181 { 182 182 struct reload_cmd * new; … … 222 222 } 223 223 224 char * sh_get_sockpass ( )224 char * sh_get_sockpass (void) 225 225 { 226 226 size_t j = 0; … … 236 236 } 237 237 238 void sh_set_sockpass ( )238 void sh_set_sockpass (void) 239 239 { 240 240 int j; -
trunk/src/sh_static.c
r150 r170 283 283 } 284 284 285 struct passwd * getpwuid(uid_t uid) 286 { 287 return sh_getpwuid(uid); 288 } 289 285 290 struct group * sh_getgrgid(gid_t gid) 286 291 { … … 293 298 } 294 299 300 struct group * getgrgid(gid_t gid) 301 { 302 return sh_getgrgid(gid); 303 } 295 304 296 305 struct passwd * sh_getpwnam(const char *name) … … 1560 1569 } 1561 1570 1562 static int __open_nameservers( )1571 static int __open_nameservers(void) 1563 1572 { 1564 1573 FILE *fp; … … 1887 1896 1888 1897 if(type == AF_INET) { 1889 unsigned char *tmp_addr = (unsigned char *)addr;1898 const unsigned char *tmp_addr = (const unsigned char *)addr; 1890 1899 1891 1900 memcpy(&in->s_addr, addr, len); -
trunk/src/sh_suidchk.c
r167 r170 859 859 int fflags; 860 860 char * fs; 861 long sl_status = SL_ENONE;861 long sl_status; 862 862 file_type theFile; 863 863 char fileHash[2*(KEY_LEN + 1)]; 864 864 865 struct sh_dirent * dirlist = NULL;866 struct sh_dirent * dirlist_orig = NULL;865 struct sh_dirent * dirlist; 866 struct sh_dirent * dirlist_orig; 867 867 char errbuf[SH_ERRBUF_SIZE]; 868 868 … … 896 896 SH_MUTEX_LOCK(mutex_readdir); 897 897 898 dirlist = NULL; 899 dirlist_orig = NULL; 900 898 901 do { 899 902 … … 918 921 919 922 dirlist_orig = dirlist; 923 924 sl_status = SL_ENONE; 920 925 921 926 do { … … 1345 1350 1346 1351 1347 static void sh_suidchk_free_schedule ( )1352 static void sh_suidchk_free_schedule (void) 1348 1353 { 1349 1354 sh_schedule_t * current = ShSuidchkSched; -
trunk/src/sh_tiger0.c
r167 r170 64 64 #if defined(TIGER_64_BIT) 65 65 66 void tiger_t( word64 *str, word64 length, word64 * res);67 void tiger( word64 *str, word64 length, word64 * res);66 void tiger_t(const word64 *str, word64 length, word64 * res); 67 void tiger(const word64 *str, word64 length, word64 * res); 68 68 69 69 #ifdef TIGER_DBG … … 75 75 #endif 76 76 #else 77 void tiger( sh_word32 *str, sh_word32 length, sh_word32 * res);78 void tiger_t( sh_word32 *str, sh_word32 length, sh_word32 * res);77 void tiger(const sh_word32 *str, sh_word32 length, sh_word32 * res); 78 void tiger_t(const sh_word32 *str, sh_word32 length, sh_word32 * res); 79 79 80 80 #ifdef TIGER_DBG … … 139 139 140 140 #if defined(TIGER_64_BIT) 141 #define TIGER_CAST ( word64*)141 #define TIGER_CAST (const word64*) 142 142 /* word64 res[3]; */ 143 143 res[0]= (word64) 0x0123456789ABCDEFLL; … … 145 145 res[2]= (word64) 0xF096A5B4C3B2E187LL; 146 146 #else 147 #define TIGER_CAST ( sh_word32*)147 #define TIGER_CAST (const sh_word32*) 148 148 /* sh_word32 res[6]; */ 149 149 res[0]= (sh_word32) 0x89ABCDEF; -
trunk/src/sh_tiger1.c
r18 r170 267 267 268 268 void 269 tiger_t( sh_word32 *str, sh_word32 length, sh_word32 res[6])269 tiger_t(const sh_word32 *str, sh_word32 length, sh_word32 res[6]) 270 270 { 271 271 register sh_word32 i; -
trunk/src/sh_tiger1_64.c
r46 r170 404 404 } 405 405 406 void tiger( word64 *str, word64 length, word64 res[3])406 void tiger(const word64 *str, word64 length, word64 res[3]) 407 407 { 408 408 register word64 i; -
trunk/src/sh_tools.c
r169 r170 475 475 char * host_name; 476 476 477 int fd = (-1);477 volatile int fd = (-1); 478 478 int status; 479 int fail = 0;479 volatile int fail = 0; 480 480 int cached = 0; 481 481 … … 522 522 #endif 523 523 { 524 SH_MUTEX_LOCK(mutex_resolv); 525 524 526 host_name = NULL; 525 526 SH_MUTEX_LOCK(mutex_resolv);527 527 528 528 host_entry = sh_gethostbyname(address); -
trunk/src/sh_unix.c
r169 r170 356 356 extern int OnlyStderr; 357 357 358 int safe_logger (int signal, int method, char * details)358 int safe_logger (int thesignal, int method, char * details) 359 359 { 360 360 unsigned int i = 0; … … 396 396 if (p && *p) 397 397 sl_strlcat(msg, p, 128); 398 if ( signal == 0)398 if (thesignal == 0) 399 399 { 400 400 if (details == NULL) { … … 408 408 { 409 409 sl_strlcat(msg, _("]: exit on signal "), 128); 410 p = safe_itoa( signal, str, 128);410 p = safe_itoa(thesignal, str, 128); 411 411 if (p && *p) 412 412 sl_strlcat(msg, p, 128); … … 461 461 } 462 462 463 void safe_fatal (c har * details,464 c har * file, int line)463 void safe_fatal (const char * details, 464 const char * file, int line) 465 465 { 466 466 char msg[128]; 467 467 char str[128]; 468 468 char * p; 469 int signal = 0;469 int thesignal = 0; 470 470 int method = 0; 471 471 … … 479 479 } 480 480 sl_strlcat(msg, details, 128); 481 (void) safe_logger ( signal, method, msg);481 (void) safe_logger (thesignal, method, msg); 482 482 _exit(EXIT_FAILURE); 483 483 } … … 1060 1060 } 1061 1061 1062 extern uid_t sl_trust_baduid( );1063 extern gid_t sl_trust_badgid( );1062 extern uid_t sl_trust_baduid(void); 1063 extern gid_t sl_trust_badgid(void); 1064 1064 1065 1065 #if defined(HOST_IS_CYGWIN) || defined(__cygwin__) || defined(__CYGWIN32__) || defined(__CYGWIN__) … … 1562 1562 struct hostent * he1; 1563 1563 int i; 1564 int ddot = 0;1564 int ddot; 1565 1565 int len; 1566 1566 char * p; … … 1632 1632 */ 1633 1633 len = sl_strlen(sh.host.name); 1634 ddot = 0; 1634 1635 for (i = 0; i < len; ++i) 1635 1636 if (sh.host.name[i] == '.') ++ddot; … … 1660 1661 struct hostent * he1; 1661 1662 int i; 1662 int ddot = 0;1663 int ddot; 1663 1664 int len; 1664 1665 char hostname[1024]; … … 1691 1692 */ 1692 1693 len = sl_strlen(sh.host.name); 1694 ddot = 0; 1693 1695 for (i = 0; i < len; ++i) 1694 1696 if (sh.host.name[i] == '.') ++ddot; … … 1772 1774 } 1773 1775 1774 int sh_unix_chroot( )1776 int sh_unix_chroot(void) 1775 1777 { 1776 1778 int status; … … 1794 1796 /* #ifdef SH_WITH_SERVER */ 1795 1797 #else 1796 int sh_unix_chroot( ) { return 0; }1798 int sh_unix_chroot(void) { return 0; } 1797 1799 #endif 1798 1800 … … 1850 1852 pid_t oldpid = getpid(); 1851 1853 #if defined(SH_WITH_SERVER) 1852 extern int sh_socket_open_int ( );1854 extern int sh_socket_open_int (void); 1853 1855 #endif 1854 1856 char errbuf[SH_ERRBUF_SIZE]; … … 3411 3413 UINT64 length_nolim = TIGER_NOLIM; 3412 3414 3413 if ( (theFile->check_mask & MODI_TXT) != 0&& fbuf.st_size < (10 * SH_TXT_MAX))3415 if (MODI_TXT_ENABLED(theFile->check_mask) && fbuf.st_size < (10 * SH_TXT_MAX)) 3414 3416 { 3415 3417 sl_init_content (rval_open, fbuf.st_size); … … 3464 3466 UINT64 length_nolim = TIGER_NOLIM; 3465 3467 3466 if ( (theFile->check_mask & MODI_TXT) != 0&& fbuf.st_size < (10 * SH_TXT_MAX))3468 if (MODI_TXT_ENABLED(theFile->check_mask) && fbuf.st_size < (10 * SH_TXT_MAX)) 3467 3469 { 3468 3470 sl_init_content (rval_open, fbuf.st_size); … … 4301 4303 SH_MUTEX_STATIC(mutex_mlock,PTHREAD_MUTEX_INITIALIZER); 4302 4304 4303 int sh_unix_mlock (c har * file, int line, void * in_addr, size_t len)4305 int sh_unix_mlock (const char * file, int line, void * in_addr, size_t len) 4304 4306 { 4305 4307 int num_pages; -
trunk/src/sh_utils.c
r167 r170 313 313 char * sh_util_strsep (char **str, const char *delim) 314 314 { 315 char *ret, *c, *d; 315 char *ret, *c; 316 const char *d; 316 317 317 318 SL_ENTER(_("sh_util_strsep")); … … 321 322 322 323 for (c = *str; *c != '\0'; c++) { 323 for (d = (char *)delim; *d != '\0'; d++) {324 for (d = delim; *d != '\0'; d++) { 324 325 if (*c == *d) { 325 326 *c = '\0'; … … 1476 1477 1477 1478 for (i = 0; i < 6; ++i) 1478 bufy[i] = taus_get( &(skey->rng0[0]), &(skey->rng1[0]), &(skey->rng2[0]));1479 bufy[i] = taus_get(); 1479 1480 1480 1481 p = sh_tiger_hash ((char *) bufy, TIGER_DATA, … … 1508 1509 const int sh_val_utf8_4 = 4; 1509 1510 1510 size_t len = strlen((c har *)str);1511 size_t len = strlen((const char *)str); 1511 1512 size_t l = 0; 1512 1513 int typ = 0; … … 2102 2103 { 2103 2104 if (lin == 0) 2104 lin = strlen((c har *)instr);2105 lin = strlen((const char *)instr); 2105 2106 2106 2107 do { … … 2149 2150 2150 2151 *out = SH_ALLOC(outlen); 2151 return sh_util_base64_enc((unsigned char *)*out, ( unsigned char *)in, inlen);2152 return sh_util_base64_enc((unsigned char *)*out, (const unsigned char *)in, inlen); 2152 2153 } 2153 2154 … … 2164 2165 { 2165 2166 if (lin == 0) 2166 lin = strlen((c har *)in);2167 lin = strlen((const char *)in); 2167 2168 2168 2169 for (i = 0; i < lin; i++) … … 2189 2190 else if (c == ')' || c == '/') 2190 2191 { 2191 b = 6 4;2192 b = 63; 2192 2193 } 2193 2194 else if (c == '?' || c == '=') -
trunk/src/sh_utmp.c
r154 r170 472 472 *************/ 473 473 474 static int sh_utmp_init_internal ( )474 static int sh_utmp_init_internal (void) 475 475 { 476 476 … … 516 516 *************/ 517 517 #ifdef HAVE_UTTYPE 518 static int sh_utmp_login_clean( );518 static int sh_utmp_login_clean(void); 519 519 #endif 520 520 … … 633 633 int sh_utmp_set_login_timer (const char * c) 634 634 { 635 int retval = 0;636 635 long val; 637 636 … … 644 643 _("utmp timer"), c); 645 644 SH_MUTEX_UNLOCK(mutex_thread_nolog); 646 retval = -1; 647 } 648 649 val = (val <= 0 ? 60 : val); 645 SL_RETURN((-1), _("sh_utmp_set_login_timer")); 646 } 650 647 651 648 ShUtmpInterval = (time_t) val; … … 670 667 static struct login_ct * login_ct_list = NULL; 671 668 672 static int sh_utmp_login_clean( )669 static int sh_utmp_login_clean(void) 673 670 { 674 671 struct login_ct * list = login_ct_list; … … 776 773 * by longjmp' warning. And no, 'volatile' proved insufficient. 777 774 */ 778 void * sh_dummy_userold = NULL;779 void * sh_dummy_user = NULL;775 static void * sh_dummy_userold = NULL; 776 static void * sh_dummy_user = NULL; 780 777 781 778 … … 1063 1060 int error; 1064 1061 struct SH_UTMP_S * ut; 1065 unsigned long this_read = 0;1062 unsigned long this_read; 1066 1063 int val_retry; 1067 1064 … … 1123 1120 * we need to do this here 1124 1121 */ 1122 this_read = 0; 1123 1125 1124 if (mode < 2) 1126 1125 { -
trunk/src/slib.c
r169 r170 123 123 } 124 124 125 FILE * sl_tracefile_open(c har * file,char * mode)125 FILE * sl_tracefile_open(const char * file, const char * mode) 126 126 { 127 127 FILE * xp = NULL; … … 132 132 } 133 133 134 void sl_trace_in(c har * str,char * file, int line)134 void sl_trace_in(const char * str, const char * file, int line) 135 135 { 136 136 int i; … … 165 165 } 166 166 167 void sl_trace_out(c har * str,char * file, int line)167 void sl_trace_out(const char * str, const char * file, int line) 168 168 { 169 169 int i; … … 200 200 } 201 201 202 extern int sh_log_console (c har * msg);202 extern int sh_log_console (const char * msg); 203 203 204 204 static int dlogActive = 0; … … 215 215 * = 3 backtrace 216 216 */ 217 int dlog (int flag, c har * file, int line, const char *fmt, ...)217 int dlog (int flag, const char * file, int line, const char *fmt, ...) 218 218 { 219 219 va_list ap; … … 1496 1496 * Do nothing if not SUID. 1497 1497 */ 1498 int sl_policy_get_user(c har * user)1498 int sl_policy_get_user(const char * user) 1499 1499 { 1500 1500 SL_ENTER(_("sl_policy_get_user")); … … 2444 2444 2445 2445 2446 int sl_write (SL_TICKET ticket, void * msg_in, long nbytes)2446 int sl_write (SL_TICKET ticket, const void * msg_in, long nbytes) 2447 2447 { 2448 2448 long bytewritten; … … 2450 2450 int fd; 2451 2451 2452 c har * msg;2452 const char * msg; 2453 2453 2454 2454 SL_ENTER(_("sl_write")); … … 2461 2461 SL_IRETURN(fd, _("sl_write")); 2462 2462 2463 msg = (c har *) msg_in;2463 msg = (const char *) msg_in; 2464 2464 2465 2465 /* write … … 2485 2485 } 2486 2486 2487 int sl_write_line (SL_TICKET ticket, void * msg, long nbytes)2487 int sl_write_line (SL_TICKET ticket, const void * msg, long nbytes) 2488 2488 { 2489 2489 int status; … … 2582 2582 2583 2583 2584 char * sl_trust_errfile( )2584 char * sl_trust_errfile(void) 2585 2585 { 2586 2586 return &tf_path[0]; … … 2588 2588 2589 2589 extern uid_t tf_baduid; 2590 uid_t sl_trust_baduid( )2590 uid_t sl_trust_baduid(void) 2591 2591 { 2592 2592 return tf_baduid; … … 2594 2594 2595 2595 extern gid_t tf_badgid; 2596 gid_t sl_trust_badgid( )2596 gid_t sl_trust_badgid(void) 2597 2597 { 2598 2598 return tf_badgid; … … 2602 2602 static int trust_count = 0; 2603 2603 2604 int sl_trust_purge_user ( )2604 int sl_trust_purge_user (void) 2605 2605 { 2606 2606 int i; -
trunk/src/trustfile.c
r137 r170 781 781 register int lsym; /* num chars in symlink ref */ 782 782 register int i; /* trustworthy or not? */ 783 const char * t_const; 783 784 784 785 /* … … 821 822 /* smack on the /../ 822 823 */ 823 t = "/../";824 t_const = "/../"; 824 825 while(*t && b < &full[MAXFILENAME]) 825 *b++ = *t ++;826 *b++ = *t_const++; 826 827 827 828 /* append the symlink referent
Note:
See TracChangeset
for help on using the changeset viewer.