summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-01-08 17:10:11 +0000
committerrwatson <rwatson@FreeBSD.org>2003-01-08 17:10:11 +0000
commit45a362319313bfe4e2ef698d107d34b2db70b769 (patch)
treee8d09659b44fd96649742fca0a890f2be93fad99 /usr.sbin/inetd
parent7033484c0c007cfaa421cb6421a69de8e604d27d (diff)
downloadFreeBSD-src-45a362319313bfe4e2ef698d107d34b2db70b769.zip
FreeBSD-src-45a362319313bfe4e2ef698d107d34b2db70b769.tar.gz
For now, set only the resource limits and process priority associated
with a class, rather than all aspects of the class when switching classes for an inetd service. Because we hard-code /daemon in the current inetd implementation, using SETALL has unfortunate side-effects involving the MAC code, and potentially other credential related settings in the future. This change maintains the DoS-resistent aspects of the class behavior, which is all that is promised in the inetd man page. A larger set of diffs providing more pluggability and configurability was deferred for this more simple approach in the short term. Reviewed by: ache Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r--usr.sbin/inetd/inetd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index ad847fb..d47691e 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -812,7 +812,8 @@ main(int argc, char **argv)
}
#ifdef LOGIN_CAP
if (setusercontext(lc, pwd, pwd->pw_uid,
- LOGIN_SETALL) != 0) {
+ LOGIN_SETRESOURCES | LOGIN_SETPRIORITY)
+ != 0) {
syslog(LOG_ERR,
"%s: can't setusercontext(..%s..): %m",
sep->se_service, sep->se_user);
OpenPOWER on IntegriCloud