naemon / naemon-core

Networks, Applications and Event Monitor
http://www.naemon.io/
GNU General Public License v2.0
151 stars 63 forks source link

use dynamic sized command line buffer #431

Closed sni closed 1 year ago

sni commented 1 year ago

Previously we used a fixed size 8k buffer when parsing command line arguments. This sounds much, but there are command lines bigger than 8k and they are simply cut off without any warning.

Instead we use a dynamic sized buffer with the size of the raw command now.

(while on it, fixing the crazy indent)

sni commented 1 year ago

that's right, but in my case i had command with very long arguments like example_command!some very long arg!other arg and it was cut off, if the argument was more than 8k.

jacobbaungard commented 1 year ago

You had a single argument that was above 8k bytes!?

sni commented 1 year ago

right, basically a tarball of a folder as base64 encoded string :-) I know, not the usual usecase, but naemon should either work or throw an error :-)

nook24 commented 1 year ago

When I first read the title I figured it would be the total check_command (expanded/non expanded) that we change, so I guess just make sure to note in the changelog that it's the size of the individual command line args that can now be longer.

Honestly, I was also testing the total check command length first^^

sni commented 1 year ago

sorry for the confusion :-) i will try to make the changelog entry more clear.

thanks for the review.