Bug #19472
openSmart Class Parameter adding \r to strings and issues with ""s
Description
In adding Smart Parameters to some classes for saz\sudo I found an interesting, and error causing, behaviors.
1. When entering into a smart parameter for a string it shows the double quotes in the string
"# Comment
Cmnd_Alias SOMERULE = /bin/false
testuser ALL NOPASSWD: SOMERULE"
If this is overriden to be
_"# CommentCmnd_Alias SOMERULE = /bin/false
testuser ALL NOPASSWD: SOMERULE
- Another Comment"_
The puppet run fails with syntax error messages for the lines where the smart parameter was overridden. A puppet catalog run against the host on the master shows:
"mysmartvar": "\"# Comment\r\nCmnd_Alias SOMERULE = /bin/false\r\ntestuser ALL NOPASSWD: SOMERULE\r\n# Another Comment*\"*\r\n"
This of course isn't valid syntax for sudoers which wants- Comment
Cmnd_Alias SOMERULE = /bin/false
testusers ALL NOPASSWD: SOMERULE - Another Comment
IF the comments are taken off, the rule is passed mostly correctly. Unfortunately that leads to second issue.
2. Smart Parameter Strings had \r\n appended to end of line instead of only \n.
Continuing with the above example:
When the smart parameter isn't overridden the parameter in the catalog is:
"mysmartvar": "# Comment\nCmnd_Alias SOMERULE = /bin/false\ntestuser ALL NOPASSWD: SOMERULE\n# Another Comment\n"
Just clicking override and removing the quotes, to work around #1 above, the string sent to the host becomes:
"mysmartvar": "# Comment\r\nCmnd_Alias SOMERULE = /bin/false\r\ntestuser ALL NOPASSWD: SOMERULE\r\n# Another Comment\r\n"
This results in the sudoers line become Windows/Dos formatted:
_# Comment*^M*Cmnd_Alias SOMERULE = /bin/false*^M*
testuser ALL NOPASSWD: SOMERULE*$M*
- Another Comment*^M*
_
To ensure this was not a browser / OS issue. I used Firefox from my Linux Master and Chrome from my Windows desktop. The ^M was added in both cases.
As a workaround I modified the sudo::conf.pp file block from content => $content_real, to content => dos2unix($content_real),.
Unfortunately that modification may not be viable for all Puppet versions / configurations.
Updated by Dominic Cleal over 7 years ago
- Related to Bug #8997: ^M in multi line parameter added
Updated by Amalia Bentley almost 4 years ago
Strings can present strange errors. While I WRITE MY ESSAY I try not to use strings as they can sometimes present errors that should not exist. It's better to find alternatives like a char array.
Updated by Usa Esasy almost 3 years ago
I almost completed my dissertation on time, everything was going smoothly and according to the plan but then
I had major personal problems and couldn’t finish editing. I sent my papers to
essayhub review essayhub review</a> service and they completed it splendidly.
These guys are rescued me and i will recommend this company to all my colleagues!
Updated by karl lager over 2 years ago
Great post! Was interested to read it! Yet I have smth to recommend you as an editor.
It is not easy to find an essay writing service these days. There are so many platforms
that promise superb quality,
fast turnaround, and adherence to your needs yet prove to be unreliable in the long run.
So, take your time to read and to browse the web and to pick a service like custom essay writing company
you really trust and can rely on.
Updated by stefan sterners over 2 years ago
Great post! Was interested to read it! Yet I have smth to recommend you as an editor.
It is not easy to find an essay writing service these days. There are so many platforms
that promise superb quality,
fast turnaround, and adherence to your needs yet prove to be unreliable in the long run.
So, take your time to read and to browse the web and to pick a service like help with writing papers
you really trust and can rely on.
Updated by kevin brow over 2 years ago
I almost completed my dissertation on time, everything was going smoothly and according to the plan but then
I had major personal problems and couldn’t finish editing. I sent my papers to
college essay services service and they completed it splendidly.
These guys are rescued me and i will recommend this company to all my colleagues!