Date: Mon, 2 Sep 2019 13:55:31 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351699 - head/lib/libutil Message-ID: <201909021355.x82DtVvO077667@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <login_cap.h> #include <paths.h> #include <pwd.h> -#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909021355.x82DtVvO077667>