mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
- markus@cvs.openbsd.org 2002/03/19 10:49:35
[auth-krb5.c auth-rh-rsa.c auth.c cipher.c key.c misc.h packet.c session.c sftp-client.c sftp-glob.h sftp.c ssh-add.c ssh.c sshconnect2.c sshd.c ttymodes.c] KNF whitespace
This commit is contained in:
parent
08105192fd
commit
6328ab3989
@ -89,6 +89,11 @@
|
|||||||
- markus@cvs.openbsd.org 2002/03/19 10:35:39
|
- markus@cvs.openbsd.org 2002/03/19 10:35:39
|
||||||
[auth-options.c auth.h session.c session.h sshd.c]
|
[auth-options.c auth.h session.c session.h sshd.c]
|
||||||
clean up prototypes
|
clean up prototypes
|
||||||
|
- markus@cvs.openbsd.org 2002/03/19 10:49:35
|
||||||
|
[auth-krb5.c auth-rh-rsa.c auth.c cipher.c key.c misc.h packet.c session.c
|
||||||
|
sftp-client.c sftp-glob.h sftp.c ssh-add.c ssh.c sshconnect2.c sshd.c
|
||||||
|
ttymodes.c]
|
||||||
|
KNF whitespace
|
||||||
|
|
||||||
20020317
|
20020317
|
||||||
- (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted,
|
- (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted,
|
||||||
@ -7935,4 +7940,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1950 2002/03/22 02:50:06 mouring Exp $
|
$Id: ChangeLog,v 1.1951 2002/03/22 02:54:23 mouring Exp $
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Kerberos v5 authentication and ticket-passing routines.
|
* Kerberos v5 authentication and ticket-passing routines.
|
||||||
*
|
*
|
||||||
* $FreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp $
|
* $FreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
@ -28,7 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: auth-krb5.c,v 1.7 2002/03/16 17:41:25 stevesk Exp $");
|
RCSID("$OpenBSD: auth-krb5.c,v 1.8 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "ssh1.h"
|
#include "ssh1.h"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: auth-rh-rsa.c,v 1.32 2002/03/18 17:50:31 provos Exp $");
|
RCSID("$OpenBSD: auth-rh-rsa.c,v 1.33 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
#include "uidswap.h"
|
#include "uidswap.h"
|
||||||
@ -49,7 +49,7 @@ auth_rhosts_rsa_key_allowed(struct passwd *pw, char *cuser, char *chost,
|
|||||||
chost, _PATH_SSH_SYSTEM_HOSTFILE,
|
chost, _PATH_SSH_SYSTEM_HOSTFILE,
|
||||||
options.ignore_user_known_hosts ? NULL : _PATH_SSH_USER_HOSTFILE);
|
options.ignore_user_known_hosts ? NULL : _PATH_SSH_USER_HOSTFILE);
|
||||||
|
|
||||||
return (host_status == HOST_OK);
|
return (host_status == HOST_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
10
auth.c
10
auth.c
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: auth.c,v 1.38 2002/03/18 03:41:08 provos Exp $");
|
RCSID("$OpenBSD: auth.c,v 1.39 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#ifdef HAVE_LOGIN_H
|
#ifdef HAVE_LOGIN_H
|
||||||
#include <login.h>
|
#include <login.h>
|
||||||
@ -125,17 +125,17 @@ allowed_user(struct passwd * pw)
|
|||||||
/* Return false if user is listed in DenyUsers */
|
/* Return false if user is listed in DenyUsers */
|
||||||
if (options.num_deny_users > 0) {
|
if (options.num_deny_users > 0) {
|
||||||
for (i = 0; i < options.num_deny_users; i++)
|
for (i = 0; i < options.num_deny_users; i++)
|
||||||
if (match_user(pw->pw_name, hostname, ipaddr,
|
if (match_user(pw->pw_name, hostname, ipaddr,
|
||||||
options.deny_users[i])) {
|
options.deny_users[i])) {
|
||||||
log("User %.100s not allowed because listed in DenyUsers",
|
log("User %.100s not allowed because listed in DenyUsers",
|
||||||
pw->pw_name);
|
pw->pw_name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Return false if AllowUsers isn't empty and user isn't listed there */
|
/* Return false if AllowUsers isn't empty and user isn't listed there */
|
||||||
if (options.num_allow_users > 0) {
|
if (options.num_allow_users > 0) {
|
||||||
for (i = 0; i < options.num_allow_users; i++)
|
for (i = 0; i < options.num_allow_users; i++)
|
||||||
if (match_user(pw->pw_name, hostname, ipaddr,
|
if (match_user(pw->pw_name, hostname, ipaddr,
|
||||||
options.allow_users[i]))
|
options.allow_users[i]))
|
||||||
break;
|
break;
|
||||||
/* i < options.num_allow_users iff we break for loop */
|
/* i < options.num_allow_users iff we break for loop */
|
||||||
|
12
cipher.c
12
cipher.c
@ -35,7 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: cipher.c,v 1.53 2002/03/18 17:13:15 markus Exp $");
|
RCSID("$OpenBSD: cipher.c,v 1.54 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -78,17 +78,17 @@ struct Cipher {
|
|||||||
|
|
||||||
/*--*/
|
/*--*/
|
||||||
|
|
||||||
u_int
|
u_int
|
||||||
cipher_blocksize(Cipher *c)
|
cipher_blocksize(Cipher *c)
|
||||||
{
|
{
|
||||||
return (c->block_size);
|
return (c->block_size);
|
||||||
}
|
}
|
||||||
u_int
|
u_int
|
||||||
cipher_keylen(Cipher *c)
|
cipher_keylen(Cipher *c)
|
||||||
{
|
{
|
||||||
return (c->key_len);
|
return (c->key_len);
|
||||||
}
|
}
|
||||||
u_int
|
u_int
|
||||||
cipher_get_number(Cipher *c)
|
cipher_get_number(Cipher *c)
|
||||||
{
|
{
|
||||||
return (c->number);
|
return (c->number);
|
||||||
@ -509,7 +509,7 @@ ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
|
|||||||
rijndael_decrypt(&c->r_ctx, cnow, plain);
|
rijndael_decrypt(&c->r_ctx, cnow, plain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports an IV from the CipherContext required to export the key
|
* Exports an IV from the CipherContext required to export the key
|
||||||
* state back from the unprivileged child to the privileged parent
|
* state back from the unprivileged child to the privileged parent
|
||||||
* process.
|
* process.
|
||||||
@ -612,7 +612,7 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
|
|||||||
memcpy(desc->k2.iv, iv + 8, 8);
|
memcpy(desc->k2.iv, iv + 8, 8);
|
||||||
memcpy(desc->k3.iv, iv + 16, 8);
|
memcpy(desc->k3.iv, iv + 16, 8);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
fatal("%s: bad cipher %d", __FUNCTION__, c->number);
|
fatal("%s: bad cipher %d", __FUNCTION__, c->number);
|
||||||
}
|
}
|
||||||
|
4
key.c
4
key.c
@ -32,7 +32,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: key.c,v 1.42 2002/03/18 17:23:31 markus Exp $");
|
RCSID("$OpenBSD: key.c,v 1.43 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
@ -808,7 +808,7 @@ Key *
|
|||||||
key_demote(Key *k)
|
key_demote(Key *k)
|
||||||
{
|
{
|
||||||
Key *pk;
|
Key *pk;
|
||||||
|
|
||||||
pk = xmalloc(sizeof(*pk));
|
pk = xmalloc(sizeof(*pk));
|
||||||
pk->type = k->type;
|
pk->type = k->type;
|
||||||
pk->flags = k->flags;
|
pk->flags = k->flags;
|
||||||
|
8
misc.h
8
misc.h
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: misc.h,v 1.11 2002/01/24 21:09:25 stevesk Exp $ */
|
/* $OpenBSD: misc.h,v 1.12 2002/03/19 10:49:35 markus Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
@ -26,9 +26,9 @@ struct passwd *pwcopy(struct passwd *);
|
|||||||
|
|
||||||
typedef struct arglist arglist;
|
typedef struct arglist arglist;
|
||||||
struct arglist {
|
struct arglist {
|
||||||
char **list;
|
char **list;
|
||||||
int num;
|
int num;
|
||||||
int nalloc;
|
int nalloc;
|
||||||
};
|
};
|
||||||
void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
|
void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
|
8
packet.c
8
packet.c
@ -37,7 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: packet.c,v 1.91 2002/03/18 17:16:38 markus Exp $");
|
RCSID("$OpenBSD: packet.c,v 1.92 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
@ -173,7 +173,7 @@ packet_connection_is_on_socket(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports an IV from the CipherContext required to export the key
|
* Exports an IV from the CipherContext required to export the key
|
||||||
* state back from the unprivileged child to the privileged parent
|
* state back from the unprivileged child to the privileged parent
|
||||||
* process.
|
* process.
|
||||||
@ -196,7 +196,7 @@ int
|
|||||||
packet_get_keycontext(int mode, u_char *dat)
|
packet_get_keycontext(int mode, u_char *dat)
|
||||||
{
|
{
|
||||||
CipherContext *cc;
|
CipherContext *cc;
|
||||||
|
|
||||||
if (mode == MODE_OUT)
|
if (mode == MODE_OUT)
|
||||||
cc = &send_context;
|
cc = &send_context;
|
||||||
else
|
else
|
||||||
@ -209,7 +209,7 @@ void
|
|||||||
packet_set_keycontext(int mode, u_char *dat)
|
packet_set_keycontext(int mode, u_char *dat)
|
||||||
{
|
{
|
||||||
CipherContext *cc;
|
CipherContext *cc;
|
||||||
|
|
||||||
if (mode == MODE_OUT)
|
if (mode == MODE_OUT)
|
||||||
cc = &send_context;
|
cc = &send_context;
|
||||||
else
|
else
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: session.c,v 1.131 2002/03/19 10:35:39 markus Exp $");
|
RCSID("$OpenBSD: session.c,v 1.132 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "ssh1.h"
|
#include "ssh1.h"
|
||||||
@ -1431,7 +1431,7 @@ session_pty_req(Session *s)
|
|||||||
{
|
{
|
||||||
u_int len;
|
u_int len;
|
||||||
int n_bytes;
|
int n_bytes;
|
||||||
|
|
||||||
if (no_pty_flag) {
|
if (no_pty_flag) {
|
||||||
debug("Allocating a pty not permitted for this authentication.");
|
debug("Allocating a pty not permitted for this authentication.");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
/* XXX: copy between two remote sites */
|
/* XXX: copy between two remote sites */
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sftp-client.c,v 1.27 2002/03/11 03:19:53 itojun Exp $");
|
RCSID("$OpenBSD: sftp-client.c,v 1.28 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
|
#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
@ -449,7 +449,7 @@ do_rm(struct sftp_conn *conn, char *path)
|
|||||||
debug2("Sending SSH2_FXP_REMOVE \"%s\"", path);
|
debug2("Sending SSH2_FXP_REMOVE \"%s\"", path);
|
||||||
|
|
||||||
id = conn->msg_id++;
|
id = conn->msg_id++;
|
||||||
send_string_request(conn->fd_out, id, SSH2_FXP_REMOVE, path,
|
send_string_request(conn->fd_out, id, SSH2_FXP_REMOVE, path,
|
||||||
strlen(path));
|
strlen(path));
|
||||||
status = get_status(conn->fd_in, id);
|
status = get_status(conn->fd_in, id);
|
||||||
if (status != SSH2_FX_OK)
|
if (status != SSH2_FX_OK)
|
||||||
@ -496,8 +496,8 @@ do_stat(struct sftp_conn *conn, char *path, int quiet)
|
|||||||
|
|
||||||
id = conn->msg_id++;
|
id = conn->msg_id++;
|
||||||
|
|
||||||
send_string_request(conn->fd_out, id,
|
send_string_request(conn->fd_out, id,
|
||||||
conn->version == 0 ? SSH2_FXP_STAT_VERSION_0 : SSH2_FXP_STAT,
|
conn->version == 0 ? SSH2_FXP_STAT_VERSION_0 : SSH2_FXP_STAT,
|
||||||
path, strlen(path));
|
path, strlen(path));
|
||||||
|
|
||||||
return(get_decode_stat(conn->fd_in, id, quiet));
|
return(get_decode_stat(conn->fd_in, id, quiet));
|
||||||
@ -727,7 +727,7 @@ send_read_request(int fd_out, u_int id, u_int64_t offset, u_int len,
|
|||||||
char *handle, u_int handle_len)
|
char *handle, u_int handle_len)
|
||||||
{
|
{
|
||||||
Buffer msg;
|
Buffer msg;
|
||||||
|
|
||||||
buffer_init(&msg);
|
buffer_init(&msg);
|
||||||
buffer_clear(&msg);
|
buffer_clear(&msg);
|
||||||
buffer_put_char(&msg, SSH2_FXP_READ);
|
buffer_put_char(&msg, SSH2_FXP_READ);
|
||||||
@ -737,7 +737,7 @@ send_read_request(int fd_out, u_int id, u_int64_t offset, u_int len,
|
|||||||
buffer_put_int(&msg, len);
|
buffer_put_int(&msg, len);
|
||||||
send_msg(fd_out, &msg);
|
send_msg(fd_out, &msg);
|
||||||
buffer_free(&msg);
|
buffer_free(&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
||||||
@ -754,7 +754,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
|||||||
u_int id;
|
u_int id;
|
||||||
u_int len;
|
u_int len;
|
||||||
u_int64_t offset;
|
u_int64_t offset;
|
||||||
TAILQ_ENTRY(request) tq;
|
TAILQ_ENTRY(request) tq;
|
||||||
};
|
};
|
||||||
TAILQ_HEAD(reqhead, request) requests;
|
TAILQ_HEAD(reqhead, request) requests;
|
||||||
struct request *req;
|
struct request *req;
|
||||||
@ -820,7 +820,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
|||||||
|
|
||||||
/* Send some more requests */
|
/* Send some more requests */
|
||||||
while (num_req < max_req) {
|
while (num_req < max_req) {
|
||||||
debug3("Request range %llu -> %llu (%d/%d)",
|
debug3("Request range %llu -> %llu (%d/%d)",
|
||||||
(unsigned long long)offset,
|
(unsigned long long)offset,
|
||||||
(unsigned long long)offset + buflen - 1,
|
(unsigned long long)offset + buflen - 1,
|
||||||
num_req, max_req);
|
num_req, max_req);
|
||||||
@ -831,7 +831,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
|||||||
offset += buflen;
|
offset += buflen;
|
||||||
num_req++;
|
num_req++;
|
||||||
TAILQ_INSERT_TAIL(&requests, req, tq);
|
TAILQ_INSERT_TAIL(&requests, req, tq);
|
||||||
send_read_request(conn->fd_out, req->id, req->offset,
|
send_read_request(conn->fd_out, req->id, req->offset,
|
||||||
req->len, handle, handle_len);
|
req->len, handle, handle_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -862,7 +862,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
|||||||
case SSH2_FXP_DATA:
|
case SSH2_FXP_DATA:
|
||||||
data = buffer_get_string(&msg, &len);
|
data = buffer_get_string(&msg, &len);
|
||||||
debug3("Received data %llu -> %llu",
|
debug3("Received data %llu -> %llu",
|
||||||
(unsigned long long)req->offset,
|
(unsigned long long)req->offset,
|
||||||
(unsigned long long)req->offset + len - 1);
|
(unsigned long long)req->offset + len - 1);
|
||||||
if (len > req->len)
|
if (len > req->len)
|
||||||
fatal("Received more data than asked for "
|
fatal("Received more data than asked for "
|
||||||
@ -884,13 +884,13 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
|||||||
/* Resend the request for the missing data */
|
/* Resend the request for the missing data */
|
||||||
debug3("Short data block, re-requesting "
|
debug3("Short data block, re-requesting "
|
||||||
"%llu -> %llu (%2d)",
|
"%llu -> %llu (%2d)",
|
||||||
(unsigned long long)req->offset + len,
|
(unsigned long long)req->offset + len,
|
||||||
(unsigned long long)req->offset +
|
(unsigned long long)req->offset +
|
||||||
req->len - 1, num_req);
|
req->len - 1, num_req);
|
||||||
req->id = conn->msg_id++;
|
req->id = conn->msg_id++;
|
||||||
req->len -= len;
|
req->len -= len;
|
||||||
req->offset += len;
|
req->offset += len;
|
||||||
send_read_request(conn->fd_out, req->id,
|
send_read_request(conn->fd_out, req->id,
|
||||||
req->offset, req->len, handle, handle_len);
|
req->offset, req->len, handle, handle_len);
|
||||||
/* Reduce the request size */
|
/* Reduce the request size */
|
||||||
if (len < buflen)
|
if (len < buflen)
|
||||||
@ -921,7 +921,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
|||||||
fatal("Transfer complete, but requests still in queue");
|
fatal("Transfer complete, but requests still in queue");
|
||||||
|
|
||||||
if (read_error) {
|
if (read_error) {
|
||||||
error("Couldn't read from remote file \"%s\" : %s",
|
error("Couldn't read from remote file \"%s\" : %s",
|
||||||
remote_path, fx2txt(status));
|
remote_path, fx2txt(status));
|
||||||
do_close(conn, handle, handle_len);
|
do_close(conn, handle, handle_len);
|
||||||
} else if (write_error) {
|
} else if (write_error) {
|
||||||
@ -974,7 +974,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
|
|||||||
u_int id;
|
u_int id;
|
||||||
u_int len;
|
u_int len;
|
||||||
u_int64_t offset;
|
u_int64_t offset;
|
||||||
TAILQ_ENTRY(outstanding_ack) tq;
|
TAILQ_ENTRY(outstanding_ack) tq;
|
||||||
};
|
};
|
||||||
TAILQ_HEAD(ackhead, outstanding_ack) acks;
|
TAILQ_HEAD(ackhead, outstanding_ack) acks;
|
||||||
struct outstanding_ack *ack;
|
struct outstanding_ack *ack;
|
||||||
@ -1063,7 +1063,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
|
|||||||
if (ack == NULL)
|
if (ack == NULL)
|
||||||
fatal("Unexpected ACK %u", id);
|
fatal("Unexpected ACK %u", id);
|
||||||
|
|
||||||
if (id == startid || len == 0 ||
|
if (id == startid || len == 0 ||
|
||||||
id - ackid >= conn->num_requests) {
|
id - ackid >= conn->num_requests) {
|
||||||
buffer_clear(&msg);
|
buffer_clear(&msg);
|
||||||
get_msg(conn->fd_in, &msg);
|
get_msg(conn->fd_in, &msg);
|
||||||
@ -1093,7 +1093,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
|
|||||||
close(local_fd);
|
close(local_fd);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
debug3("In write loop, ack for %u %d bytes at %llu",
|
debug3("In write loop, ack for %u %d bytes at %llu",
|
||||||
ack->id, ack->len, (unsigned long long)ack->offset);
|
ack->id, ack->len, (unsigned long long)ack->offset);
|
||||||
++ackid;
|
++ackid;
|
||||||
free(ack);
|
free(ack);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: sftp-glob.h,v 1.6 2002/02/13 00:59:23 djm Exp $ */
|
/* $OpenBSD: sftp-glob.h,v 1.7 2002/03/19 10:49:35 markus Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001,2002 Damien Miller. All rights reserved.
|
* Copyright (c) 2001,2002 Damien Miller. All rights reserved.
|
||||||
@ -32,7 +32,7 @@
|
|||||||
#include "sftp-client.h"
|
#include "sftp-client.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
remote_glob(struct sftp_conn *, const char *, int,
|
remote_glob(struct sftp_conn *, const char *, int,
|
||||||
int (*)(const char *, int), glob_t *);
|
int (*)(const char *, int), glob_t *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
12
sftp.c
12
sftp.c
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
|
|
||||||
RCSID("$OpenBSD: sftp.c,v 1.26 2002/02/12 12:32:27 djm Exp $");
|
RCSID("$OpenBSD: sftp.c,v 1.27 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
/* XXX: short-form remote directory listings (like 'ls -C') */
|
/* XXX: short-form remote directory listings (like 'ls -C') */
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ static void
|
|||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
extern char *__progname;
|
extern char *__progname;
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage: %s [-vC1] [-b batchfile] [-o option] [-s subsystem|path] [-B buffer_size]\n"
|
"usage: %s [-vC1] [-b batchfile] [-o option] [-s subsystem|path] [-B buffer_size]\n"
|
||||||
" [-F config] [-P direct server path] [-S program]\n"
|
" [-F config] [-P direct server path] [-S program]\n"
|
||||||
@ -172,7 +172,7 @@ main(int argc, char **argv)
|
|||||||
case 'R':
|
case 'R':
|
||||||
num_requests = strtol(optarg, &cp, 10);
|
num_requests = strtol(optarg, &cp, 10);
|
||||||
if (num_requests == 0 || *cp != '\0')
|
if (num_requests == 0 || *cp != '\0')
|
||||||
fatal("Invalid number of requests \"%s\"",
|
fatal("Invalid number of requests \"%s\"",
|
||||||
optarg);
|
optarg);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
@ -218,19 +218,19 @@ main(int argc, char **argv)
|
|||||||
addargs(&args, "-s");
|
addargs(&args, "-s");
|
||||||
|
|
||||||
addargs(&args, "%s", host);
|
addargs(&args, "%s", host);
|
||||||
addargs(&args, "%s", (sftp_server != NULL ?
|
addargs(&args, "%s", (sftp_server != NULL ?
|
||||||
sftp_server : "sftp"));
|
sftp_server : "sftp"));
|
||||||
args.list[0] = ssh_program;
|
args.list[0] = ssh_program;
|
||||||
|
|
||||||
fprintf(stderr, "Connecting to %s...\n", host);
|
fprintf(stderr, "Connecting to %s...\n", host);
|
||||||
connect_to_server(ssh_program, args.list, &in, &out,
|
connect_to_server(ssh_program, args.list, &in, &out,
|
||||||
&sshpid);
|
&sshpid);
|
||||||
} else {
|
} else {
|
||||||
args.list = NULL;
|
args.list = NULL;
|
||||||
addargs(&args, "sftp-server");
|
addargs(&args, "sftp-server");
|
||||||
|
|
||||||
fprintf(stderr, "Attaching to %s...\n", sftp_direct);
|
fprintf(stderr, "Attaching to %s...\n", sftp_direct);
|
||||||
connect_to_server(sftp_direct, args.list, &in, &out,
|
connect_to_server(sftp_direct, args.list, &in, &out,
|
||||||
&sshpid);
|
&sshpid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: ssh-add.c,v 1.50 2002/01/29 14:27:57 markus Exp $");
|
RCSID("$OpenBSD: ssh-add.c,v 1.51 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ extern char *__progname;
|
|||||||
static char *default_files[] = {
|
static char *default_files[] = {
|
||||||
_PATH_SSH_CLIENT_ID_RSA,
|
_PATH_SSH_CLIENT_ID_RSA,
|
||||||
_PATH_SSH_CLIENT_ID_DSA,
|
_PATH_SSH_CLIENT_ID_DSA,
|
||||||
_PATH_SSH_CLIENT_IDENTITY,
|
_PATH_SSH_CLIENT_IDENTITY,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0; default_files[i]; i++) {
|
for(i = 0; default_files[i]; i++) {
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir,
|
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir,
|
||||||
default_files[i]);
|
default_files[i]);
|
||||||
if (do_file(ac, deleting, buf) == -1)
|
if (do_file(ac, deleting, buf) == -1)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
4
ssh.c
4
ssh.c
@ -39,7 +39,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: ssh.c,v 1.164 2002/02/14 23:28:00 markus Exp $");
|
RCSID("$OpenBSD: ssh.c,v 1.165 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
@ -475,7 +475,7 @@ again:
|
|||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
if ((fwd_port = a2port(sfwd_port)) == 0 ||
|
if ((fwd_port = a2port(sfwd_port)) == 0 ||
|
||||||
(fwd_host_port = a2port(sfwd_host_port)) == 0) {
|
(fwd_host_port = a2port(sfwd_host_port)) == 0) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Bad forwarding port(s) '%s'\n", optarg);
|
"Bad forwarding port(s) '%s'\n", optarg);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sshconnect2.c,v 1.97 2002/02/25 16:33:27 markus Exp $");
|
RCSID("$OpenBSD: sshconnect2.c,v 1.98 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "ssh2.h"
|
#include "ssh2.h"
|
||||||
@ -391,7 +391,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
|
|||||||
debug("no key from blob. pkalg %s", pkalg);
|
debug("no key from blob. pkalg %s", pkalg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (key->type != pktype) {
|
if (key->type != pktype) {
|
||||||
error("input_userauth_pk_ok: type mismatch "
|
error("input_userauth_pk_ok: type mismatch "
|
||||||
"for decoded key (received %d, expected %d)",
|
"for decoded key (received %d, expected %d)",
|
||||||
key->type, pktype);
|
key->type, pktype);
|
||||||
|
10
sshd.c
10
sshd.c
@ -42,7 +42,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sshd.c,v 1.233 2002/03/19 10:35:39 markus Exp $");
|
RCSID("$OpenBSD: sshd.c,v 1.234 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include <openssl/dh.h>
|
#include <openssl/dh.h>
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
@ -538,7 +538,7 @@ privsep_preauth_child(void)
|
|||||||
strerror(errno));
|
strerror(errno));
|
||||||
if (chdir("/") == -1)
|
if (chdir("/") == -1)
|
||||||
fatal("chdir(/)");
|
fatal("chdir(/)");
|
||||||
|
|
||||||
/* Drop our privileges */
|
/* Drop our privileges */
|
||||||
setegid(options.unprivileged_group);
|
setegid(options.unprivileged_group);
|
||||||
setgid(options.unprivileged_group);
|
setgid(options.unprivileged_group);
|
||||||
@ -564,7 +564,7 @@ privsep_postauth(Authctxt *authctxt, pid_t pid)
|
|||||||
use_privsep = 0;
|
use_privsep = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Authentication complete */
|
/* Authentication complete */
|
||||||
alarm(0);
|
alarm(0);
|
||||||
if (startup_pipe != -1) {
|
if (startup_pipe != -1) {
|
||||||
@ -1376,7 +1376,7 @@ main(int ac, char **av)
|
|||||||
|
|
||||||
if (!use_privsep)
|
if (!use_privsep)
|
||||||
goto skip_privilegeseparation;
|
goto skip_privilegeseparation;
|
||||||
|
|
||||||
/* Set up unprivileged child process to deal with network data */
|
/* Set up unprivileged child process to deal with network data */
|
||||||
monitor = monitor_init();
|
monitor = monitor_init();
|
||||||
/* Store a pointer to the kex for later rekeying */
|
/* Store a pointer to the kex for later rekeying */
|
||||||
@ -1422,7 +1422,7 @@ main(int ac, char **av)
|
|||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
authenticated:
|
authenticated:
|
||||||
/*
|
/*
|
||||||
* In privilege separation, we fork another child and prepare
|
* In privilege separation, we fork another child and prepare
|
||||||
* file descriptor passing.
|
* file descriptor passing.
|
||||||
*/
|
*/
|
||||||
|
18
ttymodes.c
18
ttymodes.c
@ -43,7 +43,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: ttymodes.c,v 1.16 2001/12/27 20:39:58 markus Exp $");
|
RCSID("$OpenBSD: ttymodes.c,v 1.17 2002/03/19 10:49:35 markus Exp $");
|
||||||
|
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -402,17 +402,17 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
|
|||||||
* SSH1:
|
* SSH1:
|
||||||
* Opcodes 1 to 127 are defined to have
|
* Opcodes 1 to 127 are defined to have
|
||||||
* a one-byte argument.
|
* a one-byte argument.
|
||||||
* Opcodes 128 to 159 are defined to have
|
* Opcodes 128 to 159 are defined to have
|
||||||
* an integer argument.
|
* an integer argument.
|
||||||
*/
|
*/
|
||||||
if (opcode > 0 && opcode < 128) {
|
if (opcode > 0 && opcode < 128) {
|
||||||
n_bytes += 1;
|
n_bytes += 1;
|
||||||
(void) packet_get_char();
|
(void) packet_get_char();
|
||||||
break;
|
break;
|
||||||
} else if (opcode >= 128 && opcode < 160) {
|
} else if (opcode >= 128 && opcode < 160) {
|
||||||
n_bytes += 4;
|
n_bytes += 4;
|
||||||
(void) packet_get_int();
|
(void) packet_get_int();
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* It is a truly undefined opcode (160 to 255).
|
* It is a truly undefined opcode (160 to 255).
|
||||||
@ -423,7 +423,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
|
|||||||
*/
|
*/
|
||||||
log("parse_tty_modes: unknown opcode %d", opcode);
|
log("parse_tty_modes: unknown opcode %d", opcode);
|
||||||
goto set;
|
goto set;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* SSH2:
|
* SSH2:
|
||||||
@ -440,7 +440,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
|
|||||||
log("parse_tty_modes: unknown opcode %d", opcode);
|
log("parse_tty_modes: unknown opcode %d", opcode);
|
||||||
goto set;
|
goto set;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user