client/tools/rhncfg/actions/ModeController.py | 3 ++
client/tools/rhncfg/actions/ModeControllerCreator.py | 4 +--
client/tools/rhncfg/actions/Modes.py | 12 ++++++++++
client/tools/rhncfg/actions/configfiles.py | 3 ++
client/tools/rhncfg/actions/rhn-actions-control.py | 6 +++++
java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java | 2 -
6 files changed, 27 insertions(+), 3 deletions(-)
New commits:
commit d8740eee2c2a60ac385ea2e1d2c26a3c063d14b6
Author: Marcelo Moreira de Mello <mmello(a)redhat.com>
Date: Thu Jul 21 17:09:36 2011 -0300
508936 - rhn-actions-control honor the allowed-actions/scripts/run for remote
commands
diff --git a/client/tools/rhncfg/actions/ModeController.py
b/client/tools/rhncfg/actions/ModeController.py
index 9de0b41..1548175 100644
--- a/client/tools/rhncfg/actions/ModeController.py
+++ b/client/tools/rhncfg/actions/ModeController.py
@@ -47,6 +47,9 @@ class ModeController:
for m in self.mode_list.keys():
self.mode_list[m].on()
+ if self.mode_list['all'].is_on():
+ self.mode_list['all'].off()
+
#Turn off all of the modes.
def all_off(self):
for m in self.mode_list.keys():
diff --git a/client/tools/rhncfg/actions/ModeControllerCreator.py
b/client/tools/rhncfg/actions/ModeControllerCreator.py
index 75dc860..ae7822a 100644
--- a/client/tools/rhncfg/actions/ModeControllerCreator.py
+++ b/client/tools/rhncfg/actions/ModeControllerCreator.py
@@ -56,9 +56,9 @@ def get_controller_creator():
def get_run_controller_creator():
if string.find(sys.platform, 'sunos') > -1:
- mode_list = [Modes.SolarisRunMode()]
+ mode_list = [Modes.SolarisRunMode(), Modes.SolarisRunAllMode()]
else:
- mode_list = [Modes.RunMode()]
+ mode_list = [Modes.RunMode(), Modes.RunAllMode()]
controller = ModeControllerCreator(mode_list=mode_list)
return controller
diff --git a/client/tools/rhncfg/actions/Modes.py b/client/tools/rhncfg/actions/Modes.py
index 3523a57..fefeda74 100644
--- a/client/tools/rhncfg/actions/Modes.py
+++ b/client/tools/rhncfg/actions/Modes.py
@@ -119,6 +119,12 @@ class RunMode(ConfigFilesBaseMode):
self.name = "run"
self.ph.set_rhn_root("/etc/sysconfig/rhn/allowed-actions/script")
+class RunAllMode(ConfigFilesBaseMode):
+ def __init__(self):
+ ConfigFilesBaseMode.__init__(self)
+ self.name = "all"
+ self.ph.set_rhn_root("/etc/sysconfig/rhn/allowed-actions/script")
+
class AllMode(ConfigFilesBaseMode):
def __init__(self):
ConfigFilesBaseMode.__init__(self)
@@ -151,6 +157,12 @@ class SolarisRunMode(ConfigFilesBaseMode):
self.name = "run"
self.ph.set_rhn_root("/opt/redhat/rhn/solaris/etc/sysconfig/rhn/allowed-actions/script")
+class SolarisAllRunMode(ConfigFilesBaseMode):
+ def __init__(self):
+ ConfigFilesBaseMode.__init__(self)
+ self.name = "all"
+
self.ph.set_rhn_root("/opt/redhat/rhn/solaris/etc/sysconfig/rhn/allowed-actions/script")
+
class SolarisAllMode(ConfigFilesBaseMode):
def __init__(self):
ConfigFilesBaseMode.__init__(self)
diff --git a/client/tools/rhncfg/actions/configfiles.py
b/client/tools/rhncfg/actions/configfiles.py
index 76671ab..0b0d6c0 100755
--- a/client/tools/rhncfg/actions/configfiles.py
+++ b/client/tools/rhncfg/actions/configfiles.py
@@ -53,6 +53,9 @@ def _local_permission_check(action_type):
all_structure = atype_structure[:i]
all_structure.append('all')
+ if os.path.exists(os.path.join(_permission_root_dir, "script/all")) and
action_type == "script.run":
+ os.rename(os.path.join(_permission_root_dir,
"script/all"),os.path.join(_permission_root_dir, "script/run"))
+
potential_all_path = apply(os.path.join, all_structure)
if os.path.exists(os.path.join(_permission_root_dir, potential_all_path)):
return 1
diff --git a/client/tools/rhncfg/actions/rhn-actions-control.py
b/client/tools/rhncfg/actions/rhn-actions-control.py
index d295ea5..8c83918 100755
--- a/client/tools/rhncfg/actions/rhn-actions-control.py
+++ b/client/tools/rhncfg/actions/rhn-actions-control.py
@@ -66,6 +66,7 @@ def main():
if options.enable_run:
runcontroller.on('run')
+ runcontroller.off('all')
if options.disable_deploy:
controller.off('deploy')
@@ -85,6 +86,7 @@ def main():
if options.disable_run:
runcontroller.off('run')
+ runcontroller.off('all')
if options.report:
mode_list = ['deploy', 'diff', 'upload',
'mtime_upload']
@@ -97,6 +99,10 @@ def main():
print rstring % (m, status)
status = "disabled"
+ if runcontroller.is_on('all'):
+ runcontroller.off('all')
+ runcontroller.on('run')
+
if runcontroller.is_on('run'):
status = "enabled"
print rstring % ('run', status)
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java
b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java
index 8d96873..4dcc559 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java
@@ -120,7 +120,7 @@ public class KickstartFormatter {
private static final String WGET_RPMS = "wget -P /tmp/rhn_rpms ";
private static final String REMOTE_CMD =
"mkdir -p /etc/sysconfig/rhn/allowed-actions/script" + NEWLINE +
- "touch /etc/sysconfig/rhn/allowed-actions/script/all";
+ "touch /etc/sysconfig/rhn/allowed-actions/script/run";
private static final String CONFIG_CMD =
"mkdir -p /etc/sysconfig/rhn/allowed-actions/configfiles" + NEWLINE +
"touch /etc/sysconfig/rhn/allowed-actions/configfiles/all";
Show replies by date