From owner-svn-src-all@freebsd.org Wed Feb 5 04:27:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7488023F69D; Wed, 5 Feb 2020 04:27:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48C7p91X6qz43ZJ; Wed, 5 Feb 2020 04:27:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F7DB25037; Wed, 5 Feb 2020 04:27:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0154Rjjm079161; Wed, 5 Feb 2020 04:27:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0154RjGB079160; Wed, 5 Feb 2020 04:27:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002050427.0154RjGB079160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Feb 2020 04:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357562 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 357562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2020 04:27:45 -0000 Author: kevans Date: Wed Feb 5 04:27:44 2020 New Revision: 357562 URL: https://svnweb.freebsd.org/changeset/base/357562 Log: init(8): set environment variables from the "daemon" class as well Specifically, when running /etc/rc. This allows one to specify via login.conf(5) an environment that should be used when running services to ease, e.g., setting up env vars for an HTTP proxy consistently across cron and services alike. Future changes will extend cron(8)/service(8) to use environment vars pecified in login.conf(5) as well to promote a more cohesive experience. This is a part of D21481. Submitted by: Andrew Gierth Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Wed Feb 5 04:27:08 2020 (r357561) +++ head/sbin/init/init.c Wed Feb 5 04:27:44 2020 (r357562) @@ -2053,6 +2053,7 @@ setprocresources(const char *cname) login_cap_t *lc; if ((lc = login_getclassbyname(cname, NULL)) != NULL) { setusercontext(lc, (struct passwd*)NULL, 0, + LOGIN_SETENV | LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETLOGINCLASS | LOGIN_SETCPUMASK); login_close(lc);