Changeset 412
- Timestamp:
- Sep 1, 2012, 4:25:30 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r378 r412 610 610 if test -f $(srcdir)/stealth_template.jpg; then \ 611 611 cp $(srcdir)/stealth_template.jpg . ; \ 612 fi; \ 613 fi 614 @if test -d /etc/logrotate.d; then \ 615 if test ! -f /etc/logrotate.d/@install_name@; then \ 616 cp $(srcdir)/scripts/logrotate /etc/logrotate.d/@install_name@; \ 617 else \ 618 echo "/etc/logrotate.d/@install_name@ exists, not overwriting"; \ 612 619 fi; \ 613 620 fi … … 1633 1640 samhain.startIRIX samhain.startMACOSX 1634 1641 1635 SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl 1642 SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl logrotate \ 1643 yuleadmin.pl samhain.ebuild samhain.ebuild-light samhain.spec 1636 1644 1637 1645 distdir: distfilecheck 1638 1646 -rm -f $(top_srcdir)/init/*~ 1647 -rm -f $(top_srcdir)/sql_init/*~ 1639 1648 -rm -f $(top_srcdir)/dsys/*~ 1640 1649 -rm -f $(top_srcdir)/docs/*~ -
trunk/aclocal.m4
r378 r412 409 409 x_libraries=NONE 410 410 DESTDIR= 411 SH_ENABLE_OPTS="ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand "411 SH_ENABLE_OPTS="ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand suid" 412 412 SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver kcheck gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file" 413 413 -
trunk/configure.ac
r405 r412 805 805 ], 806 806 [AC_DEFINE(SH_WITH_MAIL)] 807 ) 808 809 AC_ARG_ENABLE(suid, 810 [ --enable-suid allow suid], 811 [ 812 if test "x${enable_suid}" = xyes; then 813 AC_DEFINE(SH_ALLOW_SUID, [1], [Define if you want to allow suid execution for samhain]) 814 fi 815 ] 807 816 ) 808 817 … … 2759 2768 rules.deb-light 2760 2769 hp_ux.psf 2770 scripts/logrotate 2761 2771 scripts/samhain.spec 2762 2772 scripts/redhat_i386.client.spec -
trunk/include/samhain.h
r411 r412 458 458 459 459 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK) 460 #ifdef USE_SUID 460 461 #define MLOCK(a, b) \ 461 462 if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \ 462 463 (void) sl_set_suid(); \ 463 464 if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; \ 464 (void) sl_unset_suid(); } 465 (void) sl_unset_suid(); } 466 #else 467 #define MLOCK(a, b) \ 468 if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \ 469 if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; } 470 #endif 465 471 #else 466 472 #define MLOCK(a, b) \ … … 469 475 470 476 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK) 477 #ifdef USE_SUID 471 478 #define MUNLOCK(a, b) \ 472 479 if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \ 473 480 (void) sl_set_suid(); \ 474 481 (void) sh_unix_munlock( a, b );\ 475 (void) sl_unset_suid(); } 482 (void) sl_unset_suid(); } 483 #else 484 #define MUNLOCK(a, b) \ 485 if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \ 486 (void) sh_unix_munlock( a, b ); } 487 #endif 476 488 #else 477 489 #define MUNLOCK(a, b) \ -
trunk/include/slib.h
r272 r412 39 39 40 40 *****************/ 41 41 42 42 43 /* -------------------------------------------------------------- -
trunk/samhain-install.sh.in
r203 r412 1264 1264 fi 1265 1265 1266 1267 if test -d /etc/logrotate.d; then 1268 if test -f /etc/logrotate.d/@install_name@; then 1269 test -z "$verbose" || echo $ECHO_N " rm -f /etc/logrotate.d/@install_name@ ... $ECHO_C" 1270 rm -f /etc/logrotate.d/@install_name@; 1271 if test x$? = x0; then 1272 test -z "$verbose" || echo "${ECHO_T}done" 1273 else 1274 test -z "$verbose" || echo "${ECHO_T}failed" 1275 fi 1276 fi 1277 fi 1278 1266 1279 if test x"$force" = "xyes" 1267 1280 then -
trunk/samhain.spec.in
r390 r412 196 196 %attr(644,root,root) @mandir@/man5/@install_name@* 197 197 %attr(644,root,root) @mandir@/man8/@install_name@* 198 %attr(644,root,root) /etc/logrotate.d/@install_name@ 198 199 %config(noreplace) @myrpmconffile@ 199 200 -
trunk/scripts/check_samhain.pl.in
r310 r412 4 4 # by the samhain file integrity checker. 5 5 # 6 # Copyright Rainer Wichmann (2004 )6 # Copyright Rainer Wichmann (2004, 2012) 7 7 # 8 8 # License Information: … … 28 28 use Getopt::Long; 29 29 use vars qw($PROGNAME $SAMHAIN $opt_V $opt_h $opt_v $verbose $opt_w $opt_c $opt_t $status $msg $state $retval); 30 use lib " utils.pm";30 use lib "/usr/local/nagios/libexec" ; 31 31 use utils qw(%ERRORS &print_revision); 32 32 … … 49 49 # -----------------------------------------------------------------[ Global ]-- 50 50 51 $PROGNAME = "check_ samhain";51 $PROGNAME = "check_@install_name@"; 52 52 $SAMHAIN = "@sbindir@/@install_name@"; 53 53 … … 99 99 $state = $ERRORS{'WARNING'}; 100 100 } else { 101 $msg = "CRITICAL: $status policy violations (threshold w=$opt_w)";101 $msg = "CRITICAL: $status policy violations (threshold c=$opt_c)"; 102 102 $state = $ERRORS{'CRITICAL'}; 103 103 } … … 143 143 144 144 if ($opt_V) { 145 print_revision($PROGNAME,'$Revision: 1. 0$ ');145 print_revision($PROGNAME,'$Revision: 1.1 $ '); 146 146 exit $ERRORS{'OK'}; 147 147 } … … 182 182 183 183 sub print_help () { 184 print_revision($PROGNAME, ' $Revision: 1.0 $');185 print "Copyright (c) 2004 Rainer Wichmann184 print_revision($PROGNAME, '1.1'); 185 print "Copyright (c) 2004,2012 Rainer Wichmann 186 186 187 187 This plugin checks the number of policy violations reported by the -
trunk/scripts/redhat_i386.client.spec.in
r279 r412 141 141 /usr/local/sbin/samhain_setpwd 142 142 /lib/modules 143 %attr(644,root,root) /etc/logrotate.d/@install_name@ 143 144 #%attr(644,root,root) /usr/local/man/man5/samhain* 144 145 #%attr(644,root,root) /usr/local/man/man8/samhain* -
trunk/scripts/samhain.spec.in
r390 r412 127 127 %attr(644,root,root) %{_mandir}/man5/samhain* 128 128 %attr(644,root,root) %{_mandir}/man8/samhain* 129 %attr(644,root,root) /etc/logrotate.d/@install_name@ 129 130 %config(noreplace) %{_sysconfdir}/samhainrc 130 131 -
trunk/src/sh_calls.c
r361 r412 696 696 SL_ENTER(_("aud_open")); 697 697 698 #ifdef USE_SUID 699 if (0 == strcmp(pathname, "/usr/bin/sudo")) 700 { 701 uid_t ruid; uid_t euid; uid_t suid; 702 getresuid(&ruid, &euid, &suid); 703 } 704 if (privs == SL_YESPRIV) 705 sl_set_suid(); 706 #else 707 /*@-noeffect@*/ 708 (void) privs; /* fix compiler warning */ 709 /*@+noeffect@*/ 710 #endif 711 698 712 val_return = open (pathname, *o_noatime|flags, mode); 713 714 #ifdef USE_SUID 715 if (privs == SL_YESPRIV) 716 sl_unset_suid(); 717 #endif 718 699 719 if ((val_return < 0) && (*o_noatime != 0)) 700 720 { … … 704 724 } 705 725 error = errno; 706 /*@-noeffect@*/707 (void) privs; /* fix compiler warning */708 /*@+noeffect@*/709 726 710 727 if (val_return < 0) … … 736 753 SL_ENTER(_("aud_open")); 737 754 738 val_return = open (pathname, flags, mode); 739 error = errno; 755 #ifdef USE_SUID 756 if (privs == SL_YESPRIV) 757 sl_set_suid(); 758 #else 740 759 /*@-noeffect@*/ 741 760 (void) privs; /* fix compiler warning */ 742 761 /*@+noeffect@*/ 762 #endif 763 764 val_return = open (pathname, flags, mode); 765 766 #ifdef USE_SUID 767 if (privs == SL_YESPRIV) 768 sl_unset_suid(); 769 #endif 770 771 error = errno; 743 772 744 773 if (val_return < 0) -
trunk/src/sh_database.c
r362 r412 1764 1764 1765 1765 /* recursively enter linked list of messages into database, last first 1766 * - last is client (if this is a client message received by client) 1766 1767 */ 1767 1768 long sh_database_insert_rec (dbins * curr, int depth, char * host) -
trunk/src/slib.c
r395 r412 1535 1535 SL_REQUIRE (sl_save_uids() == SL_ENONE, _("sl_save_uids() == SL_ENONE")); 1536 1536 1537 #ifndef SH_ALLOW_SUID 1537 1538 if (euid != ruid || egid != rgid) 1538 1539 { … … 1556 1557 #endif 1557 1558 } 1559 #endif 1558 1560 SL_IRETURN(SL_ENONE, _("sl_policy_get_user")); 1559 1561 }
Note:
See TracChangeset
for help on using the changeset viewer.