Displaying 2 results from an estimated 2 matches for "setup_limits".
2018 Nov 29
2
Where to implement user limit settings ?
Hello,
I'm trying to implement setting of user limits (ulimit) in sshd. I'm
not using PAM so I need it in the sshd itself. The task is very simple -
just to put one line calling setup_limits(pw); and link with -lshadow.
But the problem is, where to put this line. I did it in session.c,
in do_child(), like this:
#ifdef HAVE_OSF_SIA
session_setup_sia(pw, s->ttyfd == -1 ? NULL : s->tty);
if (!check_quietlogin(s, command))
do_motd();
#else /* HAVE_O...
2001 Feb 08
0
openssh2.3.0p1 and /etc/limits
...*/
+ if (deflimits[0] == '\0') /* no default limits */
+ return 0;
+ strcpy(limits, deflimits); /* use the default limits */
+ }
+ return do_user_limits(limits, uname);
+}
+
+#endif /* LIMITS */
+
+/*
+ * set the process nice, ulimit, and umask from the password file entry
+ */
+
+void setup_limits(const struct passwd *info) {
+ char *cp;
+ int i;
+ long l;
+
+ if (info->pw_uid) if (setup_user_limits(info->pw_name) & LOGIN_ERROR_LOGIN) {
+ sleep(2);
+ exit(1);
+ }
+}
diff -N -u openssh-2.3.0p1.orig/session.c openssh-2.3.0p1/session.c
--- openssh-2.3.0p1.orig/session.c Wed Feb...