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
This commit is contained in:
Love Hörnquist Åstrand
2006-04-27 09:16:11 +00:00
parent 97d0c9dd3c
commit 94731a9251

View File

@@ -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.");