mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 15:54:22 +02:00
- markus@cvs.openbsd.org 2002/02/03 17:53:25
[auth1.c serverloop.c session.c session.h] don't use channel_input_channel_request and callback use new server_input_channel_req() instead: server_input_channel_req does generic request parsing on server side session_input_channel_req handles just session specific things now ok djm@
This commit is contained in:
parent
664d6b9a8e
commit
c7ef63dd41
@ -54,6 +54,13 @@
|
|||||||
- markus@cvs.openbsd.org 2002/01/31 15:00:05
|
- markus@cvs.openbsd.org 2002/01/31 15:00:05
|
||||||
[serverloop.c]
|
[serverloop.c]
|
||||||
no need for WNOHANG; ok stevesk@
|
no need for WNOHANG; ok stevesk@
|
||||||
|
- markus@cvs.openbsd.org 2002/02/03 17:53:25
|
||||||
|
[auth1.c serverloop.c session.c session.h]
|
||||||
|
don't use channel_input_channel_request and callback
|
||||||
|
use new server_input_channel_req() instead:
|
||||||
|
server_input_channel_req does generic request parsing on server side
|
||||||
|
session_input_channel_req handles just session specific things now
|
||||||
|
ok djm@
|
||||||
|
|
||||||
20020130
|
20020130
|
||||||
- (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
|
- (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
|
||||||
@ -7456,4 +7463,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1814 2002/02/05 01:20:16 djm Exp $
|
$Id: ChangeLog,v 1.1815 2002/02/05 01:21:42 djm Exp $
|
||||||
|
3
auth1.c
3
auth1.c
@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: auth1.c,v 1.34 2001/12/28 14:50:54 markus Exp $");
|
RCSID("$OpenBSD: auth1.c,v 1.35 2002/02/03 17:53:25 markus Exp $");
|
||||||
|
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "rsa.h"
|
#include "rsa.h"
|
||||||
@ -22,6 +22,7 @@ RCSID("$OpenBSD: auth1.c,v 1.34 2001/12/28 14:50:54 markus Exp $");
|
|||||||
#include "servconf.h"
|
#include "servconf.h"
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "auth.h"
|
#include "auth.h"
|
||||||
|
#include "channels.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "uidswap.h"
|
#include "uidswap.h"
|
||||||
|
33
serverloop.c
33
serverloop.c
@ -35,7 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: serverloop.c,v 1.96 2002/01/31 15:00:05 markus Exp $");
|
RCSID("$OpenBSD: serverloop.c,v 1.97 2002/02/03 17:53:25 markus Exp $");
|
||||||
|
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
@ -902,8 +902,6 @@ server_request_session(char *ctype)
|
|||||||
channel_free(c);
|
channel_free(c);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
channel_register_callback(c->self, SSH2_MSG_CHANNEL_REQUEST,
|
|
||||||
session_input_channel_req, (void *)0);
|
|
||||||
channel_register_cleanup(c->self, session_close_by_channel);
|
channel_register_cleanup(c->self, session_close_by_channel);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
@ -1004,6 +1002,33 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
|
|||||||
}
|
}
|
||||||
xfree(rtype);
|
xfree(rtype);
|
||||||
}
|
}
|
||||||
|
static void
|
||||||
|
server_input_channel_req(int type, u_int32_t seq, void *ctxt)
|
||||||
|
{
|
||||||
|
Channel *c;
|
||||||
|
int id, reply, success = 0;
|
||||||
|
char *rtype;
|
||||||
|
|
||||||
|
id = packet_get_int();
|
||||||
|
rtype = packet_get_string(NULL);
|
||||||
|
reply = packet_get_char();
|
||||||
|
|
||||||
|
debug("server_input_channel_req: channel %d request %s reply %d",
|
||||||
|
id, rtype, reply);
|
||||||
|
|
||||||
|
if ((c = channel_lookup(id)) == NULL)
|
||||||
|
packet_disconnect("server_input_channel_req: "
|
||||||
|
"unknown channel %d", id);
|
||||||
|
if (c->type == SSH_CHANNEL_LARVAL || c->type == SSH_CHANNEL_OPEN)
|
||||||
|
success = session_input_channel_req(c, rtype);
|
||||||
|
if (reply) {
|
||||||
|
packet_start(success ?
|
||||||
|
SSH2_MSG_CHANNEL_SUCCESS : SSH2_MSG_CHANNEL_FAILURE);
|
||||||
|
packet_put_int(c->remote_id);
|
||||||
|
packet_send();
|
||||||
|
}
|
||||||
|
xfree(rtype);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
server_init_dispatch_20(void)
|
server_init_dispatch_20(void)
|
||||||
@ -1017,7 +1042,7 @@ server_init_dispatch_20(void)
|
|||||||
dispatch_set(SSH2_MSG_CHANNEL_OPEN, &server_input_channel_open);
|
dispatch_set(SSH2_MSG_CHANNEL_OPEN, &server_input_channel_open);
|
||||||
dispatch_set(SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, &channel_input_open_confirmation);
|
dispatch_set(SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, &channel_input_open_confirmation);
|
||||||
dispatch_set(SSH2_MSG_CHANNEL_OPEN_FAILURE, &channel_input_open_failure);
|
dispatch_set(SSH2_MSG_CHANNEL_OPEN_FAILURE, &channel_input_open_failure);
|
||||||
dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &channel_input_channel_request);
|
dispatch_set(SSH2_MSG_CHANNEL_REQUEST, &server_input_channel_req);
|
||||||
dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust);
|
dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust);
|
||||||
dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request);
|
dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request);
|
||||||
/* client_alive */
|
/* client_alive */
|
||||||
|
37
session.c
37
session.c
@ -33,7 +33,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: session.c,v 1.122 2002/01/29 22:46:41 markus Exp $");
|
RCSID("$OpenBSD: session.c,v 1.123 2002/02/03 17:53:25 markus Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "ssh1.h"
|
#include "ssh1.h"
|
||||||
@ -1729,28 +1729,18 @@ session_auth_agent_req(Session *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
session_input_channel_req(int id, void *arg)
|
session_input_channel_req(Channel *c, const char *rtype)
|
||||||
{
|
{
|
||||||
u_int len;
|
|
||||||
int reply;
|
|
||||||
int success = 0;
|
int success = 0;
|
||||||
char *rtype;
|
|
||||||
Session *s;
|
Session *s;
|
||||||
Channel *c;
|
|
||||||
|
|
||||||
rtype = packet_get_string(&len);
|
if ((s = session_by_channel(c->self)) == NULL) {
|
||||||
reply = packet_get_char();
|
log("session_input_channel_req: no session %d req %.100s",
|
||||||
|
c->self, rtype);
|
||||||
s = session_by_channel(id);
|
return 0;
|
||||||
if (s == NULL)
|
}
|
||||||
fatal("session_input_channel_req: channel %d: no session", id);
|
debug("session_input_channel_req: session %d req %s", s->self, rtype);
|
||||||
c = channel_lookup(id);
|
|
||||||
if (c == NULL)
|
|
||||||
fatal("session_input_channel_req: channel %d: bad channel", id);
|
|
||||||
|
|
||||||
debug("session_input_channel_req: session %d channel %d request %s reply %d",
|
|
||||||
s->self, id, rtype, reply);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a session is in LARVAL state until a shell, a command
|
* a session is in LARVAL state until a shell, a command
|
||||||
@ -1774,14 +1764,7 @@ session_input_channel_req(int id, void *arg)
|
|||||||
if (strcmp(rtype, "window-change") == 0) {
|
if (strcmp(rtype, "window-change") == 0) {
|
||||||
success = session_window_change_req(s);
|
success = session_window_change_req(s);
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
if (reply) {
|
|
||||||
packet_start(success ?
|
|
||||||
SSH2_MSG_CHANNEL_SUCCESS : SSH2_MSG_CHANNEL_FAILURE);
|
|
||||||
packet_put_int(c->remote_id);
|
|
||||||
packet_send();
|
|
||||||
}
|
|
||||||
xfree(rtype);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: session.h,v 1.13 2001/10/10 22:18:47 markus Exp $ */
|
/* $OpenBSD: session.h,v 1.14 2002/02/03 17:53:25 markus Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
||||||
@ -29,7 +29,7 @@
|
|||||||
void do_authenticated(Authctxt *);
|
void do_authenticated(Authctxt *);
|
||||||
|
|
||||||
int session_open(Authctxt*, int);
|
int session_open(Authctxt*, int);
|
||||||
void session_input_channel_req(int, void *);
|
int session_input_channel_req(Channel *, const char *);
|
||||||
void session_close_by_pid(pid_t, int);
|
void session_close_by_pid(pid_t, int);
|
||||||
void session_close_by_channel(int, void *);
|
void session_close_by_channel(int, void *);
|
||||||
void session_destroy_all(void);
|
void session_destroy_all(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user