[Bug 266052] libucl: ctld fails to start when including nonexistent globs

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 26 Aug 2022 16:11:20 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266052

            Bug ID: 266052
           Summary: libucl: ctld fails to start when including nonexistent
                    globs
           Product: Base System
           Version: 13.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: asomers@FreeBSD.org

In UCL mode (ctld -u), ctl.conf may contains ".include" directives to include
other files, and these may be globs ".include(glob=true)".  But if the glob
matches nothing, then parsing the config file will fail, and ctld will fail to
start.  For example:

root@MYSERVER:~ # service ctld start
Starting ctld.
ctld: unable to parse configuration file /etc/ctl.conf: (null): No such file or
directory
ctld: configuration error; exiting
/etc/rc.d/ctld: WARNING: failed to start ctld
root@MYSERVER:~ # cat /etc/ctl.conf
pidfile /var/run/ctld.pid
portal-group pg0 {
     discovery-auth-group no-authentication
     listen 0.0.0.0:3260
}

lun {
        .include(glob=true) "/etc/ctl.d/lun/*"
}

target {
        .include(glob=true) "/etc/ctl.d/target/*"
}

In this case the /etc/ctl.d/lun and /etc/ctl.d/target directories exist but are
empty.

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