[Bro-Dev] #443: Print a message instead of a stack trace when debug.log can't be opened

Bro Tracker bro at tracker.icir.org
Wed Apr 27 16:07:15 PDT 2011


#443: Print a message instead of a stack trace when debug.log can't be opened
-----------------------------+-------------------
 Reporter:  leres            |      Owner:  robin
     Type:  Feature Request  |     Status:  new
 Priority:  Low              |  Milestone:
Component:  BroControl       |    Version:  1.5.3
 Keywords:                   |
-----------------------------+-------------------
 If you start bro and neither the spool directory nor the current working
 directory are writable, you get a stack trace:

 {{{
 dig 16 # service bro start
 Traceback (most recent call last):
   File "/usr/local/bin/broctl", line 712, in <module>
     Config = config.Configuration("etc/broctl.cfg", BroBase, BroDist,
 Version, StandAlone)
   File "/usr/local/lib/broctl/BroControl/config.py", line 203, in __init__
     (success, output) = execute.captureCmd("uname")
   File "/usr/local/lib/broctl/BroControl/execute.py", line 200, in
 captureCmd
     util.debug(1, "%-10s %s" % ("[local]", cmdline))
   File "/usr/local/lib/broctl/BroControl/util.py", line 78, in debug
     DebugOut = open("debug.log", "a")
 IOError: [Errno 13] Permission denied: 'debug.log'
 }}}

 It would be a lot more helpful to print the paths; see attached patch to
 BroControl/util.py which results in:

 {{{
 dig 17 # service bro start
 warning: Can't open /usr/local/spool/debug.log: Permission denied
 error: Can't open /debug.log: Permission denied
 }}}

-- 
Ticket URL: <http://tracker.icir.org/bro/ticket/443>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list