<div dir="ltr">Hello,<div><br></div><div>As a followup to this, as promised I've made some tests against a few ssh servers (with diferent HW/OS specs) and it looks like there's plenty of room for environment variables.. This are my findings regarding maximun command line string which can be passed to ssh sucessfully.</div>

<div><br></div><div><ul><li>CentOS-6.x/x86-64 => 256k</li><li>CentOS-5.x/x86-64 => 128k</li><li>Debian-Wheezy/x86-64 => 128k</li><li>Old-Fedora/Sparc64 => 256k</li><li>Solaris 10/Sparc64 => 256k</li><li>Linux-dd-wrt/arm => 128k</li>

</ul><div>My tests where done my issuing the following command => ssh <a href="mailto:root@172.21.204.103">root@172.21.204.103</a> "DUMMY=$(perl -e 'print "a"x1024') ls", increasing the length of 'a' string until reaching the point at which the server would refuse to execute the command with: Argument list too long</div>

</div><div><br></div><div>Nontheless, I am still keen on not exposing all proxmox's configuration settings (which looks a bit of a kludge) and only expose a selected subset as PMXVARs.</div><div><br></div><div>Regards</div>

<div>Pablo</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 19, 2014 at 10:42 AM, Pablo Ruiz <span dir="ltr"><<a href="mailto:pablo.ruiz@gmail.com" target="_blank">pablo.ruiz@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi,</p>
<p dir="ltr">While using command line arguments may seem the obvious approach, in the end this is a more fragile mechanism to pass data to helper script, as backward/forward compatbility would be harder to achieve once new 'data' is to be passed.</p>



<p dir="ltr">Command line arguments need to respect ordering, or define strict argument names which should be parsed by the helper by means of getopt or similar method. However, environment is a bit more flexible, and we can add more variables as needed, just as CGI, AGI, OCF, and other similar protocol do.</p>



<p dir="ltr">Regarding the size limits of environment/ssh-full-command-string, I will try to make a few test over various environments and get back to the list. If notable restrictions are found, I can restrict the variables passed to only those really needed.. instead of passing all config parameters.</p>

<div class="HOEnZb"><div class="h5">

<div class="gmail_quote">On Mar 19, 2014 7:17 AM, "Daniel Hunsaker" <<a href="mailto:danhunsaker@gmail.com" target="_blank">danhunsaker@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<p dir="ltr">> Just curious - how long are the command lines this patch generates?</p>
<p dir="ltr">Well, it looks like that depends on a number of things.  The entire contents of %$scfg are added to the environment as PMXCFG_*, the full path to the ssh key is added to the environment as PMXVAR_SSHKEY (and then added again as an argument to ssh, if ssh is used), and depending on the command being issued, you either get PMXVAR_LUNDEV or PMXVAR_LUNUUID, set to the appropriate value.  So potentially quite long - certainly longer than I expected on my first glance through the code.</p>




</blockquote></div>
</div></div></blockquote></div><br></div>