Project

General

Profile

Actions

Bug #2875

closed

improve permission warning

Added by Victor Julien about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:
Beginner, Outreachy

Description

Running Suricata-update with the wrong user gives an ugly backtrace. I think the permissions of the /var/lib/suricata/update/ dir should be checked early and the warning should be prettier.

12/3/2019 -- 11:50:44 - <Warning> -- No suricata application binary found on path.
12/3/2019 -- 11:50:44 - <Info> -- Using Suricata configuration /etc/suricata/suricata.yaml
12/3/2019 -- 11:50:44 - <Info> -- Using /etc/suricata/rules for Suricata provided rules.
12/3/2019 -- 11:50:44 - <Info> -- Using default Suricata version of 4.0.0
12/3/2019 -- 11:50:44 - <Warning> -- No index exists, will use bundled index.
12/3/2019 -- 11:50:44 - <Warning> -- Please run suricata-update update-sources.
12/3/2019 -- 11:50:44 - <Info> -- Fetching https://raw.githubusercontent.com/jasonish/suricata-trafficid/master/rules/traffic-id.rules.
Traceback (most recent call last):    
  File "./bin/suricata-update", line 33, in <module>
    sys.exit(main.main())
  File "/home/victor/sync/devel/suricata-update/suricata/update/main.py", line 1458, in main
    sys.exit(_main())
  File "/home/victor/sync/devel/suricata-update/suricata/update/main.py", line 1312, in _main
    files = load_sources(suricata_version)
  File "/home/victor/sync/devel/suricata-update/suricata/update/main.py", line 997, in load_sources
    Fetch().run(url, files)
  File "/home/victor/sync/devel/suricata-update/suricata/update/main.py", line 395, in run
    fetched = self.fetch(url)
  File "/home/victor/sync/devel/suricata-update/suricata/update/main.py", line 385, in fetch
    raise err
IOError: [Errno 13] Permission denied: '/var/lib/suricata/update/cache/5c25dfc84c3d879cd2f90fda6337b9dd-traffic-id.rules'

Actions

Also available in: Atom PDF