summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-10-28 14:19:58 +1100
committerDamien Miller <djm@mindrot.org>2000-10-28 14:19:58 +1100
commit69b69aa50d0effadc8b7e9c564f7a2ee223ac6b5 (patch)
tree4aea8b2b116123812ade69ae73fde80fee8e0f41 /session.c
parentc05e01875bab590584f51bbeb464dd23c64f27fa (diff)
- (djm) Sync with OpenBSD:
- markus@cvs.openbsd.org 2000/10/16 15:46:32 [ssh.1] fixes from pekkas@netcore.fi - markus@cvs.openbsd.org 2000/10/17 14:28:11 [atomicio.c] return number of characters processed; ok deraadt@ - markus@cvs.openbsd.org 2000/10/18 12:04:02 [atomicio.c] undo - markus@cvs.openbsd.org 2000/10/18 12:23:02 [scp.c] replace atomicio(read,...) with read(); ok deraadt@ - markus@cvs.openbsd.org 2000/10/18 12:42:00 [session.c] restore old record login behaviour - deraadt@cvs.openbsd.org 2000/10/19 10:41:13 [auth-skey.c] fmt string problem in unused code - provos@cvs.openbsd.org 2000/10/19 10:45:16 [sshconnect2.c] don't reference freed memory. okay deraadt@ - markus@cvs.openbsd.org 2000/10/21 11:04:23 [canohost.c] typo, eramore@era-t.ericsson.se; ok niels@ - markus@cvs.openbsd.org 2000/10/23 13:31:55 [cipher.c] non-alignment dependent swap_bytes(); from simonb@wasabisystems.com/netbsd - markus@cvs.openbsd.org 2000/10/26 12:38:28 [compat.c] add older vandyke products - markus@cvs.openbsd.org 2000/10/27 01:32:19 [channels.c channels.h clientloop.c serverloop.c session.c] [ssh.c util.c] enable non-blocking IO on channels, and tty's (except for the client ttys). - markus@cvs.openbsd.org 2000/10/27 01:48:22 channels.c channels.h clientloop.c deny agent/x11 forwarding unless requested; thanks to jwl@pobox.com
Diffstat (limited to 'session.c')
-rw-r--r--session.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/session.c b/session.c
index 4325ed3a4..4b58131a7 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.40 2000/10/15 14:14:01 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.42 2000/10/27 07:32:18 markus Exp $");
37 37
38#include "xmalloc.h" 38#include "xmalloc.h"
39#include "ssh.h" 39#include "ssh.h"
@@ -119,7 +119,7 @@ void session_pty_cleanup(Session *s);
119void session_proctitle(Session *s); 119void session_proctitle(Session *s);
120void do_exec_pty(Session *s, const char *command, struct passwd * pw); 120void do_exec_pty(Session *s, const char *command, struct passwd * pw);
121void do_exec_no_pty(Session *s, const char *command, struct passwd * pw); 121void do_exec_no_pty(Session *s, const char *command, struct passwd * pw);
122void do_login(Session *s); 122void do_login(Session *s, const char *command);
123 123
124void 124void
125do_child(const char *command, struct passwd * pw, const char *term, 125do_child(const char *command, struct passwd * pw, const char *term,
@@ -627,8 +627,8 @@ do_exec_pty(Session *s, const char *command, struct passwd * pw)
627 close(ttyfd); 627 close(ttyfd);
628 628
629 /* record login, etc. similar to login(1) */ 629 /* record login, etc. similar to login(1) */
630 if (command == NULL && !options.use_login) 630 if (!(options.use_login && command == NULL))
631 do_login(s); 631 do_login(s, command);
632 632
633 /* Do common processing for the child, such as execing the command. */ 633 /* Do common processing for the child, such as execing the command. */
634 do_child(command, pw, s->term, s->display, s->auth_proto, 634 do_child(command, pw, s->term, s->display, s->auth_proto,
@@ -684,7 +684,7 @@ get_remote_name_or_ip(void)
684 684
685/* administrative, login(1)-like work */ 685/* administrative, login(1)-like work */
686void 686void
687do_login(Session *s) 687do_login(Session *s, const char *command)
688{ 688{
689 FILE *f; 689 FILE *f;
690 char *time_string; 690 char *time_string;
@@ -731,7 +731,9 @@ do_login(Session *s)
731 } 731 }
732#endif 732#endif
733 733
734 /* Done if .hushlogin exists. */ 734 /* Done if .hushlogin exists or a command given. */
735 if (command != NULL)
736 return;
735 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir); 737 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
736#ifdef HAVE_LOGIN_CAP 738#ifdef HAVE_LOGIN_CAP
737 if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0) 739 if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0)
@@ -1778,7 +1780,8 @@ session_set_fds(Session *s, int fdin, int fdout, int fderr)
1778 fatal("no channel for session %d", s->self); 1780 fatal("no channel for session %d", s->self);
1779 channel_set_fds(s->chanid, 1781 channel_set_fds(s->chanid,
1780 fdout, fdin, fderr, 1782 fdout, fdin, fderr,
1781 fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ); 1783 fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ,
1784 1);
1782} 1785}
1783 1786
1784void 1787void