what is maxcmdlen? $0 len?

Michael Scheidell scheidell at freebsd.org
Thu Jan 26 19:44:28 UTC 2012



On 1/26/12 12:41 PM, Michael Scheidell wrote:
>
>
> On 1/26/12 12:36 PM, rflynn at acsalaska.net wrote:
>> Also, it looks like swatch is creating a temporary script that is
>> actually run, so the status command is not supposed to find it.
>>
>> It's a design issue upstream that you want them to find a better
>> solution for.
>>
> I am thinking:
> either do what SHOULD be done, and in swatch(). check for cmdlen > 
> (x?) and what is x?) and let swatch die.
>
this actually makes more sense, as to the cmdbuflen size.

  len=`echo "0${command} ${swatch_flags} (perl)0" | wc -c`
         if [ $len -ge 255 ];then

takes the command, swatch flags, the (perl) added to end, and two byte 
buffer (the 0).  and if GE 255, then:

either FAIL with err 1 swatch_${i}_flags too long

or set procname = %%LOCALBASE/bin/perl.

this seems to work in all cases.. start/stop/status, one file in 
tail-file, several files in tail-file, etc.



-- 
Michael Scheidell, CTO
o: 561-999-5000
d: 561-948-2259
 >*| *SECNAP Network Security Corporation

    * Best Mobile Solutions Product of 2011
    * Best Intrusion Prevention Product
    * Hot Company Finalist 2011
    * Best Email Security Product
    * Certified SNORT Integrator



More information about the freebsd-perl mailing list