Skip to content

Commit 568c8c9

Browse files
Merge pull request #3085 from craigcomstock/ent-13530/3.21
Fixed cfruncommand for Windows causing "Too many arguments" error (3.21)
2 parents 4ea1287 + 52c635d commit 568c8c9

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.21.8:
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) ;
@@ -163,7 +166,7 @@ bundle server mpf_default_access_rules()
163166
shortcut => "hub_cmdb",
164167
admit_keys => { $(connection.key) };
165168

166-
!windows::
169+
any::
167170
"$(def.cf_runagent_shell)" -> { "ENT-6673" }
168171
handle => "server_access_grant_access_shell_cmd",
169172
comment => "Grant access to shell for cfruncommand",

controls/def.cf

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

455+
windows::
456+
"cf_runagent_shell"
457+
string => "${sys.winsysdir}${const.dirsep}cmd.exe",
458+
comment => "Define path to shell used by cf-runagent",
459+
handle => "common_def_vars_windows_cf_runagent_shell";
460+
455461
!(windows|solaris)::
456462
"cf_runagent_shell"
457463
string => "/bin/sh",

0 commit comments

Comments
 (0)