<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
29.03.2011 17:28, Dejan Muhamedagic:<br>
<br>
<br>
<blockquote cite="mid:20110329132820.GD3542@squib" type="cite">
<pre wrap="">The fact that the shell has this feature doesn't mean that it
should be misused. It was meant mainly for one-off management
commands (such as "resource stop" or "node standby") and only
very seldom for one-off configuration commands. </pre>
</blockquote>
<br>
Sounds reasonable.<br>
<br>
If you think that the feature should not be misused, there must be
something enforcing your intention. Unfortunately, it's almost late
to restrict command line arguments usage, as it will broke backward
compatibility. <br>
<br>
<blockquote cite="mid:20110329132820.GD3542@squib" type="cite">
<blockquote type="cite">
<pre wrap="">But, unfortunately, the feature is not uniform with interactive shell.
</pre>
</blockquote>
<pre wrap="">
How's that now? I know that many people don't understand how
shell (as in bash) work, but don't understand how crm shell can
work around that. If you have an idea, please speak up.
</pre>
</blockquote>
<br>
I'm not very familiar with crm shell internals, so it's raw idea
only. But, as I've said before, this kind of mistake can be
detected. Look at what we have seen in the very start of the thread:<br>
<br>
><font face="Arial" size="3"><span style="font-size: 12pt;
font-family: Arial;" lang="EN-US"> crm configure primitive
rsa-fencing
stonith:external/ibmrsa params hostname="alpha1 alpha2"
ipaddr=192.168.75.178 userid=USR passwd=PWD type=ibm op monitor
interval="60s"</span></font>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;" lang="EN-US"></span></font><font
face="Arial" size="3"><span style="font-size: 12pt; font-family:
Arial;" lang="EN-US">> The console print the ERROR message:
“ERROR:
rsa-fencing: parameter alpha2 does not exist”<br>
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;" lang="EN-US"><br>
The shell does not give you meaningful explanation of what has
happened. Most nonintrusive change I can imagine would be to
print actual crm command which has caused the error. For
example:<br>
<br>
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;" lang="EN-US">ERROR:
rsa-fencing:
parameter alpha2 does not exist<br>
The command was: configure pr</span></font><font face="Arial"
size="3"><span style="font-size: 12pt; font-family: Arial;"
lang="EN-US">imitive rsa-fencing
stonith:external/ibmrsa params hostname=alpha1 alpha2
ipaddr=192.168.75.178 userid=USR passwd=PWD type=ibm op
monitor
interval=60s<br>
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;" lang="EN-US"><br>
Hopefully the user will quickly notice the difference between
his command and shell's variant.<br>
<br>
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;" lang="EN-US">The
shell can also analyze command line parameters and note that
one of them contains space. It would then suggest user to do
proper shell escaping. But there may be false positives.<br>
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;" lang="EN-US"><br>
The shell can go one step further and analyze it's arguments
to repair lost quotes. If there are many arguments, and there
is an argument without quotes and with space inside, quotes
can be inserted right after first '=' character (if any) and
at the end of the argument. The result may be unreliable,
though. So it's up to you to rate this quirk.</span></font><br>
<font face="Arial" size="3"><span style="font-size: 12pt;
font-family: Arial;" lang="EN-US"></span></font></p>
<p class="MsoNormal"><br>
<font face="Arial" size="3"><span style="font-size: 12pt;
font-family: Arial;" lang="EN-US"></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;" lang="EN-US">--<br>
Pavel Levshin<br>
<br>
</span></font></p>
</body>
</html>