summaryrefslogtreecommitdiff
path: root/sshpty.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2005-06-17 12:44:30 +0000
committerColin Watson <cjwatson@debian.org>2005-06-17 12:44:30 +0000
commit4c2d1c67cea075107aadaa6d81fe456687c69e67 (patch)
tree4f31813c8306491c908948bd75254912385ed651 /sshpty.c
parentbed4bb0fe9380912ecb90e5f918bce8825ec0a38 (diff)
Manoj Srivastava:
- Added SELinux capability, and turned it on be default. Added restorecon calls in preinst and postinst (should not matter if the machine is not SELinux aware). By and large, the changes made should have no effect unless the rules file calls --with-selinux; and even then there should be no performance hit for machines not actively running SELinux. - Modified the preinst and postinst to call restorecon to set the security context for the generated public key files. - Added a comment to /etc/pam.d/ssh to indicate that an SELinux system may want to also include pam_selinux.so.
Diffstat (limited to 'sshpty.c')
-rw-r--r--sshpty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sshpty.c b/sshpty.c
index efd1dfefa..71b8daa0d 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -22,6 +22,8 @@ RCSID("$OpenBSD: sshpty.c,v 1.12 2004/06/21 17:36:31 avsm Exp $");
22#include "log.h" 22#include "log.h"
23#include "misc.h" 23#include "misc.h"
24 24
25#include "selinux.h"
26
25#ifdef HAVE_PTY_H 27#ifdef HAVE_PTY_H
26# include <pty.h> 28# include <pty.h>
27#endif 29#endif
@@ -200,6 +202,8 @@ pty_setowner(struct passwd *pw, const char *tty)
200 fatal("stat(%.100s) failed: %.100s", tty, 202 fatal("stat(%.100s) failed: %.100s", tty,
201 strerror(errno)); 203 strerror(errno));
202 204
205 setup_selinux_pty(pw->pw_name, tty);
206
203 if (st.st_uid != pw->pw_uid || st.st_gid != gid) { 207 if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
204 if (chown(tty, pw->pw_uid, gid) < 0) { 208 if (chown(tty, pw->pw_uid, gid) < 0) {
205 if (errno == EROFS && 209 if (errno == EROFS &&