File chcat_imports.patch of Package policycoreutils.25312
Index: policycoreutils-2.5/scripts/chcat
===================================================================
--- policycoreutils-2.5.orig/scripts/chcat
+++ policycoreutils-2.5/scripts/chcat
@@ -22,6 +22,7 @@
# 02111-1307 USA
#
#
+import commands
import subprocess
import sys
import os
@@ -92,7 +93,7 @@ def chcat_user_add(newcat, users):
cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u)
else:
cmd = "semanage login -m -r %s -s %s %s" % (new_serange, user[0], u)
- rc = subprocess.getstatusoutput(cmd)
+ rc = commands.getstatusoutput(cmd)
if rc[0] != 0:
print(rc[1])
errors += 1
@@ -131,7 +132,7 @@ def chcat_add(orig, newcat, objects, log
else:
cat_string = cat
cmd = 'chcon -l %s:%s %s' % (sensitivity, cat_string, f)
- rc = subprocess.getstatusoutput(cmd)
+ rc = commands.getstatusoutput(cmd)
if rc[0] != 0:
print(rc[1])
errors += 1
@@ -172,7 +173,7 @@ def chcat_user_remove(newcat, users):
cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u)
else:
cmd = "semanage login -m -r %s -s %s %s" % (new_serange, user[0], u)
- rc = subprocess.getstatusoutput(cmd)
+ rc = commands.getstatusoutput(cmd)
if rc[0] != 0:
print(rc[1])
errors += 1
@@ -217,7 +218,7 @@ def chcat_remove(orig, newcat, objects,
cmd = 'chcon -l %s %s' % (sensitivity, f)
else:
cmd = 'chcon -l %s:%s %s' % (sensitivity, cat, f)
- rc = subprocess.getstatusoutput(cmd)
+ rc = commands.getstatusoutput(cmd)
if rc[0] != 0:
print(rc[1])
errors += 1
@@ -245,7 +246,7 @@ def chcat_user_replace(newcat, users):
cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u)
else:
cmd = "semanage login -m -r %s -s %s %s" % (new_serange, user[0], u)
- rc = subprocess.getstatusoutput(cmd)
+ rc = commands.getstatusoutput(cmd)
if rc[0] != 0:
print(rc[1])
errors += 1
@@ -268,7 +269,7 @@ def chcat_replace(newcat, objects, login
for f in objects:
cmd = "%s %s" % (cmd, f)
- rc = subprocess.getstatusoutput(cmd)
+ rc = commands.getstatusoutput(cmd)
if rc[0] != 0:
print(rc[1])
errors += 1