Changeset 144
- Timestamp:
- Oct 31, 2007, 11:33:13 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r143 r144 1680 1680 exepack_mkdata.o: $(srcsrc)/exepack_mkdata.c Makefile config.h $(srcinc)/minilzo.h 1681 1681 minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h 1682 slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_ mem.h1682 slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h 1683 1683 rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h 1684 1684 rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-api-fst.h -
trunk/aclocal.m4
r139 r144 1783 1783 fi 1784 1784 1785 # Solaris lossage: default is obsolete semantics for getpwnam_r, 1786 # getpwuid_r, getgrgid_r, unless _POSIX_PTHREAD_SEMANTICS is defined 1785 1787 AC_MSG_CHECKING([if more special flags are required for pthreads]) 1786 1788 flag=no 1787 1789 case "${host_cpu}-${host_os}" in 1788 1790 *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; 1789 *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; 1791 *-osf* | *-hpux*) flag="-D_REENTRANT";; 1792 *solaris*) flag="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; 1790 1793 esac 1791 1794 AC_MSG_RESULT(${flag}) -
trunk/depend.dep
r143 r144 46 46 exepack_mkdata.o: $(srcsrc)/exepack_mkdata.c Makefile config.h $(srcinc)/minilzo.h 47 47 minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h 48 slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_ mem.h48 slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h 49 49 rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h 50 50 rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-api-fst.h -
trunk/depend.sum
r143 r144 1 2519500817 1 786796559 -
trunk/docs/Changelog
r138 r144 8 8 * use thread-specific conversion buffer for globber() 9 9 * fixed compile problems and problems with test suite 10 11 2.3.8: 10 * modify login watch to run as thread 11 * modify process check to run as thread 12 13 2.3.8 (03-10-2007): 12 14 * new option PortCheckIgnore = interface:portlist 13 15 -
trunk/src/samhain.c
r143 r144 799 799 static pid_t * procdirSamhain () 800 800 { 801 pid_t * pidlist = malloc(sizeof(pid_t) * 65535); 801 volatile pid_t * pidlist = malloc(sizeof(pid_t) * 65535); 802 pid_t * dummy; 802 803 struct dirent * d; 803 804 DIR * dp; … … 817 818 if (0 != stat(SH_INSTALL_PATH, &buf)) 818 819 { 819 free(pidlist); 820 dummy = pidlist; 821 free(dummy); 820 822 return NULL; 821 823 } … … 825 827 if (NULL == (dp = opendir("/proc"))) 826 828 { 827 free(pidlist); 829 dummy = pidlist; 830 free(dummy); 828 831 return NULL; 829 832 } … … 1193 1196 float st_1, st_2; 1194 1197 int status; 1195 long cct = 0; /* main loop iterations */1196 1197 int flag_check_1 = 0;1198 int flag_check_2 = 0;1198 volatile long cct = 0; /* main loop iterations */ 1199 1200 volatile int flag_check_1 = 0; 1201 volatile int flag_check_2 = 0; 1199 1202 1200 1203 int check_done = 0; 1201 1204 #endif 1202 1205 1203 time_t told;1206 volatile time_t told; 1204 1207 time_t tcurrent; 1205 1208 size_t tzlen; -
trunk/src/sh_cat.c
r113 r144 125 125 126 126 #ifdef SH_USE_PROCESSCHECK 127 { MSG_PCK_CHECK, SH_ERR_ NOTICE,RUN, N_("msg=\"Checking processes in pid interval [%ld,%ld]\"")},127 { MSG_PCK_CHECK, SH_ERR_INFO, RUN, N_("msg=\"Checking processes in pid interval [%ld,%ld]\"")}, 128 128 { MSG_PCK_OK, SH_ERR_ALL, RUN, N_("msg=\"PID %ld found with tests %s\"")}, 129 129 { MSG_PCK_P_HIDDEN,SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY [Process] Hidden pid: %ld tests: %s\" path=\"%s\" userid=\"%s\"")}, … … 138 138 139 139 #ifdef SH_USE_MOUNTS 140 { MSG_MNT_CHECK, SH_ERR_ NOTICE,RUN, N_("msg=\"Checking mounts\"")},140 { MSG_MNT_CHECK, SH_ERR_INFO, RUN, N_("msg=\"Checking mounts\"")}, 141 141 { MSG_MNT_MEMLIST, SH_ERR_ERR, RUN, N_("msg=\"Cannot read mount list from memory\"")}, 142 142 { MSG_MNT_MNTMISS, SH_ERR_WARN, EVENT, N_("msg=\"Mount missing\" path=\"%s\"")}, … … 440 440 441 441 #ifdef SH_USE_PROCESSCHECK 442 { MSG_PCK_CHECK, SH_ERR_ NOTICE,RUN, N_("msg=<Checking processes in pid interval [%ld,%ld]>")},442 { MSG_PCK_CHECK, SH_ERR_INFO, RUN, N_("msg=<Checking processes in pid interval [%ld,%ld]>")}, 443 443 { MSG_PCK_OK, SH_ERR_ALL, RUN, N_("msg=<PID %ld found with tests %s>")}, 444 444 { MSG_PCK_P_HIDDEN,SH_ERR_SEVERE, EVENT, N_("msg=<POLICY [Process] Hidden pid: %ld tests: %s> path=<%s> userid=<%s>")}, -
trunk/src/sh_error.c
r142 r144 20 20 #include "config_xor.h" 21 21 22 /* Required on linux to get the correct strerror_r function. Also 23 * for recursive mutexes (_XOPEN_SOURCE >= 500). 24 */ 22 /* Required on Linux to get the correct strerror_r function. Also 23 * for recursive mutexes (_XOPEN_SOURCE >= 500). Gives funny error 24 * on Solaris 10/gcc ('c99' compiler required - huh? Isn't gcc 25 * good enough?). 26 */ 27 #if !defined(__sun__) && !defined(__sun) 25 28 #define _XOPEN_SOURCE 600 29 #endif 26 30 #include <string.h> 27 31 #include <stdio.h> … … 1318 1322 1319 1323 exit_here: 1320 1324 ; /* label at end of compound statement */ 1321 1325 SH_MUTEX_RECURSIVE_UNLOCK(mutex_err_handle); 1322 1326 -
trunk/src/sh_mem.c
r143 r144 185 185 } 186 186 out: 187 ; /* label at end of compound statement */ 187 188 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 188 189 SL_RET0(_("sh_mem_stat")); … … 444 445 Mem_Current -= size; 445 446 out: 447 ; /* label at end of compound statement */ 446 448 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 447 449 SL_RET0(_("sh_mem_free")); -
trunk/src/sh_processcheck.c
r143 r144 689 689 struct stat buf; 690 690 DIR * dir; 691 int retval; 691 692 #ifdef HAVE_STATVFS 692 int retval;693 693 struct statvfs vfsbuf; 694 694 #endif … … 753 753 sl_snprintf (path, sizeof(path), "/proc/%ld", (unsigned long) pid); 754 754 755 if (0 == retry_lstat (FIL__, __LINE__, path, &buf)) 755 do { 756 retval = lstat (path, &buf); 757 } while (retval < 0 && errno == EINTR); 758 759 if (0 == retval) 756 760 { 757 761 res |= SH_PR_LSTAT; res |= SH_PR_ANY; ++have_checks; … … 782 786 { 783 787 res |= SH_PR_CHDIR; res |= SH_PR_ANY; ++have_checks; 784 retry_aud_chdir(FIL__, __LINE__, "/"); 788 do { 789 retval = chdir ("/"); 790 } while (retval < 0 && errno == EINTR); 785 791 } 786 792 ++need_checks; … … 1215 1221 return SH_MOD_FAILED; 1216 1222 #ifdef HAVE_PTHREAD 1217 if (arg != NULL && arg->initval < 0 && sh.flag.isdaemon == S_TRUE) 1223 if (arg != NULL && arg->initval < 0 && 1224 (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE)) 1218 1225 { 1219 1226 if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg)) … … 1307 1314 userdef_maxpid = 0; 1308 1315 sh_prochk_maxpid = 0x8000; 1309 sh_prochk_minpid = 0x000 0;1316 sh_prochk_minpid = 0x0001; 1310 1317 sh_prochk_interval = SH_PROCHK_INTERVAL; 1311 1318 -
trunk/src/sh_utmp.c
r143 r144 495 495 return SH_MOD_FAILED; 496 496 #ifdef HAVE_PTHREAD 497 if (arg != NULL && arg->initval < 0 && sh.flag.isdaemon == S_TRUE) 497 if (arg != NULL && arg->initval < 0 && 498 (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE)) 498 499 { 499 500 if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg)) -
trunk/src/slib.c
r137 r144 55 55 #define SH_NEED_PWD_GRP 1 56 56 #include "sh_static.h" 57 #include "sh_pthread.h" 57 58 58 59 #undef FIL__ … … 1514 1515 static SL_OFILE * ofiles[MAXFD]; 1515 1516 1517 SH_MUTEX_STATIC(mutex_ticket, PTHREAD_MUTEX_INITIALIZER); 1516 1518 1517 1519 static unsigned int nonce_counter = TOFFSET; … … 1522 1524 unsigned int high; /* index */ 1523 1525 unsigned int low; /* nonce */ 1526 SL_TICKET retval = SL_EINTERNAL; 1524 1527 1525 1528 SL_ENTER(_("sl_create_ticket")); 1526 1529 1527 if (myindex >= MAXFD) 1528 SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket"));1530 if (myindex >= MAXFD) 1531 goto out_ticket; 1529 1532 1530 1533 /* mask out the high bit and check that it is not used … … 1534 1537 1535 1538 if (high != myindex + TOFFSET) 1536 SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket")); 1539 goto out_ticket; 1540 1541 SH_MUTEX_LOCK_UNSAFE(mutex_ticket); 1537 1542 1538 1543 low = nonce_counter & 0xffff; … … 1541 1546 */ 1542 1547 if ((low != nonce_counter++) || low == 0) 1543 SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket"));1548 goto out_ticket; 1544 1549 1545 1550 /* Wrap around the nonce counter. … … 1549 1554 nonce_counter = TOFFSET; 1550 1555 1551 SL_RETURN ((SL_TICKET) ((high << 16) | low), _("sl_create_ticket")); 1556 retval = (SL_TICKET) ((high << 16) | low); 1557 1558 out_ticket: 1559 ; 1560 1561 SH_MUTEX_UNLOCK_UNSAFE(mutex_ticket); 1562 SL_RETURN (retval, _("sl_create_ticket")); 1552 1563 } 1553 1564
Note:
See TracChangeset
for help on using the changeset viewer.