- Timestamp:
- Oct 26, 2008, 12:59:48 PM (16 years ago)
- Location:
- trunk/src
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_cat.c
r180 r183 97 97 #ifdef SH_USE_KERN 98 98 /* FreeBSD */ 99 { MSG_KERN_POLICY, SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY KERNELBSD syscall table: new: %#lx old: %#lx\" syscall=\"%03d %s\"") },100 { MSG_KERN_POL_CO, SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY KERNELBSD syscall code: new: %#x,%#x old: %#x,%#x\" syscall=\"%03d %s\"") },99 { MSG_KERN_POLICY, SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY [Kernel] BSD syscall table: new: %#lx old: %#lx\" syscall=\"%03d %s\"") }, 100 { MSG_KERN_POL_CO, SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY [Kernel] BSD syscall code: new: %#x,%#x old: %#x,%#x\" syscall=\"%03d %s\"") }, 101 101 102 102 /* Linux */ … … 143 143 { MSG_MNT_CHECK, SH_ERR_INFO, RUN, N_("msg=\"Checking mounts\"")}, 144 144 { MSG_MNT_MEMLIST, SH_ERR_ERR, RUN, N_("msg=\"Cannot read mount list from memory\"")}, 145 { MSG_MNT_MNTMISS, SH_ERR_WARN, EVENT, N_("msg=\" Mount missing\" path=\"%s\"")},146 { MSG_MNT_OPTMISS, SH_ERR_WARN, EVENT, N_("msg=\" Mount option missing\" path=\"%s\" option=\"%s\"")},145 { MSG_MNT_MNTMISS, SH_ERR_WARN, EVENT, N_("msg=\"POLICY [Mounts] Mount missing\" path=\"%s\"")}, 146 { MSG_MNT_OPTMISS, SH_ERR_WARN, EVENT, N_("msg=\"POLICY [Mounts] Mount option missing\" path=\"%s\" option=\"%s\"")}, 147 147 #endif 148 148 149 149 #ifdef SH_USE_USERFILES 150 150 { MSG_USERFILES_SUMMARY,SH_ERR_INFO, RUN, N_("msg=\"Checked for users files\"") }, 151 #endif 152 153 #ifdef USE_LOGFILE_MONITOR 154 { MSG_LOGMON_CHKS, SH_ERR_INFO, RUN, N_("msg=\"Checking logfile %s\"") }, 155 { MSG_LOGMON_CHKE, SH_ERR_INFO, RUN, N_("msg=\"Finished logfile %s, %lu new records processed\"") }, 156 { MSG_LOGMON_MISS, SH_ERR_ERR, RUN, N_("msg=\"Missing logfile %s\"") }, 157 { MSG_LOGMON_EOPEN,SH_ERR_ERR, RUN, N_("msg=\"Cannot open logfile %s\"") }, 158 { MSG_LOGMON_EREAD,SH_ERR_ERR, RUN, N_("msg=\"Error while reading logfile %s\"") }, 159 { MSG_LOGMON_REP, SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY [Logfile] %s\" time=\"%s\" host=\"%s\" path=\"%s\"") }, 160 { MSG_LOGMON_SUM, SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY [Logfile] %s\" host=\"%s\" path=\"%s\"") }, 151 161 #endif 152 162 … … 413 423 414 424 #ifdef SH_USE_KERN 415 { MSG_KERN_POLICY, SH_ERR_SEVERE, EVENT, N_("msg=<POLICY KERNELBSD syscall table: new: %#lx old: %#lx>, syscall=<%03d %s>") },416 { MSG_KERN_POL_CO, SH_ERR_SEVERE, EVENT, N_("msg=<POLICY KERNELBSD syscall code: new: %#x,%#x old: %#x,%#x>, syscall=<%03d %s>") },425 { MSG_KERN_POLICY, SH_ERR_SEVERE, EVENT, N_("msg=<POLICY [Kernel] BSD syscall table: new: %#lx old: %#lx>, syscall=<%03d %s>") }, 426 { MSG_KERN_POL_CO, SH_ERR_SEVERE, EVENT, N_("msg=<POLICY [Kernel] BSD syscall code: new: %#x,%#x old: %#x,%#x>, syscall=<%03d %s>") }, 417 427 418 428 { MSG_KERN_SYSCALL,SH_ERR_SEVERE, EVENT, N_("msg=<POLICY [Kernel] SYSCALL modified> syscall=<%03d %s>, %s") }, … … 461 471 { MSG_MNT_CHECK, SH_ERR_INFO, RUN, N_("msg=<Checking mounts>")}, 462 472 { MSG_MNT_MEMLIST, SH_ERR_ERR, RUN, N_("msg=<Cannot read mount list from memory>")}, 463 { MSG_MNT_MNTMISS, SH_ERR_WARN, EVENT, N_("msg=< Mount missing>, path=<%s>")},464 { MSG_MNT_OPTMISS, SH_ERR_WARN, EVENT, N_("msg=< Mount option missing>, path=<%s>, option=<%s>")},473 { MSG_MNT_MNTMISS, SH_ERR_WARN, EVENT, N_("msg=<POLICY [Mounts] Mount missing>, path=<%s>")}, 474 { MSG_MNT_OPTMISS, SH_ERR_WARN, EVENT, N_("msg=<POLICY [Mounts] Mount option missing>, path=<%s>, option=<%s>")}, 465 475 #endif 466 476 467 477 #ifdef SH_USE_USERFILES 468 478 { MSG_USERFILES_SUMMARY,SH_ERR_INFO, RUN, N_("msg=<Checked for users files>") }, 479 #endif 480 481 #ifdef USE_LOGFILE_MONITOR 482 { MSG_LOGMON_CHKS, SH_ERR_INFO, RUN, N_("msg=<Checking logfile %s>") }, 483 { MSG_LOGMON_CHKE, SH_ERR_INFO, RUN, N_("msg=<Finished logfile %s, %lu new records processed>") }, 484 { MSG_LOGMON_MISS, SH_ERR_ERR, RUN, N_("msg=<Missing logfile %s>") }, 485 { MSG_LOGMON_EOPEN,SH_ERR_ERR, RUN, N_("msg=<Cannot open logfile %s>") }, 486 { MSG_LOGMON_EREAD,SH_ERR_ERR, RUN, N_("msg=<Error while reading logfile %s>") }, 487 { MSG_LOGMON_REP, SH_ERR_SEVERE, EVENT, N_("msg=<POLICY [Logfile] %s> time=<%s> host=<%s> path=<%s>") }, 488 { MSG_LOGMON_SUM, SH_ERR_SEVERE, EVENT, N_("msg=<POLICY [Logfile] %s> host=<%s> path=<%s>") }, 469 489 #endif 470 490 -
trunk/src/sh_getopt.c
r182 r183 535 535 if (num > 0) fputc (',', stdout); 536 536 fputs (_(" ports"), stdout); ++num; 537 #endif 538 #ifdef USE_LOGFILE_MONITOR 539 if (num > 0) fputc (',', stdout); 540 fputs (_(" logfile monitor"), stdout); ++num; 537 541 #endif 538 542 if (num == 0) -
trunk/src/sh_modules.c
r149 r183 16 16 #include "sh_processcheck.h" 17 17 #include "sh_portcheck.h" 18 #include "sh_logmon.h" 18 19 19 20 sh_mtype modList[] = { … … 130 131 #endif 131 132 133 #ifdef USE_LOGFILE_MONITOR 134 { 135 N_("LOGMON"), 136 -1, 137 sh_log_check_init, 138 sh_log_check_timer, 139 sh_log_check_check, 140 sh_log_check_cleanup, 141 sh_log_check_reconf, 142 143 N_("[LogMon]"), 144 sh_log_check_table, 145 PTHREAD_MUTEX_INITIALIZER, 146 }, 147 #endif 148 132 149 { 133 150 NULL, -
trunk/src/sh_processcheck.c
r170 r183 1311 1311 clean_list (&list_fake); 1312 1312 } 1313 1313 1314 SH_MUTEX_UNLOCK(mutex_proc_check); 1314 1315 -
trunk/src/sh_string.c
r171 r183 108 108 109 109 setnext: 110 lengths[i] = ( a-s);110 lengths[i] = (size_t) (a-s); /* a >= s always */ 111 111 arr[i] = s; 112 112 ++i; … … 184 184 } 185 185 } 186 lengths[i] = ( a-s);186 lengths[i] = (size_t)(a-s); /* a >= s always */ 187 187 arr[i] = s; 188 188 ++i; … … 266 266 } 267 267 268 sh_string * sh_string_cat_lchar(sh_string * s, c har * str, size_t len)268 sh_string * sh_string_cat_lchar(sh_string * s, const char * str, size_t len) 269 269 { 270 270 if (sl_ok_adds(len, s->siz) == SL_TRUE) … … 283 283 } 284 284 285 sh_string * sh_string_set_from_char(sh_string * s, c har * str)285 sh_string * sh_string_set_from_char(sh_string * s, const char * str) 286 286 { 287 287 size_t len = strlen(str); … … 296 296 } 297 297 298 sh_string * sh_string_new_from_lchar(char * str, size_t len) 298 sh_string * sh_string_add_from_char(sh_string * s, const char * str) 299 { 300 size_t len = strlen(str); 301 size_t avail = (s->siz - s->len); 302 303 if ((len+1) > avail) 304 { 305 (void) sh_string_grow(s, ((len+1) - avail) ); 306 } 307 memcpy(&(s->str[s->len]), str, (len+1)); 308 s->len += len; 309 return s; 310 } 311 312 sh_string * sh_string_new_from_lchar(const char * str, size_t len) 299 313 { 300 314 sh_string * s; … … 308 322 } 309 323 310 sh_string * sh_string_new_from_lchar3(c har * str1, size_t len1,311 c har * str2, size_t len2,312 c har * str3, size_t len3)324 sh_string * sh_string_new_from_lchar3(const char * str1, size_t len1, 325 const char * str2, size_t len2, 326 const char * str3, size_t len3) 313 327 { 314 328 sh_string * s; -
trunk/src/sh_unix.c
r175 r183 1064 1064 1065 1065 #if defined(HOST_IS_CYGWIN) || defined(__cygwin__) || defined(__CYGWIN32__) || defined(__CYGWIN__) 1066 int tf_trust_check (c har * file, int mode)1066 int tf_trust_check (const char * file, int mode) 1067 1067 { 1068 1068 (void) file; … … 1071 1071 } 1072 1072 #else 1073 int tf_trust_check (c har * file, int mode)1073 int tf_trust_check (const char * file, int mode) 1074 1074 { 1075 1075 char * tmp; -
trunk/src/slib.c
r174 r183 2652 2652 static struct sl_trustfile_store * sl_trusted_files = NULL; 2653 2653 2654 void sl_add_trusted_file(char * filename, uid_t teuid)2654 static void sl_add_trusted_file(const char * filename, uid_t teuid) 2655 2655 { 2656 2656 struct sl_trustfile_store *new = SH_ALLOC(sizeof(struct sl_trustfile_store)); … … 2664 2664 } 2665 2665 2666 char * sl_check_trusted_file(char * filename, uid_t teuid)2666 static const char * sl_check_trusted_file(const char * filename, uid_t teuid) 2667 2667 { 2668 2668 struct sl_trustfile_store *new = sl_trusted_files; … … 2678 2678 } 2679 2679 2680 void sl_clear_trusted_file(struct sl_trustfile_store * file)2680 static void sl_clear_trusted_file(struct sl_trustfile_store * file) 2681 2681 { 2682 2682 if (file) … … 2690 2690 } 2691 2691 2692 int sl_trustfile_euid(c har * filename, uid_t teuid)2692 int sl_trustfile_euid(const char * filename, uid_t teuid) 2693 2693 { 2694 2694 long status; -
trunk/src/trustfile.c
r171 r183 319 319 320 320 /* not static to circumvent stupid gcc 4 bug */ 321 int getfname(c har *fname, char *rbuf, int rsz)321 int getfname(const char *fname, char *rbuf, int rsz) 322 322 { 323 323 #ifndef TRUST_MAIN … … 678 678 } 679 679 680 int sl_trustfile(c har *fname, uid_t *okusers, uid_t *badusers)680 int sl_trustfile(const char *fname, uid_t *okusers, uid_t *badusers) 681 681 { 682 682 char fexp[MAXFILENAME]; /* file name fully expanded */
Note:
See TracChangeset
for help on using the changeset viewer.