look for the login class in both login.conf and login.conf.d/${class}
authorrobert <robert@openbsd.org>
Thu, 10 Feb 2022 16:57:33 +0000 (16:57 +0000)
committerrobert <robert@openbsd.org>
Thu, 10 Feb 2022 16:57:33 +0000 (16:57 +0000)
ok aja@

etc/rc.d/rc.subr
usr.sbin/rcctl/rcctl.sh

index 2af4887..ed2adb6 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: rc.subr,v 1.151 2021/11/15 12:56:11 ajacoutot Exp $
+#      $OpenBSD: rc.subr,v 1.152 2022/02/10 16:57:33 robert Exp $
 #
 # Copyright (c) 2010, 2011, 2014-2021 Antoine Jacoutot <ajacoutot@openbsd.org>
 # Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -316,8 +316,8 @@ eval _rctimeout=\${${_name}_timeout}
 eval _rcuser=\${${_name}_user}
 
 # set default values; duplicated in rcctl(8)
-getcap -f /etc/login.conf ${_name} 1>/dev/null 2>&1 && daemon_class=${_name} ||
-       daemon_class=daemon
+getcap -f /etc/login.conf.d/${_name}:/etc/login.conf ${_name} 1>/dev/null 2>&1 && \
+       daemon_class=${_name} || daemon_class=daemon
 [ -z "${daemon_rtable}" ] && daemon_rtable=0
 [ -z "${daemon_timeout}" ] && daemon_timeout=30
 [ -z "${daemon_user}" ] && daemon_user=root
index ec1e478..e36248a 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/ksh
 #
-# $OpenBSD: rcctl.sh,v 1.111 2021/10/23 08:19:27 sthen Exp $
+# $OpenBSD: rcctl.sh,v 1.112 2022/02/10 16:57:33 robert Exp $
 #
 # Copyright (c) 2014, 2015-2021 Antoine Jacoutot <ajacoutot@openbsd.org>
 # Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -274,8 +274,8 @@ svc_get()
                if ! svc_is_meta ${_svc}; then
                        # these are expensive, make sure they are explicitly requested
                        if [ -z "${_var}" -o "${_var}" = "class" ]; then
-                               getcap -f /etc/login.conf ${_svc} 1>/dev/null 2>&1 && \
-                                       daemon_class=${_svc}
+                               getcap -f /etc/login.conf.d/${_svc}:/etc/login.conf \
+                                       ${_svc} 1>/dev/null 2>&1 && daemon_class=${_svc} 
                                [ -z "${daemon_class}" ] && \
                                        daemon_class="$(svc_getdef ${_svc} class)"
                        fi