[PATCH 55/74] Make sure file equivalance target and source do not end

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

 



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

Do error checking on equivalence that end in "/"
   This patch looks good to me. acked.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJpNmIACgkQrlYvE4MpobPAUACfUortCjaWusvEwbvUQWLsiw5v
Ri0AnirAgfmXOIg0/addE3/xw1JVmG7u
=/KAj
-----END PGP SIGNATURE-----
>From f3351dcb8612ed10fd7b02f1744c6f3c9368c5b8 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@xxxxxxxxxx>
Date: Fri, 11 Oct 2013 09:03:20 -0400
Subject: [PATCH 55/74] Make sure file equivalance target and source do not end
 with a /

---
 policycoreutils/semanage/seobject.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py
index 3f35579..ebbe4e7 100644
--- a/policycoreutils/semanage/seobject.py
+++ b/policycoreutils/semanage/seobject.py
@@ -1727,6 +1727,12 @@ class fcontextRecords(semanageRecords):
 
         def add_equal(self, target, substitute):
                 self.begin()
+                if target != "/" and target[-1] == "/":
+                        raise ValueError(_("Target %s is not valid. Target is not allowed to end with '/'") % target )
+
+                if substitute != "/" and substitute[-1] == "/":
+                       raise ValueError(_("Substiture %s is not valid. Substitute is not allowed to end with '/'") % substitute )
+
                 if target in self.equiv.keys():
                        raise ValueError(_("Equivalence class for %s already exists") % target)
                 self.validate(target)
-- 
1.8.3.1


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

  Powered by Linux