From 8d83ce74cfddfbbac48d82db406029605e451b19 Mon Sep 17 00:00:00 2001 From: millert Date: Wed, 23 Mar 2022 14:39:52 +0000 Subject: [PATCH] setclasscontext: support LOGIN_SETRTABLE too Do not clear LOGIN_SETRTABLE if it is set in flags. OK deraadt@ --- lib/libc/gen/login_cap.3 | 5 +++-- lib/libc/gen/login_cap.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/login_cap.3 b/lib/libc/gen/login_cap.3 index 5e57057b1bd..169c67058b1 100644 --- a/lib/libc/gen/login_cap.3 +++ b/lib/libc/gen/login_cap.3 @@ -29,10 +29,10 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: login_cap.3,v 1.19 2022/03/04 08:47:53 tb Exp $ +.\" $OpenBSD: login_cap.3,v 1.20 2022/03/23 14:39:52 millert Exp $ .\" BSDI $From: login_cap.3,v 1.4 1997/11/07 16:22:27 jch Exp $ .\" -.Dd $Mdocdate: March 4 2022 $ +.Dd $Mdocdate: March 23 2022 $ .Dt LOGIN_GETCLASS 3 .Os .Sh NAME @@ -181,6 +181,7 @@ Only the .Dv LOGIN_SETPATH , .Dv LOGIN_SETPRIORITY , .Dv LOGIN_SETRESOURCES , +.Dv LOGIN_SETRTABLE , and .Dv LOGIN_SETUMASK bits are used diff --git a/lib/libc/gen/login_cap.c b/lib/libc/gen/login_cap.c index 4779f482fff..53e27d7522e 100644 --- a/lib/libc/gen/login_cap.c +++ b/lib/libc/gen/login_cap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login_cap.c,v 1.44 2022/03/20 23:24:03 millert Exp $ */ +/* $OpenBSD: login_cap.c,v 1.45 2022/03/23 14:39:52 millert Exp $ */ /* * Copyright (c) 2000-2004 Todd C. Miller @@ -573,7 +573,7 @@ setclasscontext(char *class, u_int flags) login_cap_t *lc; flags &= LOGIN_SETRESOURCES | LOGIN_SETPRIORITY | LOGIN_SETUMASK | - LOGIN_SETPATH; + LOGIN_SETPATH | LOGIN_SETRTABLE; lc = login_getclass(class); ret = lc ? setusercontext(lc, NULL, 0, flags) : -1; -- 2.20.1