[PATCH 55/67] policycoreutils: sepolgen: FIXME audit2allow is

[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/

iEYEARECAAYFAk5yWXYACgkQrlYvE4MpobMiKQCgkbmtsQkEj1aYZ5AUmQV274h6
ni8An2TcYCSftNNpcGqGJ0y6IYy3qAeE
=lZW/
-----END PGP SIGNATURE-----
>From 07e778cf6be45b148c24f94e5664fa5cd889b968 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@xxxxxxxxxx>
Date: Tue, 30 Aug 2011 04:52:18 -0400
Subject: [PATCH 55/67] policycoreutils: sepolgen: FIXME audit2allow is
 mistakakenly not allowing valid module names

Needs Review.

Signed-off-by: Dan Walsh <dwalsh@xxxxxxxxxx>
---
 policycoreutils/audit2allow/audit2allow |    2 +-
 sepolgen/src/sepolgen/module.py         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/policycoreutils/audit2allow/audit2allow b/policycoreutils/audit2allow/audit2allow
index c60490b..e9d5882 100644
--- a/policycoreutils/audit2allow/audit2allow
+++ b/policycoreutils/audit2allow/audit2allow
@@ -104,7 +104,7 @@ class AuditToPolicy:
         if name:
             options.requires = True
             if not module.is_valid_name(name):
-                sys.stderr.write("only letters and numbers allowed in module names\n")
+                sys.stderr.write('error: module names must begin with a letter, optionally followed by letters, numbers, "-", "_", "."\n')
                 sys.exit(2)
 
         # Make -M and -o conflict
diff --git a/sepolgen/src/sepolgen/module.py b/sepolgen/src/sepolgen/module.py
index edd24c6..5818cec 100644
--- a/sepolgen/src/sepolgen/module.py
+++ b/sepolgen/src/sepolgen/module.py
@@ -37,8 +37,8 @@ import shutil
 def is_valid_name(modname):
     """Check that a module name is valid.
     """
-    m = re.findall("[^a-zA-Z0-9]", modname)
-    if len(m) == 0:
+    m = re.findall("[^a-zA-Z0-9_\-\.]", modname)
+    if len(m) == 0 and modname[0].isalpha():
         return True
     else:
         return False
-- 
1.7.6.2


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

  Powered by Linux