[apparmor] aa_change_hat() token needs to be unsigned long in test suite

2014-03-03 Thread Seth Arnold
Hello,

While testing the latest iteration of Ubuntu 2.8.95 preliminary packages,
I found that the magic token used in the test suite is incorrectly stored
as an int rather than unsigned long in at least two cases.

The test case currently fails with:

running changehat_misc
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 20184 Killed  $testexec $@  $outfile 21
Error: changehat_twice failed. Test 'CHANGEHAT (subprofile-subprofile)' was 
expected to 'pass'. Reason for failure 'killed by signal 9'

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 20190 Killed  $testexec $@  $outfile 21

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 20222 Killed  $testexec $@  $outfile 21



With this patch the output is:
running changehat_misc

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 26647 Killed  $testexec $@  $outfile 21

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 26679 Killed  $testexec $@  $outfile 21



This patch looks necessary in both trunk and 2.8 branches, though I have
not tested how 2.8 actually handles now.

Signed-off-by: Seth Arnold seth.arn...@canonical.com

Thanks
=== modified file 'tests/regression/apparmor/changehat_twice.c'
--- tests/regression/apparmor/changehat_twice.c	2010-12-20 20:29:10 +
+++ tests/regression/apparmor/changehat_twice.c	2014-03-04 04:03:01 +
@@ -22,7 +22,8 @@
 
 int main(int argc, char *argv[])
 {
-	int rc, magic;
+	int rc;
+	unsigned long magic;
 
 	if (argc != 5){
 		fprintf(stderr, usage: %s profile1 profile2 goodmagic|badmagic file\n,

=== modified file 'tests/regression/apparmor/changehat_wrapper.c'
--- tests/regression/apparmor/changehat_wrapper.c	2012-03-26 13:10:18 +
+++ tests/regression/apparmor/changehat_wrapper.c	2014-03-04 04:03:48 +
@@ -87,7 +87,7 @@
 	int filedes[2];
 	int c, o;
 	char buf[BUFSIZ];
-	unsigned int magic_token = SD_ID_MAGIC+1;
+	unsigned long magic_token = SD_ID_MAGIC+1;
 	int manual = 0;
 	int exit_hat = 0;
 	char * manual_string;



signature.asc
Description: Digital signature
-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor


Re: [apparmor] aa_change_hat() token needs to be unsigned long in test suite

2014-03-03 Thread Steve Beattie
Hey Seth,

On Mon, Mar 03, 2014 at 08:15:12PM -0800, Seth Arnold wrote:
 This patch looks necessary in both trunk and 2.8 branches, though I have
 not tested how 2.8 actually handles now.
 
 Signed-off-by: Seth Arnold seth.arn...@canonical.com

Good catch. Acked-by: Steve Beattie st...@nxnw.org for trunk and 2.8.
Thanks.

-- 
Steve Beattie
sbeat...@ubuntu.com
http://NxNW.org/~steve/


signature.asc
Description: Digital signature
-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor