[PATCH 047/155] policycoreutils: transaction into semanageRecords

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


This patch looks good to me. acked.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk45t6AACgkQrlYvE4MpobPndgCguBgNLU5QGtyeo+T0uGfbHurz
h2gAnjVHwnD4HFQ6odcRyzUSxoT/RDnu
=KXo5
-----END PGP SIGNATURE-----
>From 9dba8dc096666936787648183eab32a1aaf33cec Mon Sep 17 00:00:00 2001
From: Eric Paris <eparis@xxxxxxxxxx>
Date: Sun, 10 Jul 2011 12:21:14 +0200
Subject: [PATCH 047/155] policycoreutils: transaction into semanageRecords

In order to allow semanage to perform a transaction on several seobjects
at the same time, the transaction lock has to be at the class level
versus being in each object.

Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---
 policycoreutils/semanage/seobject.py |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py
index 0c530fe..f81ba4a 100644
--- a/policycoreutils/semanage/seobject.py
+++ b/policycoreutils/semanage/seobject.py
@@ -162,11 +162,11 @@ def untranslate(trans, prepend = 1):
 		return raw
 	
 class semanageRecords:
+        transaction = False
         handle = None
         def __init__(self, store):
                global handle
                       
-               self.transaction = False
                self.sh = self.get_handle(store)
 
         def get_handle(self, store):
@@ -179,7 +179,7 @@ class semanageRecords:
                if not handle:
                       raise ValueError(_("Could not create semanage handle"))
 
-               if not self.transaction and store != "":
+               if not semanageRecords.transaction and store != "":
                       semanage_select_store(handle, store, SEMANAGE_CON_DIRECT);
                      semanageRecords.store = store
 
@@ -209,28 +209,28 @@ class semanageRecords:
                raise ValueError(_("Not yet implemented"))
 
         def start(self):
-               if self.transaction:
+               if semanageRecords.transaction:
                       raise ValueError(_("Semanage transaction already in progress"))
                self.begin()
-               self.transaction = True
+               semanageRecords.transaction = True
 
         def begin(self):
-               if self.transaction:
+               if semanageRecords.transaction:
                       return
                rc = semanage_begin_transaction(self.sh)
                if rc < 0:
                       raise ValueError(_("Could not start semanage transaction"))
         def commit(self):
-               if self.transaction:
+               if semanageRecords.transaction:
                       return
                rc = semanage_commit(self.sh) 
                if rc < 0:
                       raise ValueError(_("Could not commit semanage transaction"))
 
         def finish(self):
-               if not self.transaction:
+               if not semanageRecords.transaction:
                       raise ValueError(_("Semanage transaction not in progress"))
-               self.transaction = False
+               semanageRecords.transaction = False
                self.commit()
 
 class dontauditClass(semanageRecords):
-- 
1.7.6

Attachment: 0047-policycoreutils-transaction-into-semanageRecords.patch.sig
Description: PGP signature


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

  Powered by Linux