Changeset 138
- Timestamp:
- Oct 28, 2007, 4:55:19 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r126 r138 117 117 rijndael-boxes-fst.h sh_socket.h sh_ignore.h sh_prelude.h \ 118 118 sh_mounts.h sh_userfiles.h sh_static.h sh_prelink.h \ 119 sh_processcheck.h sh_portcheck.h 119 sh_processcheck.h sh_portcheck.h sh_pthread.h 120 120 121 121 … … 150 150 $(srcsrc)/sh_prelink.c $(srcsrc)/sh_static.c \ 151 151 $(srcsrc)/sh_portcheck.c \ 152 $(srcsrc)/sh_processcheck.c $(srcsrc)/sh_prelude_old.c 152 $(srcsrc)/sh_processcheck.c $(srcsrc)/sh_prelude_old.c \ 153 $(srcsrc)/sh_pthread.c 153 154 154 155 OBJECTS = sh_files.o sh_tiger0.o sh_tiger2.o sh_tiger2_64.o \ … … 163 164 zAVLTree.o sh_socket.o sh_ignore.o sh_prelude.o \ 164 165 sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o \ 165 sh_processcheck.o sh_portcheck.o sh_prelude_old.o 166 sh_processcheck.o sh_portcheck.o sh_prelude_old.o \ 167 sh_pthread.o 166 168 167 169 KERN = kern_head.h kern_head.c … … 1633 1635 1634 1636 1635 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ files.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h1636 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_ static.h $(srcinc)/sh_prelude.h $(srcinc)/sh_ignore.h1637 sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h 1637 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h 1638 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/sh_ignore.h 1639 sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h 1638 1640 sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h 1639 sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/zAVLTree.h1641 sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/zAVLTree.h 1640 1642 sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h 1641 1643 sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_database.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_files.h $(srcinc)/sh_mail.h $(srcinc)/sh_calls.h $(srcinc)/sh_tiger.h $(srcinc)/sh_forward.h $(srcinc)/sh_modules.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_extern.h $(srcinc)/sh_database.h $(srcinc)/sh_prelude.h 1642 sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 1644 sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h 1643 1645 sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h 1644 1646 sh_tiger2.o: $(srcsrc)/sh_tiger2.c Makefile config_xor.h … … 1646 1648 sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h 1647 1649 sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h 1648 sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_ static.h $(srcinc)/sh_tools.h1649 sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h 1650 sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_ static.h1650 sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 1651 sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h 1652 sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 1651 1653 sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_mail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 1652 1654 sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h 1653 1655 sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h 1654 sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h1655 sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h1656 sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h 1657 sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h 1656 1658 sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h 1657 1659 sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h 1658 sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/ rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h1660 sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 1659 1661 sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 1660 1662 sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h … … 1673 1675 encode.o: $(srcsrc)/encode.c Makefile 1674 1676 sstrip.o: $(srcsrc)/sstrip.c Makefile config.h 1675 trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h 1677 trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 1676 1678 exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data 1677 1679 exepack_fill.o: $(srcsrc)/exepack_fill.c Makefile config.h config.h $(srcinc)/minilzo.h … … 1686 1688 yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h 1687 1689 sh_mounts.o: $(srcsrc)/sh_mounts.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_mounts.h 1688 sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h 1689 sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h 1690 sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 1691 sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 1690 1692 kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h 1691 1693 sh_prelink.o: $(srcsrc)/sh_prelink.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h 1692 sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h 1693 sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 1694 sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h $(srcinc)/sh_pthread.h 1695 sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 1694 1696 sh_async.o: $(srcsrc)/sh_async.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h 1695 1697 sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/CuTest.h 1696 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/CuTest.h 1698 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 1699 sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h -
trunk/aclocal.m4
r129 r138 1701 1701 ;; 1702 1702 1703 -pthread) 1704 AC_MSG_CHECKING([whether pthreads work with $flag]) 1705 PTHREAD_CFLAGS="$flag" 1706 PTHREAD_LDFLAGS="$flag" 1707 ;; 1708 1703 1709 -*) 1704 1710 AC_MSG_CHECKING([whether pthreads work with $flag]) … … 1721 1727 save_LIBS="$LIBS" 1722 1728 save_CFLAGS="$CFLAGS" 1729 save_LDFLAGS="$LDFLAGS" 1723 1730 LIBS="$PTHREAD_LIBS $LIBS" 1724 1731 CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 1732 LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS" 1725 1733 1726 1734 # Check for various functions. We must include pthread.h, … … 1740 1748 1741 1749 LIBS="$save_LIBS" 1750 LDFLAGS="$save_LDFLAGS" 1742 1751 CFLAGS="$save_CFLAGS" 1743 1752 … … 1749 1758 PTHREAD_LIBS="" 1750 1759 PTHREAD_CFLAGS="" 1760 PTHREAD_LDFLAGS="" 1751 1761 done 1752 1762 fi … … 1799 1809 AC_SUBST(PTHREAD_LIBS) 1800 1810 AC_SUBST(PTHREAD_CFLAGS) 1811 AC_SUBST(PTHREAD_LDFLAGS) 1801 1812 AC_SUBST(PTHREAD_CC) 1802 1813 -
trunk/configure.ac
r132 r138 800 800 ) 801 801 802 if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT;803 then804 ACX_PTHREAD805 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"806 LIBS="$PTHREAD_LIBS $LIBS"807 CC="$PTHREAD_CC"808 fi809 810 802 AC_SUBST(setpwd_prg) 811 803 AC_SUBST(yulectl_prg) … … 878 870 ) 879 871 872 if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT; 873 then 874 ACX_PTHREAD 875 CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 876 LIBS="$PTHREAD_LIBS $LIBS" 877 LDFLAGS="$PTHREAD_LDFLAGS $LDFLAGS" 878 CC="$PTHREAD_CC" 879 fi 880 880 881 # 881 882 # this is from the snort configure.in -
trunk/depend.dep
r111 r138 1 1 2 2 # DO NOT DELETE THIS LINE 3 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ files.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h4 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_ static.h $(srcinc)/sh_prelude.h $(srcinc)/sh_ignore.h5 sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h 3 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h 4 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/sh_ignore.h 5 sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h 6 6 sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h 7 sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/zAVLTree.h7 sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/zAVLTree.h 8 8 sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h 9 9 sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_database.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_files.h $(srcinc)/sh_mail.h $(srcinc)/sh_calls.h $(srcinc)/sh_tiger.h $(srcinc)/sh_forward.h $(srcinc)/sh_modules.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_extern.h $(srcinc)/sh_database.h $(srcinc)/sh_prelude.h 10 sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 10 sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h 11 11 sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h 12 12 sh_tiger2.o: $(srcsrc)/sh_tiger2.c Makefile config_xor.h … … 14 14 sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h 15 15 sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h 16 sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_ static.h $(srcinc)/sh_tools.h17 sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h 18 sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_ static.h16 sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 17 sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h 18 sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 19 19 sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_mail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 20 20 sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h 21 21 sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h 22 sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h23 sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_ utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h22 sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h 23 sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h 24 24 sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h 25 25 sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h 26 sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/ rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h26 sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 27 27 sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 28 28 sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h … … 41 41 encode.o: $(srcsrc)/encode.c Makefile 42 42 sstrip.o: $(srcsrc)/sstrip.c Makefile config.h 43 trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h 43 trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 44 44 exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data 45 45 exepack_fill.o: $(srcsrc)/exepack_fill.c Makefile config.h config.h $(srcinc)/minilzo.h … … 54 54 yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h 55 55 sh_mounts.o: $(srcsrc)/sh_mounts.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_mounts.h 56 sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h 57 sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h 56 sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 57 sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 58 58 sh_prelink.o: $(srcsrc)/sh_prelink.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h 59 sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h 60 sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 59 sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h $(srcinc)/sh_pthread.h 60 sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 61 61 kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h 62 62 sh_async.o: $(srcsrc)/sh_async.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h 63 63 sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/CuTest.h 64 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/CuTest.h 64 sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 65 sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h -
trunk/depend.sum
r111 r138 1 1096789008 1 754800869 -
trunk/docs/Changelog
r135 r138 5 5 * protect readdir(), getpwent(), gethostname() with mutexes 6 6 (readdir_r considered harmful) 7 * make checksum/hash, entropy functionreentrant7 * make checksum/hash, entropy, rng functions reentrant 8 8 * use thread-specific conversion buffer for globber() 9 * fixed compile problems and problems with test suite 9 10 10 11 2.3.8: -
trunk/include/samhain.h
r133 r138 43 43 #define SH_PATHBUF 256 44 44 45 #define SH_GRBUF_SIZE 409646 #define SH_PWBUF_SIZE 409647 45 #define SH_ERRBUF_SIZE 64 48 46 -
trunk/include/sh_files.h
r131 r138 30 30 void kill_sh_dirlist (struct sh_dirent * dirlist); 31 31 32 #ifdef NEED_ADD_DIRENT 32 33 /* add an entry to a directory listing 33 34 */ 34 35 struct sh_dirent * addto_sh_dirlist (struct dirent * thisEntry, 35 36 struct sh_dirent * dirlist); 37 #endif 38 36 39 /* register exceptions to hardlink check 37 40 */ -
trunk/include/sh_pthread.h
r134 r138 5 5 6 6 #include <pthread.h> 7 7 8 #define SH_MUTEX(M) pthread_mutex_t M 8 9 #define SH_MUTEX_INIT(M,I) pthread_mutex_t M = I … … 10 11 #define SH_MUTEX_EXTERN(M) extern pthread_mutex_t M 11 12 13 /* pthread_mutex_unlock() has the wrong type (returns int), so 14 * we need to wrap it in this function. 15 */ 16 extern void sh_pthread_mutex_unlock (void *arg); 17 12 18 #define SH_MUTEX_LOCK(M) \ 13 19 do { \ 14 20 int oldtype; \ 15 21 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); \ 16 pthread_cleanup_push( pthread_mutex_unlock, (void *) &(M));\22 pthread_cleanup_push(sh_pthread_mutex_unlock, (void*)&(M));\ 17 23 pthread_mutex_lock(&(M)) 18 24 19 25 20 #define SH_MUTEX_UNLOCK(M ,C) \26 #define SH_MUTEX_UNLOCK(M) \ 21 27 pthread_cleanup_pop(1); \ 22 28 pthread_setcanceltype(oldtype, NULL); \ … … 26 32 #define SH_MUTEX_UNLOCK_UNSAFE(M) pthread_mutex_unlock(&(M)) 27 33 34 35 /* 36 * ---- Recursive mutex ---- 37 */ 38 #if defined(PTHREAD_MUTEX_RECURSIVE) 39 40 /* On GNU C, it's an enum, thus the alternative implementation 41 * below is used. 42 */ 43 #define SH_MUTEX_RECURSIVE(M) \ 44 static pthread_mutex_t M; \ 45 static void M ## _init (void) \ 46 { \ 47 pthread_mutexattr_t mta; \ 48 pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE); \ 49 pthread_mutex_init(&(M), &mta); \ 50 pthread_mutexattr_destroy(&mta); \ 51 return; \ 52 } \ 53 static pthread_once_t M ## _initialized = PTHREAD_ONCE_INIT 54 55 #define SH_MUTEX_RECURSIVE_INIT(M) \ 56 (void) pthread_once(&(M ## _initialized), (M ## _init)) 57 58 #define SH_MUTEX_RECURSIVE_LOCK(M) \ 59 do { \ 60 int oldtype; \ 61 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); \ 62 pthread_cleanup_push(sh_pthread_mutex_unlock, (void*)&(M));\ 63 pthread_mutex_lock(&(M)) 64 65 #define SH_MUTEX_RECURSIVE_UNLOCK(M) \ 66 pthread_cleanup_pop(1); \ 67 pthread_setcanceltype(oldtype, NULL); \ 68 } while (0) 69 70 #else 71 /* !defined(PTHREAD_MUTEX_RECURSIVE) */ 72 struct sh_RMutex { 73 74 pthread_mutex_t lock; 75 unsigned int held; 76 unsigned int waiters; 77 pthread_t tid; 78 pthread_cond_t cv; 79 }; 80 81 void sh_RMutexLock(struct sh_RMutex * tok); 82 void sh_RMutexUnlock(void * arg); 83 void sh_InitRMutex(struct sh_RMutex * tok); 84 85 #define SH_MUTEX_RECURSIVE(M) \ 86 static struct sh_RMutex M; \ 87 static void M ## _init (void) \ 88 { \ 89 sh_InitRMutex(&(M)); \ 90 return; \ 91 } \ 92 static pthread_once_t M ## _initialized = PTHREAD_ONCE_INIT 93 94 #define SH_MUTEX_RECURSIVE_INIT(M) \ 95 (void) pthread_once(&(M ## _initialized), (M ## _init)) 96 97 #define SH_MUTEX_RECURSIVE_LOCK(M) \ 98 do { \ 99 int oldtype; \ 100 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); \ 101 pthread_cleanup_push(sh_RMutexUnlock, (void*)&(M)); \ 102 sh_RMutexLock(&(M)) 103 104 #define SH_MUTEX_RECURSIVE_UNLOCK(M) \ 105 pthread_cleanup_pop(1); \ 106 pthread_setcanceltype(oldtype, NULL); \ 107 } while (0) 108 109 #endif 28 110 /* 29 111 * ---- Global mutexes ---- … … 32 114 SH_MUTEX_EXTERN(mutex_resolv); 33 115 SH_MUTEX_EXTERN(mutex_pwent); 116 SH_MUTEX_EXTERN(mutex_readdir); 34 117 35 118 /* … … 49 132 #define SH_MUTEX_UNLOCK_UNSAFE(M) ((void)0) 50 133 134 #define SH_MUTEX_RECURSIVE(M) extern void *SH_MUTEX_DUMMY_ ## M 135 #define SH_MUTEX_RECURSIVE_INIT(M) ((void)0) 136 #define SH_MUTEX_RECURSIVE_LOCK(M) ((void)0) 137 #define SH_MUTEX_RECURSIVE_UNLOCK(M) ((void)0) 138 51 139 /* #ifdef HAVE_PTHREAD */ 52 140 #endif -
trunk/include/sh_tiger.h
r133 r138 9 9 typedef long int TigerType; 10 10 11 #define TIGER_FILE -1 ;12 #define TIGER_DATA -2 ;11 #define TIGER_FILE -1 12 #define TIGER_DATA -2 13 13 14 14 /**************** 15 typedef long int TigerType; 15 16 typedef enum { 16 17 TIGER_FILE, … … 24 25 /* the checksum function 25 26 */ 26 /*@owned@*/char * sh_tiger_hash (const char * filename, TigerType what,27 27 char * sh_tiger_hash (const char * filename, TigerType what, 28 UINT64 Length, char * out, size_t len); 28 29 29 30 /* NEW Thu Oct 18 19:59:08 CEST 2001 -
trunk/include/sh_utils.h
r132 r138 58 58 * generator. 59 59 */ 60 UINT32 taus_get ( void *state1, void *state2, void *state3);60 UINT32 taus_get (); 61 61 double taus_get_double (void *vstate); /* fast */ 62 62 int taus_seed (void); … … 85 85 */ 86 86 char * sh_util_siggen (char * hexkey, 87 char * text, size_t textlen); 87 char * text, size_t textlen, 88 char * sigbuf, size_t sigbuflen); 88 89 89 90 /* eval boolean input … … 112 113 int sh_util_obscure_ok (const char * str); 113 114 114 /* output a hexchar[2] 115 /* output a hexchar[2]; i2h must be char[2] 115 116 */ 116 char * sh_util_charhex( unsigned char c );117 char * sh_util_charhex( unsigned char c, char * i2h ); 117 118 118 119 /* read a hexchar, return int value (0-15) -
trunk/include/slib.h
r131 r138 60 60 #define SL_FALSE 0 61 61 62 #define SH_GRBUF_SIZE 4096 63 #define SH_PWBUF_SIZE 4096 62 64 63 65 -
trunk/src/sh_entropy.c
r135 r138 333 333 334 334 #ifdef NAME_OF_DEV_URANDOM 335 m_count = read_mbytes ( 30, NAME_OF_DEV_RANDOM, nbuf, nbytes);335 m_count = read_mbytes ( 1, NAME_OF_DEV_RANDOM, nbuf, nbytes); 336 336 #else 337 337 m_count = read_mbytes (300, NAME_OF_DEV_RANDOM, nbuf, nbytes); -
trunk/src/sh_err_log.c
r137 r138 947 947 log_msg.timestamp[0] = '\0'; 948 948 (void) sl_strlcpy (sigkey_new, 949 sh_tiger_hash (sigkey_old, TIGER_DATA, KEY_LEN, hashbuf, sizeof(hashbuf)), 949 sh_tiger_hash (sigkey_old, TIGER_DATA, KEY_LEN, 950 hashbuf, sizeof(hashbuf)), 950 951 KEY_LEN+1); 951 952 } … … 953 954 /* --- Sign the message with the signature key. --- 954 955 */ 955 sh_tiger_hash (log_msg.msg, -1, 10, hashbuf, 10);956 956 sh_tiger_hash (log_msg.msg, TIGER_DATA, 957 (unsigned long)(status + KEY_LEN), (char *) hashbuf, (size_t) sizeof(hashbuf)); 957 (unsigned long)(status + KEY_LEN), 958 (char *) hashbuf, (size_t) sizeof(hashbuf)); 958 959 959 960 (void) sl_strlcat (log_msg.msg, sigkey_new, (size_t)(status + KEY_LEN + 2)); 960 961 (void) sl_strlcpy (log_msg.signature, 961 962 sh_tiger_hash (log_msg.msg, (TigerType) TIGER_DATA, 962 (unsigned long)(status + KEY_LEN), hashbuf, sizeof(hashbuf)), 963 (unsigned long)(status + KEY_LEN), 964 hashbuf, sizeof(hashbuf)), 963 965 KEY_LEN+1); 964 966 (void) sl_strlcpy (sigkey_old, sigkey_new, KEY_LEN+1); -
trunk/src/sh_mem.c
r137 r138 20 20 #include "config_xor.h" 21 21 22 /* With glibc, _XOPEN_SOURCE 500 is required for23 * pthread_mutexattr_settype/PTHREAD_MUTEX_RECURSIVE24 */25 #if defined(HAVE_PTHREAD) && defined(MEM_DEBUG)26 #define _XOPEN_SOURCE 50027 #endif28 29 22 #include <stdio.h> 30 23 #include <stdlib.h> … … 111 104 112 105 #ifdef HAVE_PTHREAD 113 static pthread_once_t mem_is_initialized = PTHREAD_ONCE_INIT; 114 static pthread_mutex_t mutex_mem; 115 116 static void initialize_mem(void) 117 { 118 pthread_mutexattr_t mta; 119 pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE); 120 pthread_mutex_init(&mutex_mem, &mta); 121 pthread_mutexattr_destroy(&mta); 122 return; 123 } 124 #define MEM_MUTEX_INIT (void) pthread_once(&mem_is_initialized, initialize_mem) 106 107 SH_MUTEX_RECURSIVE(mutex_mem); 108 125 109 #else 126 110 #define MEM_MUTEX_INIT ((void)0) … … 135 119 FILE * fd; 136 120 137 MEM_MUTEX_INIT;138 SH_MUTEX_ LOCK(mutex_mem);121 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 122 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 139 123 140 124 fd = fopen(MEM_LOG, "w"); … … 146 130 } 147 131 fclose(fd); 148 SH_MUTEX_ UNLOCK(mutex_mem);132 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 149 133 return; 150 134 } … … 163 147 SL_ENTER(_("sh_mem_stat")); 164 148 165 MEM_MUTEX_INIT;166 SH_MUTEX_ LOCK(mutex_mem);149 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 150 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 167 151 168 152 if (Alloc_Count == Free_Count) … … 201 185 } 202 186 out: 203 SH_MUTEX_ UNLOCK(mutex_mem);187 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 204 188 SL_RET0(_("sh_mem_stat")); 205 189 } … … 212 196 SL_ENTER(_("sh_mem_check")); 213 197 214 MEM_MUTEX_INIT;215 SH_MUTEX_ LOCK(mutex_mem);198 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 199 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 216 200 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_MSTAMP, 217 201 Mem_Max, Mem_Current); … … 246 230 /* if (nerr > 0) abort(); */ 247 231 248 SH_MUTEX_ UNLOCK(mutex_mem);232 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 249 233 SL_RET0(_("sh_mem_check")); 250 234 } … … 258 242 SL_ENTER(_("sh_mem_malloc")); 259 243 260 MEM_MUTEX_INIT;261 SH_MUTEX_ LOCK(mutex_mem);244 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 245 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 262 246 the_realAddress = malloc(size + 2 * SH_MEMMULT); 263 247 … … 368 352 _exit(42); 369 353 } 370 371 /* make list entry */ 372 373 this->real_address = the_realAddress; 374 this->address = theAddress; 375 this->size = size; 376 this->line = line; 377 sl_strlcpy(this->file, file, 20); 378 379 this->next = memlist; 380 memlist = this; 381 382 SH_MUTEX_UNLOCK(mutex_mem); 354 else 355 { 356 /* make list entry */ 357 358 this->real_address = the_realAddress; 359 this->address = theAddress; 360 this->size = size; 361 this->line = line; 362 sl_strlcpy(this->file, file, 20); 363 364 this->next = memlist; 365 memlist = this; 366 } 367 368 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 383 369 SL_RETURN( theAddress, _("sh_mem_malloc")); 384 370 } … … 393 379 SL_ENTER(_("sh_mem_free")); 394 380 395 MEM_MUTEX_INIT;396 SH_MUTEX_ LOCK(mutex_mem);381 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 382 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 397 383 if ( a == NULL ) 398 384 { … … 466 452 Mem_Current -= size; 467 453 out: 468 SH_MUTEX_ UNLOCK(mutex_mem);454 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 469 455 SL_RET0(_("sh_mem_free")); 470 456 } -
trunk/src/sh_pthread.c
r136 r138 14 14 return; 15 15 } 16 17 18 /** 19 * libxml2 threads.c: set of generic threading related routines 20 * 21 * Gary Pennington <Gary.Pennington@uk.sun.com> 22 * daniel@veillard.com 23 */ 24 25 void sh_InitRMutex(struct sh_RMutex * tok) 26 { 27 pthread_mutex_init(&tok->lock, NULL); 28 tok->held = 0; 29 tok->waiters = 0; 30 pthread_cond_init(&tok->cv, NULL); 31 32 return; 33 } 34 35 void sh_RMutexLock(struct sh_RMutex * tok) 36 { 37 if (tok == NULL) 38 return; 39 40 pthread_mutex_lock(&tok->lock); 41 if (tok->held) { 42 if (pthread_equal(tok->tid, pthread_self())) { 43 tok->held++; 44 pthread_mutex_unlock(&tok->lock); 45 return; 46 } else { 47 tok->waiters++; 48 while (tok->held) 49 pthread_cond_wait(&tok->cv, &tok->lock); 50 tok->waiters--; 51 } 52 } 53 tok->tid = pthread_self(); 54 tok->held = 1; 55 pthread_mutex_unlock(&tok->lock); 56 } 57 58 void sh_RMutexUnlock(void * arg) 59 { 60 struct sh_RMutex * tok = (struct sh_RMutex *) arg; 61 62 if (tok == NULL) 63 return; 64 65 pthread_mutex_lock(&tok->lock); 66 tok->held--; 67 if (tok->held == 0) { 68 if (tok->waiters) 69 pthread_cond_signal(&tok->cv); 70 tok->tid = 0; 71 } 72 pthread_mutex_unlock(&tok->lock); 73 } 16 74 #endif -
trunk/src/sh_srp.c
r137 r138 337 337 int res; 338 338 char hash[KEY_LEN+1]; 339 char hashbuf[KEYBUF_SIZE]; 339 340 340 341 SL_ENTER(_("sh_srp_make_a")); … … 345 346 (void) sl_strlcpy (hash, 346 347 sh_tiger_hash((char *)&randl[0], TIGER_DATA, 347 (unsigned long) 6*sizeof(UINT32)), 348 (unsigned long) 6*sizeof(UINT32), 349 hashbuf, sizeof(hashbuf)), 348 350 KEY_LEN+1); 349 351 -
trunk/src/sh_suidchk.c
r137 r138 1010 1010 1011 1011 status = sh_unix_getinfo (ShDFLevel[SH_ERR_T_RO], 1012 thisEntry->d_name,1012 dirlist->sh_d_name, 1013 1013 &theFile, fileHash, 0); 1014 1014 -
trunk/src/sh_unix.c
r137 r138 3611 3611 SL_RETURN((-1),_("sh_unix_getinfo")); 3612 3612 } 3613 3613 3614 3614 if (linknamebuf[0] == '/') 3615 3615 { -
trunk/test/testcompile.sh
r96 r138 110 110 if test x$1 = x0; then 111 111 [ -z "$verbose" ] || log_msg_ok "configure... $TEST"; 112 $MAKE clean > /dev/null 2>> test_log 112 113 $MAKE ${SMATCH} cutest > /dev/null 2>> test_log 113 114 if test x$? = x0; then -
trunk/test/testrun_1.sh
r122 r138 933 933 run_check () 934 934 { 935 935 ${VALGRIND} ./samhain -t check -p none -l debug 2>>test_log_valgrind 936 936 937 937 if test x$? = x0; then
Note:
See TracChangeset
for help on using the changeset viewer.