Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #13057] Masking white-spaces in command arguments #562

Open
icinga-migration opened this issue Nov 7, 2016 · 2 comments

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/13057

Created by darmagan on 2016-11-07 08:27:34 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-11-07 08:27:34 +00:00 (in Redmine)


Hello,

It would be a nice feature, if it would be possible to mask white spaces in command arguments.

Example: check_win.exe "C:/Program Files/Icinga2/sbin/" would be two arguments. And it wouldn't be necessary to go the indirect way trough creating Agruments/Fields etc.

Regards


Relations:

@icinga-migration
Copy link
Author

Updated by mfrosch on 2016-11-07 12:56:48 +00:00

  • Duplicates set to 13056

@flohoff
Copy link

flohoff commented Apr 25, 2018

This is getting an issue for us. We like to distribute ps1 scripts with the agent on Windows but c:\Windows\Program Files is not usable. We tried stuff like \s \ and stuff but this all does not work.

I had a look at the code and essentially a1aea38 broke the issue as it splits the whole command at spaces. I fail to see the reason why:

library/Director/Objects/IcingaCommand.php
162 }
163 $parts = preg_split('/\s+/', $command, -1, PREG_SPLIT_NO_EMPTY);
164 array_unshift($parts, c::alreadyRendered($prefix . c::renderString(array_shift($parts))));
165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants