Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jan 2023 08:28:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 269198] dns/blocky: running daemon as non-root user is not supported
Message-ID:  <bug-269198-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269198

            Bug ID: 269198
           Summary: dns/blocky: running daemon as non-root user is not
                    supported
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: eduardo@FreeBSD.org
          Reporter: bspiegel100@gmail.com
          Assignee: eduardo@FreeBSD.org
             Flags: maintainer-feedback?(eduardo@FreeBSD.org)

Created attachment 239759
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D239759&action=
=3Dedit
Patch with improved rc.d script

Most rc.d scripts support a standard <service name>_user option in /etc/rc.=
conf
to run the service as the specified user. The rc.d script for dns/blocky
doesn't observe this setting. As a result, it's not possible to run as a us=
er
other than root (blocky documentation recommends using a non-privileged use=
r).

Please see the attached patch for an updated rc script that supports this
option. Thanks for considering!


Steps to Reproduce:

Install dns/blocky, add the following to /etc/rc.conf and run service blocky
start.

    blocky_user=3D"<any user other than root>"
    blocky_enable=3D"YES"


Actual Behavior:

The blocky daemon runs as root regardless of what's in /etc/rc.conf. Tested=
 on
14.0-CURRENT and 13.1-RELEASE with blocky version 0.20_2 (from ports) and
0.20_1 (package).


Expected Behavior:

The blocky daemon should run as the specified user.


Proposed Solution:

The current rc.d script overrides the built-in start_cmd function (which ch=
ecks
for standard options like <name>_user and <name>_chroot). The replacement
function doesn't check these options.

The patch instead defines the command in $command and $command_args vars, a=
dds
handling for file permissions to support non-root users, and does a few min=
or
touch-ups.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269198-7788>