rpms/sectool/devel sectool-0.9.1-getValueFromH.patch, NONE, 1.1 sectool-0.9.1-setVar.patch, NONE, 1.1 sectool.spec, 1.19, 1.20

Peter Vrabec pvrabec at fedoraproject.org
Mon Nov 3 14:26:20 UTC 2008


Author: pvrabec

Update of /cvs/extras/rpms/sectool/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24352

Modified Files:
	sectool.spec 
Added Files:
	sectool-0.9.1-getValueFromH.patch sectool-0.9.1-setVar.patch 
Log Message:
- fix getValueFromH() (#469368)
- fix GUI: set REFRESH, DEBUG, LEVEL


sectool-0.9.1-getValueFromH.patch:

--- NEW FILE sectool-0.9.1-getValueFromH.patch ---
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

sectool-0.9.1-setVar.patch:

--- NEW FILE sectool-0.9.1-setVar.patch ---
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



Index: sectool.spec
===================================================================
RCS file: /cvs/extras/rpms/sectool/devel/sectool.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- sectool.spec	23 Oct 2008 12:41:50 -0000	1.19
+++ sectool.spec	3 Nov 2008 14:25:50 -0000	1.20
@@ -1,11 +1,13 @@
 Summary: A security audit system and intrusion detection system
 Name: sectool
 Version: 0.9.1
-Release: 2
+Release: 3
 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
 License: GPLv2+
 Group: Applications/System
 Requires: gettext coreutils which libselinux
@@ -34,6 +36,8 @@
 %prep
 %setup -q
 %patch1 -p1 -b .cronieReq
+%patch2 -p1 -b .setVar
+%patch3 -p1 -b .getValueFromH
 
 %build
 make %{?_smp_mflags}
@@ -98,6 +102,10 @@
 
 
 %changelog
+* Mon Nov 03 2008 Peter Vrabec <pvrabec at redhat.com> - 0.9.1-3
+- fix getValueFromH() (#469368)
+- fix GUI: set REFRESH, DEBUG, LEVEL
+
 * Thu Oct 23 2008 Peter Vrabec <pvrabec at redhat.com> - 0.9.1-2
 - add missing requirement (468033)
 - fix deps of cron test (468033)




More information about the scm-commits mailing list