mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-19 12:44:32 +00:00
Make sure file equivalance target and source do not end with a /
This commit is contained in:
parent
9d815b2dbb
commit
6f24fe24f6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user