[ 
https://bro-tracker.atlassian.net/browse/BIT-1232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17600#comment-17600
 ] 

Jon Siwek commented on BIT-1232:
--------------------------------

{quote}
root@lubuntu:/exercises/BroCon14/analyzers# bro -e "GridFTP::size_threshold = 
1000;"
error in <command line>, line 1: const is not a modifiable lvalue 
(GridFTP::size_threshold)
{quote}

Yes, that's correct behavior because the variable is const w/ &redef and so can 
only be re-assigned via redef.

{quote}
and then to do it right...
root@lubuntu:/exercises/BroCon14/analyzers# bro -e "redef 
GridFTP::size_threshold = 1000;"
internal warning in <command line>, line 1: Can't document redef of 
GridFTP::size_threshold, lookup of <command line> failed
Neither work.
{quote}

This way does work -- it emits a warning not an error.  The warning isn't 
anything to worry about, so I'll work on silencing that since there's nothing 
wrong about what you're doing here.


{quote}
However...
root@lubuntu:/exercises/BroCon14/analyzers# bro "GridFTP::size_threshold=1000"
root@lubuntu:/exercises/BroCon14/analyzers# cat blah.bro
redef GridFTP::size_threshold = 1000;
root@lubuntu:/exercises/BroCon14/analyzers# bro blah.bro
root@lubuntu:/exercises/BroCon14/analyzers#
All fine. The redef from the command line is the interesting part.
{quote}

Yeah, that's an alternative/convenience way to implicitly supply redefs via the 
command line (arbitrary code would need to use -e, but "identifier=expr" 
arguments on the command line are treated as if you mean to do a redef).

> Command line script execution has limitations
> ---------------------------------------------
>
>                 Key: BIT-1232
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1232
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>    Affects Versions: 2.3
>            Reporter: Tim Yardley
>
> root@lubuntu:/exercises/BroCon14/analyzers# bro -e "GridFTP::size_threshold = 
> 1000;"
> error in <command line>, line 1: const is not a modifiable lvalue 
> (GridFTP::size_threshold)
> and then to do it right...
> root@lubuntu:/exercises/BroCon14/analyzers# bro -e "redef 
> GridFTP::size_threshold = 1000;"
> internal warning in <command line>, line 1: Can't document redef of 
> GridFTP::size_threshold, lookup of <command line> failed
> Neither work.
> However...
> root@lubuntu:/exercises/BroCon14/analyzers# bro "GridFTP::size_threshold=1000"
> root@lubuntu:/exercises/BroCon14/analyzers# cat blah.bro
> redef GridFTP::size_threshold = 1000;
> root@lubuntu:/exercises/BroCon14/analyzers# bro blah.bro
> root@lubuntu:/exercises/BroCon14/analyzers#
> All fine. The redef from the command line is the interesting part.



--
This message was sent by Atlassian JIRA
(v6.4-OD-03-010#64001)
_______________________________________________
bro-dev mailing list
[email protected]
http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev

Reply via email to