diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2019-09-02 13:55:31 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2019-09-02 13:55:31 +0000 |
commit | ebea9e6d8f77c87a59383f58566b1c27fed232b3 (patch) | |
tree | 1ac22166b5e169007cc32c7ec6b126be155572e7 /lib | |
parent | 82adf9ad56a68585f1db25111d661dc1d32e1346 (diff) | |
download | src-ebea9e6d8f77c87a59383f58566b1c27fed232b3.tar.gz src-ebea9e6d8f77c87a59383f58566b1c27fed232b3.zip |
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
Notes
Notes:
svn path=/head/; revision=351699
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libutil/login_class.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index ceee5c8912f7..532b2bed3059 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -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 *pwd, uid_t uid, unsigned in 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 *pwd, uid_t uid, unsigned in /* 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 |