Skip to content

Conversation

@lightswitch05
Copy link
Contributor

Fix Traceback in /srv/dshield/fwlogparser.py

Checking my syslog, I noticed a traceback in fwlogparser.py:

Mar 16 00:00:22 honeypot systemd[1]: Starting Rotate log files...
Mar 16 00:00:23 honeypot logrotate[19452]: Traceback (most recent call last):
Mar 16 00:00:23 honeypot logrotate[19452]:   File "/srv/dshield/fwlogparser.py", line 106, in <module>
Mar 16 00:00:23 honeypot logrotate[19452]:     d = DshieldSubmit('')
Mar 16 00:00:23 honeypot logrotate[19452]:   File "/srv/dshield/DShield.py", line 49, in __init__
Mar 16 00:00:23 honeypot logrotate[19452]:     self.readconfig(filename)
Mar 16 00:00:23 honeypot logrotate[19452]:   File "/srv/dshield/DShield.py", line 162, in readconfig
Mar 16 00:00:23 honeypot logrotate[19452]:     if os.path.isfile(home+'/etc/dshield.ini'):
Mar 16 00:00:23 honeypot logrotate[19452]: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Mar 16 00:00:23 honeypot logrotate[19452]: error: error running non-shared prerotate script for /var/log/dshield.log of '/var/log/dshield.log
Mar 16 00:00:23 honeypot logrotate[19452]: '

By providing a default value for HOME, the type error will no longer occur.

Correct log reference when using an alt config

I have not experienced issues with this fix, but I noticed that s is never defined. I corrected the log message to use the value from args['-c']

@lightswitch05
Copy link
Contributor Author

lightswitch05 commented Mar 26, 2020

Any comments on this change?

@jullrich
Copy link
Contributor

sorry I missed these. So thanks for the "bump". Just approved them / merging them now.

@jullrich jullrich merged commit 057c932 into DShield-ISC:master Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants