From 5b502423fc47d301e4ac163c1ddbcfd552e38e0a Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 10 Feb 2022 16:57:33 +0000 Subject: [PATCH] look for the login class in both login.conf and login.conf.d/${class} ok aja@ --- etc/rc.d/rc.subr | 6 +++--- usr.sbin/rcctl/rcctl.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index 2af4887d182..ed2adb6515e 100644 --- a/etc/rc.d/rc.subr +++ b/etc/rc.d/rc.subr @@ -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 # Copyright (c) 2010, 2011 Ingo Schwarze @@ -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 diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index ec1e478fad1..e36248a89a6 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -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 # Copyright (c) 2014 Ingo Schwarze @@ -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 -- 2.20.1