[PATCH 1/2] libsemanage: fix src/pywrap-test.py -v -F

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Running "libsemanage/src/pywrap-test.py -v -F" gives following error:

    Traceback (most recent call last):
      File "pywrap-test.py", line 1139, in <module>
        sys.exit(main())
      File "pywrap-test.py", line 1121, in main
        tests.run(sh)
      File "pywrap-test.py", line 107, in run
        self.test_writefcontext(handle)
      File "pywrap-test.py", line 622, in test_writefcontext
        if self.verbose: print "SEFContext type set: ", semanage.semanage_fcontext_get_type_str(fcon)
    TypeError: in method 'semanage_fcontext_get_type_str', argument 1 of type 'int'

The argument of semanage_fcontext_get_type_str is the type recorded in
fcon and not fcon itself.  This type can be retrieved with
semanage_fcontext_get_type.
---
 libsemanage/src/pywrap-test.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libsemanage/src/pywrap-test.py b/libsemanage/src/pywrap-test.py
index d087e47..5d8aad1 100644
--- a/libsemanage/src/pywrap-test.py
+++ b/libsemanage/src/pywrap-test.py
@@ -619,7 +619,9 @@ class Tests:
 		if self.verbose: print "SEFContext expr set: ", semanage.semanage_fcontext_get_expr(fcon)
 
 		semanage.semanage_fcontext_set_type(fcon, semanage.SEMANAGE_FCONTEXT_REG)
-		if self.verbose: print "SEFContext type set: ", semanage.semanage_fcontext_get_type_str(fcon)
+		if self.verbose:
+			ftype = semanage.semanage_fcontext_get_type(fcon)
+			print "SEFContext type set: ", semanage.semanage_fcontext_get_type_str(ftype)
 
 		(status, con) = semanage.semanage_context_create(sh)
 		if status < 0:
-- 
2.0.0

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux