diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | README.privsep | 6 | ||||
-rw-r--r-- | sshpty.c | 14 |
3 files changed, 24 insertions, 2 deletions
@@ -1,5 +1,9 @@ | |||
1 | 20020514 | 1 | 20020514 |
2 | - (stevesk) [README.privsep] PAM+privsep works with Solaris 8. | 2 | - (stevesk) [README.privsep] PAM+privsep works with Solaris 8. |
3 | - (tim) [sshpty.c] set tty modes when allocating old style bsd ptys to | ||
4 | match what newer style ptys have when allocated. Based on a patch by | ||
5 | Roger Cornelius <rac@tenzing.org> | ||
6 | [README.privsep] UnixWare 7 and OpenUNIX 8 work. | ||
3 | 7 | ||
4 | 20020513 | 8 | 20020513 |
5 | - (stevesk) add initial README.privsep | 9 | - (stevesk) add initial README.privsep |
@@ -582,4 +586,4 @@ | |||
582 | - (stevesk) entropy.c: typo in debug message | 586 | - (stevesk) entropy.c: typo in debug message |
583 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ | 587 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ |
584 | 588 | ||
585 | $Id: ChangeLog,v 1.2115 2002/05/13 23:31:09 stevesk Exp $ | 589 | $Id: ChangeLog,v 1.2116 2002/05/14 00:07:18 tim Exp $ |
diff --git a/README.privsep b/README.privsep index 51a4e3f6b..aed43acd0 100644 --- a/README.privsep +++ b/README.privsep | |||
@@ -20,6 +20,9 @@ prepare the privsep preauth environment: | |||
20 | # groupadd sshd | 20 | # groupadd sshd |
21 | # useradd -g sshd sshd | 21 | # useradd -g sshd sshd |
22 | 22 | ||
23 | If you are on UnixWare 7 or OpenUNIX 8 do this additional step. | ||
24 | # ln /usr/lib/.ns.so /usr/lib/ns.so.1 | ||
25 | |||
23 | /var/empty should not contain any files. | 26 | /var/empty should not contain any files. |
24 | 27 | ||
25 | configure supports the following options to change the default | 28 | configure supports the following options to change the default |
@@ -31,6 +34,7 @@ privsep user and chroot directory: | |||
31 | Privsep requires operating system support for file descriptor passing | 34 | Privsep requires operating system support for file descriptor passing |
32 | and mmap(MAP_ANON). | 35 | and mmap(MAP_ANON). |
33 | 36 | ||
37 | OpenSSH is known to function with privsep on UnixWare 7 and OpenUNIX 8 | ||
34 | PAM-enabled OpenSSH is known to function with privsep on Linux and | 38 | PAM-enabled OpenSSH is known to function with privsep on Linux and |
35 | Solaris 8. It does not function on HP-UX with a trusted system | 39 | Solaris 8. It does not function on HP-UX with a trusted system |
36 | configuration. PAMAuthenticationViaKbdInt does not function with | 40 | configuration. PAMAuthenticationViaKbdInt does not function with |
@@ -51,4 +55,4 @@ process 1005 is the sshd process listening for new connections. | |||
51 | process 6917 is the privileged monitor process, 6919 is the user owned | 55 | process 6917 is the privileged monitor process, 6919 is the user owned |
52 | sshd process and 6921 is the shell process. | 56 | sshd process and 6921 is the shell process. |
53 | 57 | ||
54 | $Id: README.privsep,v 1.2 2002/05/13 23:31:10 stevesk Exp $ | 58 | $Id: README.privsep,v 1.3 2002/05/14 00:07:18 tim Exp $ |
@@ -199,6 +199,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) | |||
199 | const char *ptyminors = "0123456789abcdef"; | 199 | const char *ptyminors = "0123456789abcdef"; |
200 | int num_minors = strlen(ptyminors); | 200 | int num_minors = strlen(ptyminors); |
201 | int num_ptys = strlen(ptymajors) * num_minors; | 201 | int num_ptys = strlen(ptymajors) * num_minors; |
202 | struct termios tio; | ||
202 | 203 | ||
203 | for (i = 0; i < num_ptys; i++) { | 204 | for (i = 0; i < num_ptys; i++) { |
204 | snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors], | 205 | snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors], |
@@ -223,6 +224,19 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) | |||
223 | close(*ptyfd); | 224 | close(*ptyfd); |
224 | return 0; | 225 | return 0; |
225 | } | 226 | } |
227 | /* set tty modes to a sane state for broken clients */ | ||
228 | if (tcgetattr(*ptyfd, &tio) < 0) | ||
229 | log("Getting tty modes for pty failed: %.100s", strerror(errno)); | ||
230 | else { | ||
231 | tio.c_lflag |= (ECHO | ISIG | ICANON); | ||
232 | tio.c_oflag |= (OPOST | ONLCR); | ||
233 | tio.c_iflag |= ICRNL; | ||
234 | |||
235 | /* Set the new modes for the terminal. */ | ||
236 | if (tcsetattr(*ptyfd, TCSANOW, &tio) < 0) | ||
237 | log("Setting tty modes for pty failed: %.100s", strerror(errno)); | ||
238 | } | ||
239 | |||
226 | return 1; | 240 | return 1; |
227 | } | 241 | } |
228 | return 0; | 242 | return 0; |