From 94731a9251c383678de85f42ef1b9a00ca0aec76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 27 Apr 2006 09:16:11 +0000 Subject: [PATCH] Read limits from limits.conf, patch from Daniel Ahlin on non-root login. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17301 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/rsh/rshd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/appl/rsh/rshd.c b/appl/rsh/rshd.c index f23a29b2e..82233b0f1 100644 --- a/appl/rsh/rshd.c +++ b/appl/rsh/rshd.c @@ -32,10 +32,14 @@ */ #include "rsh_locl.h" +#include "login_locl.h" RCSID("$Id$"); int login_access( struct passwd *user, char *from); +int +read_limits_conf(const char *file, const struct passwd *pwd); + enum auth_method auth_method; @@ -824,6 +828,12 @@ doit (void) syslog(LOG_ERR, "setpcred() failure: %m"); #endif /* HAVE_SETPCRED */ + /* Apply limits if not root */ + if(pwd->pw_uid != 0) { + const char *file = _PATH_LIMITS_CONF; + read_limits_conf(file, pwd); + } + if (initgroups (pwd->pw_name, pwd->pw_gid) < 0) fatal (s, "initgroups", "Login incorrect.");