Skip to content

Commit 7e2fb21

Browse files
Merge pull request #3084 from craigcomstock/ent-13530/3.24
Fixed cfruncommand for Windows causing "Too many arguments" error (3.24)
2 parents 00fc1ec + cd85eb3 commit 7e2fb21

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
3.24.3:
2+
- Fixed cfruncommand for Windows causing "Too many arguments" error (ENT-13530)
23
- Added dmidecode to well known paths for Red Hat (ENT-12988)
34
- Added recommendation about nfs server and consistent use of root dot
45
(ENT-13223)

controls/cf_serverd.cf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,18 @@ body server control
6868

6969
allowusers => { @(def.control_server_allowusers) };
7070

71+
# In 3.10 the quotation is properly closed when EOF is reached. It is left
72+
# open so that arguments (like -K and --remote-bundles) can be appended.
73+
# 3.10.x does not automatically append -I -Dcfruncommand
74+
7175
windows::
72-
cfruncommand => "$(sys.cf_agent) -I -D cf_runagent_initiated -f \"$(sys.update_policy_path)\" &
73-
$(sys.cf_agent) -I -D cf_runagent_initiated";
7476

75-
!windows::
77+
# /s removes the first and last quote characters and aids in specifying paths with surrounding quotes
78+
cfruncommand => "$(def.cf_runagent_shell) /s /c \"
79+
$(sys.cf_agent) -I -D cf_runagent_initiated -f $(sys.update_policy_path) &
80+
$(sys.cf_agent) -I -D cf_runagent_initiated";
7681

77-
# In 3.10 the quotation is properly closed when EOF is reached. It is left
78-
# open so that arguments (like -K and --remote-bundles) can be appended.
79-
# 3.10.x does not automatically append -I -Dcfruncommand
82+
!windows::
8083

8184
cfruncommand => "$(def.cf_runagent_shell) -c \'
8285
$(sys.cf_agent) -I -D cf_runagent_initiated -f $(sys.update_policy_path) ;
@@ -172,7 +175,7 @@ bundle server mpf_default_access_rules()
172175
shortcut => "hub_cmdb",
173176
admit_keys => { $(connection.key) };
174177

175-
!windows::
178+
any::
176179
"$(def.cf_runagent_shell)" -> { "ENT-6673" }
177180
handle => "server_access_grant_access_shell_cmd",
178181
comment => "Grant access to shell for cfruncommand",

controls/def.cf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,12 @@ bundle common def
523523
comment => "Define path to shell used by cf-runagent",
524524
handle => "common_def_vars_solaris_cf_runagent_shell";
525525

526+
windows::
527+
"cf_runagent_shell"
528+
string => "${sys.winsysdir}${const.dirsep}cmd.exe",
529+
comment => "Define path to shell used by cf-runagent",
530+
handle => "common_def_vars_windows_cf_runagent_shell";
531+
526532
!(windows|solaris)::
527533
"cf_runagent_shell"
528534
string => "/bin/sh",

0 commit comments

Comments
 (0)