aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcgzones <cgzones@googlemail.com>2016-12-06 13:28:10 +0100
committerJason Zaman <jason@perfinion.com>2016-12-08 12:43:12 +0800
commit51d3e4cfd0b1b294cac9b2aeef4691bd22eb0bf7 (patch)
tree3d760d49bb9ebe59ac1898e7546553ed1dfe22f4 /support
parentfix syslogd audits (diff)
downloadhardened-refpolicy-51d3e4cfd0b1b294cac9b2aeef4691bd22eb0bf7.tar.gz
hardened-refpolicy-51d3e4cfd0b1b294cac9b2aeef4691bd22eb0bf7.tar.bz2
hardened-refpolicy-51d3e4cfd0b1b294cac9b2aeef4691bd22eb0bf7.zip
remove trailing whitespaces
Diffstat (limited to 'support')
-rw-r--r--support/Makefile.devel2
-rw-r--r--support/genclassperms.py2
-rw-r--r--support/genhomedircon16
-rw-r--r--support/gennetfilter.py2
-rw-r--r--support/pyplate.py8
-rw-r--r--support/sedoctool.py54
-rw-r--r--support/segenxml.py4
-rw-r--r--support/selinux-policy-refpolicy.spec2
-rw-r--r--support/selinux-refpolicy-sources.spec.skel2
-rw-r--r--support/set_bools_tuns.awk2
10 files changed, 47 insertions, 47 deletions
diff --git a/support/Makefile.devel b/support/Makefile.devel
index d1cbef94..a0e8c2a2 100644
--- a/support/Makefile.devel
+++ b/support/Makefile.devel
@@ -179,7 +179,7 @@ tmp/all_interfaces.conf: $(m4support) $(header_interfaces) $(detected_ifs)
# so users dont have to make empty .fc and .if files
$(detected_fcs):
@touch $@
-
+
$(detected_ifs):
@echo "## <summary>$(basename $(@D))</summary>" > $@
diff --git a/support/genclassperms.py b/support/genclassperms.py
index 6d6ce8bd..03f31ad0 100644
--- a/support/genclassperms.py
+++ b/support/genclassperms.py
@@ -94,7 +94,7 @@ def get_av_db(file_name):
# their own word. It doesn't matter if there will be extra
# white space, it'll get thrown away when the string is split.
av_line.replace("{"," { ")
- av_line.replace("}"," } ")
+ av_line.replace("}"," } ")
# Split up the words on the line and add it to av_data.
av_data += av_line.split()
diff --git a/support/genhomedircon b/support/genhomedircon
index 33dbcc12..355ecb7b 100644
--- a/support/genhomedircon
+++ b/support/genhomedircon
@@ -14,7 +14,7 @@
#
# The file CONTEXTDIR/files/homedir_template exists. This file is used to
# set up the home directory context for each real user.
-#
+#
# If a user has more than one role in CONTEXTDIR/local.users, genhomedircon uses
# the first role in the list.
#
@@ -25,7 +25,7 @@
# EXCLUDE_LOGINS. Users who are explicitly defined in CONTEXTDIR/local.users
# are always "real" (including root, in the default configuration).
#
-#
+#
# Old ASSUMPTIONS:
#
# If a user has more than one role in FILECONTEXTDIR/users, genhomedircon uses
@@ -85,7 +85,7 @@ def getPrefixes():
if not prefix in prefixes:
prefixes[prefix] = ""
return prefixes
-
+
def getUsers(filecontextdir):
rc = commands.getstatusoutput("grep ^user %s/users" % filecontextdir)
udict = {}
@@ -215,7 +215,7 @@ def oldgenhomedircon(filecontextdir, filecontext):
# Fill in HOME and ROLE for users that are defined
for u in users.keys():
- update(filecontext, u, users[u])
+ update(filecontext, u, users[u])
#############################################################################
#
@@ -271,7 +271,7 @@ def usage(error = ""):
def warning(warning = ""):
sys.stderr.write("%s\n" % warning)
sys.stderr.flush()
-
+
def errorExit(error):
sys.stderr.write("%s exiting for: " % sys.argv[0])
sys.stderr.write("%s\n" % error)
@@ -291,7 +291,7 @@ class selinuxConfig:
def getFileContextFile(self):
return self.getFileContextDir()+"/file_contexts"
-
+
def getContextDir(self):
return self.selinuxdir+self.type+self.contextdir
@@ -310,7 +310,7 @@ class selinuxConfig:
def getSystemUsersFile(self):
return self.selinuxdir+self.type+"/users/system.users"
-
+
def heading(self):
ret = "\n#\n#\n# User-specific file contexts, generated via %s\n" % sys.argv[0]
ret += "# edit %s to change file_context\n#\n#\n" % self.getUsersFile()
@@ -416,7 +416,7 @@ class selinuxConfig:
homedirs.sort()
return homedirs
-
+
def genoutput(self):
ret= self.heading()
for h in self.getHomeDirs():
diff --git a/support/gennetfilter.py b/support/gennetfilter.py
index 866db91a..a7c9036e 100644
--- a/support/gennetfilter.py
+++ b/support/gennetfilter.py
@@ -112,7 +112,7 @@ def parse_corenet(file_name):
del parms[:3]
packets.append(Packet(name,ports))
-
+
corenet_te_in.close()
return packets
diff --git a/support/pyplate.py b/support/pyplate.py
index 44b662ac..bc0b6df8 100644
--- a/support/pyplate.py
+++ b/support/pyplate.py
@@ -44,7 +44,7 @@ PyPlate defines the following directives:
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -273,7 +273,7 @@ class FunctionTemplateNode(TemplateNode):
TemplateNode.execute(self, stream, data)
for key, value in remember_vars.items():
data[key] = value
-
+
class LeafTemplateNode(TemplateNode):
def __init__(self, parent, s):
self.parent = parent
@@ -308,7 +308,7 @@ class ExecTemplateNode(LeafTemplateNode):
def execute(self, stream, data):
exec(self.s, globals(), data)
pass
-
+
class CallTemplateNode(LeafTemplateNode):
def __init__(self, parent, s):
LeafTemplateNode.__init__(self, parent, s)
@@ -318,7 +318,7 @@ class CallTemplateNode(LeafTemplateNode):
"[[%s]] is not a valid function call" % self.s)
self.function_name = match.group(1)
self.vars = "(" + match.group(2).strip() + ",)"
-
+
def execute(self, stream, data):
self.parent.functions[self.function_name].call(
eval(self.vars, globals(), data), stream, data)
diff --git a/support/sedoctool.py b/support/sedoctool.py
index afcdee40..c98a7f34 100644
--- a/support/sedoctool.py
+++ b/support/sedoctool.py
@@ -9,8 +9,8 @@
# the Free Software Foundation, version 2.
"""
- This module generates configuration files and documentation from the
- SELinux reference policy XML format.
+ This module generates configuration files and documentation from the
+ SELinux reference policy XML format.
"""
import sys
@@ -46,11 +46,11 @@ def read_policy_xml(filename):
try:
doc = parseString(xml_fh.read())
- except:
+ except:
xml_fh.close()
error("Error while parsing xml")
- xml_fh.close()
+ xml_fh.close()
return doc
def gen_booleans_conf(doc, file_name, namevalue_list):
@@ -141,7 +141,7 @@ def gen_module_conf(doc, file_name, namevalue_list):
mod_name = mod_layer = None
- mod_name = node.getAttribute("name")
+ mod_name = node.getAttribute("name")
mod_layer = node.parentNode.getAttribute("name")
if mod_name and mod_layer:
@@ -171,7 +171,7 @@ def gen_module_conf(doc, file_name, namevalue_list):
# Set the module to base if it is marked as required.
if mod_req:
file_name.write("%s = %s\n\n" % (mod_name, MOD_BASE))
- # Set the module to enabled if it is not required.
+ # Set the module to enabled if it is not required.
else:
file_name.write("%s = %s\n\n" % (mod_name, MOD_ENABLED))
@@ -222,7 +222,7 @@ def int_cmp_func(a):
"""
return a["interface_name"]
-
+
def temp_cmp_func(a):
"""
Return the template name to sort/compare on.
@@ -295,7 +295,7 @@ def format_txt_desc(node):
desc_buf += desc.data + "\n"
elif desc.nodeName == "p":
desc_buf += desc.firstChild.data + "\n"
- for chld in desc.childNodes:
+ for chld in desc.childNodes:
if chld.nodeName == "ul":
desc_buf += "\n"
for li in chld.getElementsByTagName("li"):
@@ -359,7 +359,7 @@ def gen_docs(doc, working_dir, templatedir):
try:
os.chdir(working_dir)
except:
- error("Could not chdir to target directory")
+ error("Could not chdir to target directory")
#arg, i have to go through this dom tree ahead of time to build up the menus
@@ -401,12 +401,12 @@ def gen_docs(doc, working_dir, templatedir):
body_args = { "menu" : menu_buf,
"content" : content_buf }
-
+
index_file = mod_layer + ".html"
index_fh = open(index_file, "w")
body_tpl = pyplate.Template(bodydata)
body_tpl.execute(index_fh, body_args)
- index_fh.close()
+ index_fh.close()
menu = gen_doc_menu(None, module_list)
menu_args = { "menulist" : menu,
@@ -486,10 +486,10 @@ def gen_docs(doc, working_dir, templatedir):
"interface_parameters" : interface_parameters,
"mod_name": mod_name,
"mod_layer" : mod_layer })
- interfaces.sort(key=int_cmp_func)
+ interfaces.sort(key=int_cmp_func)
interface_tpl = pyplate.Template(intdata)
interface_buf = interface_tpl.execute_string({"interfaces" : interfaces})
-
+
# now generate individual template pages
templates = []
@@ -533,7 +533,7 @@ def gen_docs(doc, working_dir, templatedir):
"mod_name": mod_name,
"mod_layer" : mod_layer })
- templates.sort(key=temp_cmp_func)
+ templates.sort(key=temp_cmp_func)
template_tpl = pyplate.Template(templatedata)
template_buf = template_tpl.execute_string({"templates" : templates})
@@ -584,7 +584,7 @@ def gen_docs(doc, working_dir, templatedir):
tunables.sort(key=tun_cmp_func)
tunable_tpl = pyplate.Template(tundata)
tunable_buf = tunable_tpl.execute_string({"tunables" : tunables})
-
+
menu = gen_doc_menu(mod_layer, module_list)
@@ -611,7 +611,7 @@ def gen_docs(doc, working_dir, templatedir):
boolean_buf = None
module_args = { "mod_layer" : mod_layer,
- "mod_name" : mod_name,
+ "mod_name" : mod_name,
"mod_summary" : mod_summary,
"mod_desc" : mod_desc,
"mod_req" : mod_req,
@@ -625,20 +625,20 @@ def gen_docs(doc, working_dir, templatedir):
body_args = { "menu" : menu_buf,
"content" : module_buf }
-
+
module_file = mod_layer + "_" + mod_name + ".html"
module_fh = open(module_file, "w")
body_tpl = pyplate.Template(bodydata)
body_tpl.execute(module_fh, body_args)
module_fh.close()
-
+
menu = gen_doc_menu(None, module_list)
menu_args = { "menulist" : menu,
"mod_layer" : None }
menu_tpl = pyplate.Template(menudata)
menu_buf = menu_tpl.execute_string(menu_args)
-
+
#build the interface index
all_interfaces.sort(key=int_cmp_func)
interface_tpl = pyplate.Template(intlistdata)
@@ -647,7 +647,7 @@ def gen_docs(doc, working_dir, templatedir):
int_fh = open(int_file, "w")
body_tpl = pyplate.Template(bodydata)
- body_args = { "menu" : menu_buf,
+ body_args = { "menu" : menu_buf,
"content" : interface_buf }
body_tpl.execute(int_fh, body_args)
@@ -662,7 +662,7 @@ def gen_docs(doc, working_dir, templatedir):
temp_fh = open(temp_file, "w")
body_tpl = pyplate.Template(bodydata)
- body_args = { "menu" : menu_buf,
+ body_args = { "menu" : menu_buf,
"content" : template_buf }
body_tpl.execute(temp_fh, body_args)
@@ -702,7 +702,7 @@ def gen_docs(doc, working_dir, templatedir):
temp_fh = open(temp_file, "w")
body_tpl = pyplate.Template(bodydata)
- body_args = { "menu" : menu_buf,
+ body_args = { "menu" : menu_buf,
"content" : tunable_buf }
body_tpl.execute(temp_fh, body_args)
@@ -731,7 +731,7 @@ def gen_docs(doc, working_dir, templatedir):
body_tpl.execute(global_bool_fh, body_args)
global_bool_fh.close()
-
+
#build the boolean index
all_booleans = all_booleans + global_bool
all_booleans.sort(key=bool_cmp_func)
@@ -741,7 +741,7 @@ def gen_docs(doc, working_dir, templatedir):
temp_fh = open(temp_file, "w")
body_tpl = pyplate.Template(bodydata)
- body_args = { "menu" : menu_buf,
+ body_args = { "menu" : menu_buf,
"content" : boolean_buf }
body_tpl.execute(temp_fh, body_args)
@@ -805,7 +805,7 @@ for opt, val in opts:
templatedir = val
doc = read_policy_xml(xmlfile)
-
+
if booleans:
namevalue_list = []
if os.path.exists(booleans):
@@ -834,7 +834,7 @@ if modules:
conf = open(modules, 'r')
except:
error("Could not open modules file for reading")
- namevalue_list = get_conf(conf)
+ namevalue_list = get_conf(conf)
conf.close()
try:
@@ -844,5 +844,5 @@ if modules:
gen_module_conf(doc, conf, namevalue_list)
conf.close()
-if docsdir:
+if docsdir:
gen_docs(doc, docsdir, templatedir)
diff --git a/support/segenxml.py b/support/segenxml.py
index 5f4f7d01..ab8ee520 100644
--- a/support/segenxml.py
+++ b/support/segenxml.py
@@ -90,7 +90,7 @@ def getModuleXML(file_name):
module_buf = []
# Infer the module name, which is the base of the file name.
- module_buf.append("<module name=\"%s\" filename=\"%s\">\n"
+ module_buf.append("<module name=\"%s\" filename=\"%s\">\n"
% (os.path.splitext(os.path.split(file_name)[-1])[0], module_if))
temp_buf = []
@@ -157,7 +157,7 @@ def getModuleXML(file_name):
# Add default summaries and parameters so that the
# DTD is happy.
else:
- warning ("unable to find XML for %s %s()" % (groups[0], groups[1]))
+ warning ("unable to find XML for %s %s()" % (groups[0], groups[1]))
module_buf.append("<summary>\n")
module_buf.append("Summary is missing!\n")
module_buf.append("</summary>\n")
diff --git a/support/selinux-policy-refpolicy.spec b/support/selinux-policy-refpolicy.spec
index 55b422f0..f06d2e79 100644
--- a/support/selinux-policy-refpolicy.spec
+++ b/support/selinux-policy-refpolicy.spec
@@ -22,7 +22,7 @@ BuildRequires: python >= 2.6
BuildRequires: libsepol >= 2.1.4
BuildRequires: libsemanage >= 2.0.29
BuildRequires: m4 make gcc
-Obsoletes: policy
+Obsoletes: policy
%description
SELinux Reference Policy - modular.
diff --git a/support/selinux-refpolicy-sources.spec.skel b/support/selinux-refpolicy-sources.spec.skel
index 8973bc71..8a6dbe2e 100644
--- a/support/selinux-refpolicy-sources.spec.skel
+++ b/support/selinux-refpolicy-sources.spec.skel
@@ -3,7 +3,7 @@
%define FILE_CON ${POLICYDIR}/contexts/files/file_contexts
%define FC_PRE ${FILE_CON}.pre
-Summary: SELinux Reference Policy configuration source files
+Summary: SELinux Reference Policy configuration source files
Name: selinux-refpolicy-sources
Version: REFPOL_VERSION
Release: 1
diff --git a/support/set_bools_tuns.awk b/support/set_bools_tuns.awk
index cedc19b7..4eaa82d3 100644
--- a/support/set_bools_tuns.awk
+++ b/support/set_bools_tuns.awk
@@ -5,7 +5,7 @@ BEGIN {
FS="="
}
-/^[[:blank:]]*[[:alpha:]]+/{
+/^[[:blank:]]*[[:alpha:]]+/{
gsub(/[[:blank:]]*/,"")
print "define(`"$1"_conf',`"$2"')"
}