Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
Fedora Release Engineering
c66139451b dist-git conversion 2010-07-29 12:20:03 +00:00
Bill Nottingham
20228d4db3 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:38:25 +00:00
Peter Vrabec
55c2f84461 handle ext4 fs in filesystem test (#510646) 2009-07-14 13:43:27 +00:00
Peter Vrabec
6b0ac2752c upgrade 2009-06-03 10:42:13 +00:00
Jesse Keating
31dbff8e99 Initialize branch F-11 for sectool 2009-04-15 07:44:22 +00:00
13 changed files with 54 additions and 293 deletions

View file

@ -1 +0,0 @@
sectool-0.9.1.tar.bz2

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
sectool-0.9.3.tar.bz2

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: sectool
# $Id$
NAME := sectool
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View file

@ -1,11 +0,0 @@
diff -up sectool-0.9.1/tests/12_cron.dsc.cronieReq sectool-0.9.1/tests/12_cron.dsc
--- sectool-0.9.1/tests/12_cron.dsc.cronieReq 2008-10-23 14:10:21.000000000 +0200
+++ sectool-0.9.1/tests/12_cron.dsc 2008-10-23 14:10:34.000000000 +0200
@@ -6,6 +6,7 @@ DESCRIPTION="Basic crontab checking.
permissions of cron related dirs and commands listed in crontab."
LEVELS="1 2 3 4 5"
GROUPS="daemons"
+REQUIRES="cronie"
AUTHOR="Daniel Kopecek <dkopecek@redhat.com>"
[DEFAULT]

View file

@ -1,106 +0,0 @@
diff --git a/tests/bash_defs.sh b/tests/bash_defs.sh
index 47aa4ec..09e06b3 100644
--- a/tests/bash_defs.sh
+++ b/tests/bash_defs.sh
@@ -187,16 +187,17 @@ function canLogIn {
# getValueFromH '/usr/include/bits/utmp.h' 'UT_NAMESIZE'
# echo $ReturnVal
function getValueFromH {
- if ! [[ -r "$1" ]]
- then
- report 'WARNING' 0 "Can't read a constant $2, header file $1 not found"
+ if ! [[ -r "$1" ]]; then
+ report 'WARNING' 1234 "Can't read a constant $2, header file $1 not found"
+ return 0
else
line="$(egrep "^#define $2..*" $1)"
- if [[ -n "$line" ]]
- then
- ReturnVal="$(echo "$line" | cut -f2)"
+ if [[ -n "$line" ]]; then
+ l_int retval=$(echo "$line" | cut -f2)
+ return $retval
else
- report 'WARNING' 0 "Can't read a constant $2 from file $1, definition of the constant not found in this file"
+ report 'WARNING' 1234 "Can't read a constant $2 from file $1, definition of the constant not found in this file"
+ return 0
fi
fi
}
diff --git a/tests/bash_defs_debug.sh b/tests/bash_defs_debug.sh
index a0d548d..d3beeff 100644
--- a/tests/bash_defs_debug.sh
+++ b/tests/bash_defs_debug.sh
@@ -352,18 +352,19 @@ function canLogIn {
# getValueFromH '/usr/include/bits/utmp.h' 'UT_NAMESIZE'
# echo $ReturnVal
function getValueFromH {
- if ! [[ -r "$1" ]]
- then
- report 'WARNING' 0 "Can't read a constant $2, header file $1 not found"
- else
- line="$(egrep "^#define $2..*" $1)"
- if [[ -n "$line" ]]
- then
- ReturnVal="$(echo "$line" | cut -f2)"
- else
- report 'WARNING' 0 "Can't read a constant $2 from file $1, definition of the constant not found in this file"
- fi
- fi
+ if ! [[ -r "$1" ]]; then
+ report 'WARNING' 1234 "Can't read a constant $2, header file $1 not found"
+ return 0
+ else
+ line="$(egrep "^#define $2..*" $1)"
+ if [[ -n "$line" ]]; then
+ l_int retval=$(echo "$line" | cut -f2)
+ return $retval
+ else
+ report 'WARNING' 1234 "Can't read a constant $2 from file $1, definition of the constant not found in this file"
+ return 0
+ fi
+ fi
}
# function isValidName
diff --git a/tests/group.sh b/tests/group.sh
index ef24886..4c43d94 100755
--- a/tests/group.sh
+++ b/tests/group.sh
@@ -106,7 +106,7 @@ fi
##### too long groupname #####
getValueFromH '/usr/include/bits/utmp.h' 'UT_NAMESIZE'
- MaxLength=$ReturnVal
+ MaxLength=$?
length="`echo \"$groupname\" | wc -m`"
if [ $length -gt $MaxLength ]
then
diff --git a/tests/passwd.sh b/tests/passwd.sh
index 536697f..c1bf10d 100755
--- a/tests/passwd.sh
+++ b/tests/passwd.sh
@@ -123,8 +123,8 @@ check_file_perm $group_shadow 400 root:root 1 $E_BAD_PERMISSIONS "Shadow group
##### too long username #####
getValueFromH '/usr/include/bits/utmp.h' 'UT_NAMESIZE'
- MaxLength=$ReturnVal
- length="`echo \"$username\" | wc -m`"
+ MaxLength=$?
+ length=$(echo "$username" | wc -m)
if [ $length -gt $MaxLength ]
then
report 'ERROR' $E_LONG_USERNAME "\$passwd: Line \$i: User \$username has too long username."
diff --git a/tests/shadow.sh b/tests/shadow.sh
index 778f39e..48773e2 100755
--- a/tests/shadow.sh
+++ b/tests/shadow.sh
@@ -104,7 +104,7 @@ check_file_perm $group_shadow 400 root:root 1 $E_BAD_PERMISSIONS_SHADOW "Group
##### too long username #####
getValueFromH '/usr/include/bits/utmp.h' 'UT_NAMESIZE'
- MaxLength=$ReturnVal
+ MaxLength=$?
length=`echo "$username" | wc -m`
if [ $length -gt $MaxLength ]
then

View file

@ -1,33 +0,0 @@
diff --git a/tests/selinuxtest.py b/tests/selinuxtest.py
index 1e04813..e4d655b 100755
--- a/tests/selinuxtest.py
+++ b/tests/selinuxtest.py
@@ -108,6 +108,7 @@ def bool_state_to_id(state, was = False):
def bools_test():
+ report(INFO, 0, "Starting booleans change test")
old_fname = os.path.join(testenv['TDATA_DIR'], testenv['OLDBOOLS_FILE'])
bools = get_bools()
testname = testenv['NAME']
@@ -134,16 +135,16 @@ def get_msgtype(str):
if str == 'HINT' : return HINT
def enabled_test():
- mode = cmd.getoutput('getenforce')
- if mode != testenv['MODE'] and mode != 'Enforcing':
+ (status, mode) = cmd.getstatusoutput('getenforce')
+ if status != 0 or (mode != testenv['MODE'] and mode != 'Enforcing'):
+ if (mode == ''): mode = 'disabled'
report(get_msgtype(testenv['DISABLED_MSGTYPE']), ID_ENABLED, "Selinux is in " + mode + " mode.")
report(HINT, ID_ENABLED, "Using Enforing mode is highly recommended. See selinux manual page for switching to Enforcing mode.")
def main():
- report(INFO, 0, "Starting booleans change test")
- bools_test()
enabled_test()
+ if se.is_selinux_enabled(): bools_test()
if __name__ == '__main__':
main()

View file

@ -1,46 +0,0 @@
diff --git a/src/sectool-gui.py b/src/sectool-gui.py
index 9b6faeb..608d6af 100755
--- a/src/sectool-gui.py
+++ b/src/sectool-gui.py
@@ -500,6 +500,7 @@ class TestHandler( Handler ):
self.environ.update( dict([ (key.upper(), self.scheduler_conf['ENVIRONMENT'][key]) for key in self.scheduler_conf['ENVIRONMENT'] ]) )
self.environ.update( { 'TDATA_DIR_BASE' : self.environ['TDATA_DIR_BASE'] } )
self.environ.update( { 'PATH' : self.environ['PATH'] } )
+ self.environ.update( DEBUG='0' )
self.suitesAll = self.ST_TestLoader.loadFromPath( self.environ["DSC_DIR"], self.environ["TESTS_DIRS"] )
def __remove_mark( self, string ):
@@ -511,6 +512,12 @@ class TestHandler( Handler ):
return str.group(0)[1:-1]
else: return string
+ def set_environ( REFRESH=None, LEVEL=None, DEBUG=None ):
+
+ if REFRESH != None: self.environ.update( REFRESH = REFRESH )
+ if DEBUG != None: self.environ.update( DEBUG = DEBUG )
+ if LEVEL != None: self.environ.update( LEVEL = LEVEL )
+
def set_default_level( self ):
self.__formatter.select_level( self.scheduler_conf['ACTION']['LEVEL'] )
@@ -586,6 +593,8 @@ class TestHandler( Handler ):
if len( test_list ) == 0: return
suite = self.suitesAll.filter( self.filterTestNames, test_list=test_list )
+ if level == -1: self.environ.update( REFRESH = '1' )
+ else: self.environ.update( REFRESH = '0' )
suite.updateEnviron(self.environ)
self.threadHandler = ThreadHandler( self.__formatter, suite, test_list, level ) #: run tests in new thread
@@ -734,8 +743,9 @@ class ThreadHandler(threading.Thread, Handler):
gtk.gdk.threads_leave()
#self.__formatter.show_test_summary( test.dsc['HEADER']['NAME'] )
# TODO: update selected test
-
+
else:
+
for test in self.__suite:
if self.__stopthread.isSet(): break

View file

@ -1,18 +0,0 @@
diff --git a/tests/home_files.sh b/tests/home_files.sh
index 9faaff5..ea016f0 100755
--- a/tests/home_files.sh
+++ b/tests/home_files.sh
@@ -80,7 +80,12 @@ NO_WRITE_FILES="\
.viminfo \
.xsession \
.xinitrc \
- .Xdefaults"
+ .Xdefaults \
+ .zshenv \
+ .zprofile \
+ .zshrc \
+ .zlogin \
+ .zlogout"
if (( ${REFRESH} == 1 )); then
test_exit ${E_OK}

View file

@ -1,28 +0,0 @@
diff -up sectool-0.9.2/src/sectool.8.man_files sectool-0.9.2/src/sectool.8
--- sectool-0.9.2/src/sectool.8.man_files 2008-09-10 11:44:31.000000000 +0200
+++ sectool-0.9.2/src/sectool.8 2008-12-02 09:50:18.000000000 +0100
@@ -156,6 +156,24 @@ The configuration file is stored in /etc
sectool --level 5 --mail admin@mydomain.com
+.SH FILES
+.
+.TP
+/etc/sectool/sectool.conf
+Configuration file
+.
+.TP
+/etc/sectool/tests
+Test directory with description files ( .dsc files )
+.
+.TP
+/etc/share/sectool/tests
+Test directory with source files
+.
+.TP
+/var/log/sectool.log
+Log file, where sectool stores output from tests
+.
.SH BUGS
Of course there are no bugs. If you still believe you have found one, please include a session with debug information turned on (option
.B --debug).

View file

@ -0,0 +1,12 @@
diff -up sectool-0.9.2/src/Makefile~ sectool-0.9.2/src/Makefile
--- sectool-0.9.2/src/Makefile~ 2008-11-13 11:08:40.000000000 +0200
+++ sectool-0.9.2/src/Makefile 2009-04-23 00:19:30.000000000 +0300
@@ -1,7 +1,7 @@
include ../sectool.mk
CC= gcc
-CFLAGS= -Wall -O2 -ffast-math -I. -D_FILE_OFFSET_BITS=64 -DTEST_SELINUX -I/usr/include/rpm
+CFLAGS= -Wall -O2 -ffast-math $(RPM_OPT_FLAGS) -I. -D_FILE_OFFSET_BITS=64 -DTEST_SELINUX -I/usr/include/rpm
LDFLAGS= -lrpm -lselinux
SRCS_sectool=sectool.c

12
sectool-0.9.3-ext4.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up sectool-0.9.3/tests/03_filesystem.dsc.ext4 sectool-0.9.3/tests/03_filesystem.dsc
--- sectool-0.9.3/tests/03_filesystem.dsc.ext4 2009-07-14 15:18:11.472860778 +0200
+++ sectool-0.9.3/tests/03_filesystem.dsc 2009-07-14 15:18:32.558798787 +0200
@@ -15,7 +15,7 @@ GROUPS="filesystem packages selinux"
AUTHOR="Dan Kopecek <dkopecek@redhat.com>"
[DEFAULT]
-FSTYPES="ext2 ext3 reiserfs xfs"
+FSTYPES="ext2 ext3 ext4 reiserfs xfs"
EXCLUDE="/var/lib/misc
/var/lib/mock"
INCLUDE="/bin

View file

@ -1,21 +1,19 @@
Summary: A security audit system and intrusion detection system
Name: sectool
Version: 0.9.1
Release: 9
Version: 0.9.3
Release: 2%{?dist}
URL: https://hosted.fedoraproject.org/sectool/wiki/WikiStart
Source0: %{name}-%{version}.tar.bz2
Source1: sectool.log
Patch1: sectool-0.9.1-cronieReq.patch
Patch2: sectool-0.9.1-setVar.patch
Patch3: sectool-0.9.1-getValueFromH.patch
Patch4: sectool-0.9.1-selinux.patch
Patch5: sectool-0.9.1-zsh.patch
Patch6: sectool-0.9.2-man_files.patch
Patch1: sectool-0.9.2-optflags.patch
Patch2: sectool-0.9.3-ext4.patch
License: GPLv2+
Group: Applications/System
Requires: gettext coreutils which libselinux
Requires: python2 rpm-python libselinux-python
BuildRequires: desktop-file-utils gettext intltool rpm-devel asciidoc libselinux-devel
Requires: gettext coreutils libselinux
Requires: python2 rpm-python libselinux-python glibc-headers
BuildRequires: desktop-file-utils gettext intltool asciidoc
BuildRequires: rpm-devel >= 4.6.0
BuildRequires: libselinux-devel glibc-headers
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%package gui
@ -38,12 +36,8 @@ sectool-gui provides a GTK-based graphical user interface to sectool.
%prep
%setup -q
%patch1 -p1 -b .cronieReq
%patch2 -p1 -b .setVar
%patch3 -p1 -b .getValueFromH
%patch4 -p1 -b .selinux
%patch5 -p1 -b .zsh
%patch6 -p1 -b .man_files
%patch1 -p1 -b .optflags
%patch2 -p1 -b .ext4
%build
make %{?_smp_mflags}
@ -104,25 +98,31 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/pixmaps/sectool-gui.png
%{_datadir}/pixmaps/sectool-min.png
%{_datadir}/applications/fedora-sectool.desktop
%dir %{_datadir}/pixmaps/sectool
%{_datadir}/pixmaps/sectool/*.png
%changelog
* Fri Mar 06 2009 Jesse Keating <jkeating@redhat.com> - 0.9.1-9
- Rebuild for new rpm
* Tue Jul 14 2009 Peter Vrabec <pvrabec@redhat.com> - 0.9.3-2
- handle ext4 fs in filesystem test (#510646)
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Jun 03 2009 Peter Vrabec <pvrabec@redhat.com> - 0.9.3-1
- upgrade, bugfix release
* Thu Dec 4 2008 Jakub Hrozek <jhrozek@redhat.com> - 0.9.1-7
- apply mbarabas' manpage patch
* Thu May 21 2009 Ville Skyttä <ville.skytta at iki.fi> - 0.9.2-5
- Build with $RPM_OPT_FLAGS (#497231).
* Mon Dec 1 2008 Michael Schwendt <mschwendt@fedoraproject.org> - 0.9.1-6
- Include /usr/share/pixmaps/sectool directory in -gui package.
* Mon Jan 26 2009 Daniel Kopecek <dkopecek@redhat.com> - 0.9.2-4
- removed showvars.dsc
* Mon Dec 01 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.9.1-5
- Rebuild for Python 2.6
* Fri Jan 23 2009 Daniel Kopecek <dkopecek@redhat.com> - 0.9.2-3
- removed showvars.sh
- added dist macro to Release:
* Tue Dec 02 2008 Daniel Kopecek <dkopecek@redhat.com> - 0.9.2-2
- bugfix release
* Mon Nov 24 2008 Daniel Kopecek <dkopecek@redhat.com> - 0.9.2-1
- upgrade, see changelog for changes
* Mon Nov 03 2008 Peter Vrabec <pvrabec@redhat.com> - 0.9.1-4
- checking zsh home files (#469913)

View file

@ -1 +1 @@
1bf9e281318b77044c96eb68028157ce sectool-0.9.1.tar.bz2
c159880406a54463609f60a714db22a8 sectool-0.9.3.tar.bz2