Bug 214366 - dns/openmdns: don't use hardcoded interface
Summary: dns/openmdns: don't use hardcoded interface
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-09 19:30 UTC by Dave Cottlehuber
Modified: 2016-11-09 21:21 UTC (History)
0 users

See Also:
jbeich: maintainer-feedback+


Attachments
v1 patch (1.12 KB, text/plain)
2016-11-09 19:30 UTC, Dave Cottlehuber
no flags Details
v2 patch (1.09 KB, patch)
2016-11-09 20:03 UTC, Dave Cottlehuber
jbeich: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Cottlehuber freebsd_committer freebsd_triage 2016-11-09 19:30:33 UTC
Created attachment 176824 [details]
v1 patch

# issue

hardcodes em0 as the interface and provides no knob to swap this.

https://svnweb.freebsd.org/ports/head/dns/openmdns/files/mdnsd.in?view=markup#l16

# fix

- add a knob
- set lo0 as a risk-free default

I couldn't think of a better option, considering http://securityaffairs.co/wordpress/35607/hacking/mdns-amplify-ddos-attack.html although I have no idea if openmdns is at risk here.
Comment 1 Dave Cottlehuber freebsd_committer freebsd_triage 2016-11-09 20:03:41 UTC
Created attachment 176828 [details]
v2 patch

It seems ${name}_flags is already appended into command_args automatically.
v2 patch does the right thing when no parameters are set or when flags are set.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-11-09 20:21:39 UTC
A commit references this bug:

Author: jbeich
Date: Wed Nov  9 20:21:05 UTC 2016
New revision: 425803
URL: https://svnweb.freebsd.org/changeset/ports/425803

Log:
  dns/openmdns: fix interface selection in rc.d

  - Don't append default interface when /etc/rc.conf has mdnsd_flags
  - Switch to lo0 as a more predictable (but less useful) default interface

  PR:		214366
  Submitted by:	Dave Cottlehuber <dch@skunkwerks.at>

Changes:
  head/dns/openmdns/Makefile
  head/dns/openmdns/files/mdnsd.in
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-11-09 21:13:46 UTC
A commit references this bug:

Author: jbeich
Date: Wed Nov  9 21:13:13 UTC 2016
New revision: 425807
URL: https://svnweb.freebsd.org/changeset/ports/425807

Log:
  dns/openmdns: document rc.d minimally

  PR:		214366

Changes:
  head/dns/openmdns/Makefile
  head/dns/openmdns/files/mdnsd.in
Comment 4 Jan Beich freebsd_committer freebsd_triage 2016-11-09 21:15:59 UTC
Thanks. Landed. em0 by default was based on OpenBSD port[1] but lo0 is more likely to be present on a system. I've added comments to rc.d script rather than a generic pkg-message.

[1] http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/net/openmdns/pkg/mdnsd.rc
    http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/net/openmdns/pkg/README