From owner-svn-src-head@freebsd.org Mon Sep 2 13:55:31 2019 Return-Path: Delivered-To: svn-src-head@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 D5A84DE8C3; Mon, 2 Sep 2019 13:55:31 +0000 (UTC) (envelope-from mjg@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 46MWnH5PxTz3HP9; Mon, 2 Sep 2019 13:55:31 +0000 (UTC) (envelope-from mjg@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 9D7971B078; Mon, 2 Sep 2019 13:55:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82DtVGC077668; Mon, 2 Sep 2019 13:55:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82DtVvO077667; Mon, 2 Sep 2019 13:55:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909021355.x82DtVvO077667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 2 Sep 2019 13:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351699 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 351699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 13:55:31 -0000 Author: mjg Date: Mon Sep 2 13:55:31 2019 New Revision: 351699 URL: https://svnweb.freebsd.org/changeset/base/351699 Log: libutil: remove SIGSYS handling from setusercontext It was a workaround for cases where the kernel lacks setloginclass(2), added in the 9.x era. Submitted by: Pawel Biernacki Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Mon Sep 2 12:48:18 2019 (r351698) +++ head/lib/libutil/login_class.c Mon Sep 2 13:55:31 2019 (r351699) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -428,7 +427,6 @@ setusercontext(login_cap_t *lc, const struct passwd *p rlim_t p; mode_t mymask; login_cap_t *llc = NULL; - struct sigaction sa, prevsa; struct rtprio rtp; int error; @@ -521,16 +519,7 @@ setusercontext(login_cap_t *lc, const struct passwd *p /* Inform the kernel about current login class */ if (lc != NULL && lc->lc_class != NULL && (flags & LOGIN_SETLOGINCLASS)) { - /* - * XXX: This is a workaround to fail gracefully in case the kernel - * does not support setloginclass(2). - */ - bzero(&sa, sizeof(sa)); - sa.sa_handler = SIG_IGN; - sigfillset(&sa.sa_mask); - sigaction(SIGSYS, &sa, &prevsa); error = setloginclass(lc->lc_class); - sigaction(SIGSYS, &prevsa, NULL); if (error != 0) { syslog(LOG_ERR, "setloginclass(%s): %m", lc->lc_class); #ifdef notyet