All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Zaman <jason@perfinion.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH 2/3] audit2allow: fix audit2why import from seobject.
Date: Fri, 19 Aug 2016 11:45:16 +0800	[thread overview]
Message-ID: <1471578317-22785-2-git-send-email-jason@perfinion.com> (raw)
In-Reply-To: <1471578317-22785-1-git-send-email-jason@perfinion.com>

Commit b43991f9135e5422fd1058ecbd427ae6c9283eab broke audit2why because
boolean_desc was imported indirectly via seobject. Use it directly from
sepolicy instead.

$ cd policycoreutils/audit2allow
$ make test
test_audit2why (__main__.Audit2allowTests)
Verify audit2why works ... Traceback (most recent call last):
  File "/bin/audit2why", line 365, in <module>
    app.main()
  File "/bin/audit2why", line 353, in main
    self.__output()
  File "/bin/audit2why", line 295, in __output
    return self.__output_audit2why()
  File "/bin/audit2why", line 263, in __output_audit2why
    print("\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0]))
AttributeError: 'module' object has no attribute 'boolean_desc'
FAIL

Signed-off-by: Jason Zaman <jason@perfinion.com>
---
 policycoreutils/audit2allow/audit2allow | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/policycoreutils/audit2allow/audit2allow b/policycoreutils/audit2allow/audit2allow
index e23e418..4b50c5b 100644
--- a/policycoreutils/audit2allow/audit2allow
+++ b/policycoreutils/audit2allow/audit2allow
@@ -240,7 +240,7 @@ class AuditToPolicy:
 
     def __output_audit2why(self):
         import selinux
-        import seobject
+        import sepolicy
         for i in self.__parser.avc_msgs:
             rc = i.type
             data = i.data
@@ -260,11 +260,11 @@ class AuditToPolicy:
                 if len(data) > 1:
                     print("\tOne of the following booleans was set incorrectly.")
                     for b in data:
-                        print("\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0]))
+                        print("\tDescription:\n\t%s\n" % sepolicy.boolean_desc(b[0]))
                         print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (b[0], b[1]))
                 else:
                     print("\tThe boolean %s was set incorrectly. " % (data[0][0]))
-                    print("\tDescription:\n\t%s\n" % seobject.boolean_desc(data[0][0]))
+                    print("\tDescription:\n\t%s\n" % sepolicy.boolean_desc(data[0][0]))
                     print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (data[0][0], data[0][1]))
                 continue
 
-- 
2.7.3

  reply	other threads:[~2016-08-19  3:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19  3:45 [PATCH 1/3] audit2allow: remove audit2why so it gets symlinked Jason Zaman
2016-08-19  3:45 ` Jason Zaman [this message]
2016-08-19  3:45 ` [PATCH 3/3] audit2allow: tests should use local copy not system Jason Zaman
2016-08-19  3:56   ` Jason Zaman
2016-08-19 14:46     ` Stephen Smalley
2016-08-19 14:42   ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471578317-22785-2-git-send-email-jason@perfinion.com \
    --to=jason@perfinion.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.