more whitespace (tabs this time)

This commit is contained in:
Damien Miller 2003-11-21 23:56:47 +11:00
parent a8e06cef35
commit 787b2ec18c
23 changed files with 74 additions and 74 deletions

View File

@ -68,7 +68,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
krb5_principal server;
char ccname[40];
int tmpfd;
#endif
#endif
krb5_error_code problem;
krb5_ccache ccache = NULL;
@ -97,10 +97,10 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
goto out;
restore_uid();
problem = krb5_verify_user(authctxt->krb5_ctx, authctxt->krb5_user,
ccache, password, 1, NULL);
temporarily_use_uid(authctxt->pw);
if (problem)
@ -135,7 +135,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
temporarily_use_uid(authctxt->pw);
if (problem)
goto out;
if (!krb5_kuserok(authctxt->krb5_ctx, authctxt->krb5_user,
authctxt->pw->pw_name)) {
problem = -1;
@ -143,13 +143,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
}
snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid());
if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) {
logit("mkstemp(): %.100s", strerror(errno));
problem = errno;
goto out;
}
if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
logit("fchmod(): %.100s", strerror(errno));
close(tmpfd);
@ -166,12 +166,12 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
authctxt->krb5_user);
if (problem)
goto out;
problem= krb5_cc_store_cred(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache,
&creds);
if (problem)
goto out;
#endif
#endif
authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);

View File

@ -31,7 +31,7 @@
/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
#include "includes.h"
RCSID("$Id: auth-pam.c,v 1.83 2003/11/21 12:48:55 djm Exp $");
RCSID("$Id: auth-pam.c,v 1.84 2003/11/21 12:56:47 djm Exp $");
#ifdef USE_PAM
#include <security/pam_appl.h>
@ -321,7 +321,7 @@ sshpam_thread(void *ctxtp)
ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer);
buffer_free(&buffer);
pthread_exit(NULL);
return (NULL); /* Avoid warning for non-pthread case */
}
@ -613,7 +613,7 @@ do_pam_account(void)
{
sshpam_err = pam_acct_mgmt(sshpam_handle, 0);
debug3("%s: pam_acct_mgmt = %d", __func__, sshpam_err);
if (sshpam_err != PAM_SUCCESS && sshpam_err != PAM_NEW_AUTHTOK_REQD)
return (0);
@ -773,7 +773,7 @@ int
do_pam_putenv(char *name, char *value)
{
int ret = 1;
#ifdef HAVE_PAM_PUTENV
#ifdef HAVE_PAM_PUTENV
char *compound;
size_t len;

View File

@ -101,7 +101,7 @@ auth_password(Authctxt *authctxt, const char *password)
(char *)get_canonical_hostname(options.use_dns);
authsuccess = 1;
aix_remove_embedded_newlines(authmsg);
aix_remove_embedded_newlines(authmsg);
debug3("AIX/authenticate succeeded for user %s: %.100s",
pw->pw_name, authmsg);

View File

@ -100,7 +100,7 @@ session_setup_sia(struct passwd *pw, char *tty)
if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS)
fatal("Couldn't launch session for %s from %s",
pw->pw_name, host);
sia_ses_release(&ent);
if (setreuid(geteuid(), geteuid()) < 0)

2
auth.c
View File

@ -597,7 +597,7 @@ fakepw(void)
memset(&fake, 0, sizeof(fake));
fake.pw_name = "NOUSER";
fake.pw_passwd =
"$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK";
"$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK";
fake.pw_gecos = "NOUSER";
fake.pw_uid = -1;
fake.pw_gid = -1;

View File

@ -255,21 +255,21 @@ input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
Buffer b;
gss_buffer_desc mic, gssbuf;
u_int len;
if (authctxt == NULL || (authctxt->methoddata == NULL && !use_privsep))
fatal("No authentication or GSSAPI context");
gssctxt = authctxt->methoddata;
mic.value = packet_get_string(&len);
mic.length = len;
ssh_gssapi_buildmic(&b, authctxt->user, authctxt->service,
"gssapi-with-mic");
gssbuf.value = buffer_ptr(&b);
gssbuf.length = buffer_len(&b);
if (!GSS_ERROR(PRIVSEP(ssh_gssapi_checkmic(gssctxt, &gssbuf, &mic))))
authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user));
else
@ -277,7 +277,7 @@ input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
buffer_free(&b);
xfree(mic.value);
authctxt->postponed = 0;
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, NULL);

View File

@ -607,7 +607,7 @@ ssh_update_card(AuthenticationConnection *auth, int add,
buffer_put_char(&msg, type);
buffer_put_cstring(&msg, reader_id);
buffer_put_cstring(&msg, pin);
if (constrained) {
if (life != 0) {
buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_LIFETIME);

View File

@ -105,7 +105,7 @@ restart:
goto restart;
}
/* Increase the size of the buffer and retry. */
newlen = buffer->alloc + len + 32768;
if (newlen > 0xa00000)
fatal("buffer_append_space: alloc %u not supported",

View File

@ -1035,7 +1035,7 @@ channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset)
else if (inet_ntop(af, dest_addr, c->path, sizeof(c->path)) == NULL)
return -1;
c->host_port = ntohs(dest_port);
debug2("channel %d: dynamic request: socks5 host %s port %u command %u",
c->self, c->path, c->host_port, s5_req.command);

View File

@ -45,7 +45,7 @@
* XXX: we should tell the child how many bytes we need.
*/
RCSID("$Id: entropy.c,v 1.47 2003/11/21 12:48:55 djm Exp $");
RCSID("$Id: entropy.c,v 1.48 2003/11/21 12:56:47 djm Exp $");
#ifndef OPENSSL_PRNG_ONLY
#define RANDOM_SEED_SIZE 48
@ -93,7 +93,7 @@ seed_rng(void)
(long int)original_uid, strerror(errno));
_exit(1);
}
execl(SSH_RAND_HELPER, "ssh-rand-helper", NULL);
fprintf(stderr, "(rand child) Couldn't exec '%s': %s\n",
SSH_RAND_HELPER, strerror(errno));

View File

@ -253,14 +253,14 @@ ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_t buffer, gss_buffer_t hash)
if ((ctx->major = gss_get_mic(&ctx->minor, ctx->context,
GSS_C_QOP_DEFAULT, buffer, hash)))
ssh_gssapi_error(ctx);
return (ctx->major);
}
void
ssh_gssapi_buildmic(Buffer *b, const char *user, const char *service,
const char *context)
{
{
buffer_init(b);
buffer_put_string(b, session_id2, session_id2_len);
buffer_put_char(b, SSH2_MSG_USERAUTH_REQUEST);

View File

@ -13,7 +13,7 @@
#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
#include <openssl/md5.h>
RCSID("$Id: md5crypt.c,v 1.8 2003/11/21 12:48:55 djm Exp $");
RCSID("$Id: md5crypt.c,v 1.9 2003/11/21 12:56:47 djm Exp $");
/* 0 ... 63 => ascii - 64 */
static unsigned char itoa64[] =
@ -35,7 +35,7 @@ to64(unsigned long v, int n)
*s++ = itoa64[v&0x3f];
v >>= 6;
}
return (buf);
}

View File

@ -151,7 +151,7 @@ qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
time(&time_now);
gtm = gmtime(&time_now);
res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ",
gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday,
gtm->tm_hour, gtm->tm_min, gtm->tm_sec,
@ -573,7 +573,7 @@ prime_test(FILE *in, FILE *out, u_int32_t trials,
count_in);
continue;
}
/*
* q is possibly prime, so go ahead and really make sure
* that p is prime. If it is, then we can go back and do

View File

@ -783,7 +783,7 @@ int
mm_answer_pam_start(int socket, Buffer *m)
{
char *user;
if (!options.use_pam)
fatal("UsePAM not set, but ended up in %s anyway", __func__);
@ -802,7 +802,7 @@ int
mm_answer_pam_account(int socket, Buffer *m)
{
u_int ret;
if (!options.use_pam)
fatal("UsePAM not set, but ended up in %s anyway", __func__);
@ -1798,25 +1798,25 @@ mm_answer_gss_checkmic(int socket, Buffer *m)
gss_buffer_desc gssbuf, mic;
OM_uint32 ret;
u_int len;
gssbuf.value = buffer_get_string(m, &len);
gssbuf.length = len;
mic.value = buffer_get_string(m, &len);
mic.length = len;
ret = ssh_gssapi_checkmic(gsscontext, &gssbuf, &mic);
xfree(gssbuf.value);
xfree(mic.value);
buffer_clear(m);
buffer_put_int(m, ret);
mm_request_send(socket, MONITOR_ANS_GSSCHECKMIC, m);
if (!GSS_ERROR(ret))
monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1);
return (0);
}

View File

@ -720,7 +720,7 @@ mm_do_pam_account(void)
ret = buffer_get_int(&m);
buffer_free(&m);
debug3("%s returning %d", __func__, ret);
return (ret);

View File

@ -189,7 +189,7 @@ sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa,
int r;
if (padding != RSA_PKCS1_PADDING)
return -1;
return -1;
r = sc_prkey_op_init(rsa, &key_obj, SC_USAGE_DECRYPT);
if (r)
return -1;
@ -325,7 +325,7 @@ static void
convert_rsa_to_rsa1(Key * in, Key * out)
{
struct sc_priv_data *priv;
out->rsa->flags = in->rsa->flags;
out->flags = in->flags;
RSA_set_method(out->rsa, RSA_get_method(in->rsa));
@ -349,7 +349,7 @@ sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj)
EVP_PKEY *pubkey = NULL;
u8 *p;
char *tmp;
debug("sc_read_pubkey() with cert id %02X", cinfo->id.value[0]);
r = sc_pkcs15_read_certificate(p15card, cinfo, &cert);
if (r) {
@ -391,7 +391,7 @@ sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj)
tmp = key_fingerprint(k, SSH_FP_MD5, SSH_FP_HEX);
debug("fingerprint %d %s", key_size(k), tmp);
xfree(tmp);
return 0;
err:
if (cert)

2
scp.c
View File

@ -907,7 +907,7 @@ bad: run_err("%s: %s", np, strerror(errno));
cp += j;
statbytes += j;
} while (amt > 0);
if (limitbw)
bwlimit(4096);

View File

@ -924,11 +924,11 @@ read_etc_default_login(char ***env, u_int *envsize, uid_t uid)
var = child_get_env(tmpenv, "PATH");
if (var != NULL)
child_set_env(env, envsize, "PATH", var);
if ((var = child_get_env(tmpenv, "UMASK")) != NULL)
if (sscanf(var, "%5lo", &mask) == 1)
umask((mode_t)mask);
for (i = 0; tmpenv[i] != NULL; i++)
xfree(tmpenv[i]);
xfree(tmpenv);
@ -953,7 +953,7 @@ void copy_environment(char **source, char ***env, u_int *envsize)
debug3("Copy environment: %s=%s", var_name, var_val);
child_set_env(env, envsize, var_name, var_val);
xfree(var_name);
}
}
@ -1096,7 +1096,7 @@ do_setup_env(Session *s, const char *shell)
*/
if (options.use_pam) {
char **p;
p = fetch_pam_child_environment();
copy_environment(p, &env, &envsize);
free_pam_environment(p);
@ -2033,13 +2033,13 @@ session_tty_list(void)
for (i = 0; i < MAX_SESSIONS; i++) {
Session *s = &sessions[i];
if (s->used && s->ttyfd != -1) {
if (strncmp(s->tty, "/dev/", 5) != 0) {
cp = strrchr(s->tty, '/');
cp = (cp == NULL) ? s->tty : cp + 1;
} else
cp = s->tty + 5;
if (buf[0] != '\0')
strlcat(buf, ",", sizeof buf);
strlcat(buf, cp, sizeof buf);

View File

@ -70,7 +70,7 @@ fudge_readdir(struct SFTP_OPENDIR *od)
#ifdef __GNU_LIBRARY__
static int inum = 1;
#endif /* __GNU_LIBRARY__ */
if (od->dir[od->offset] == NULL)
return(NULL);

View File

@ -390,7 +390,7 @@ get_pathname(const char **cpp, char **path)
fail:
xfree(*path);
*path = NULL;
*path = NULL;
return (-1);
}
@ -679,7 +679,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
if (!(lflag & SHORT_VIEW)) {
int m = 0, width = 80;
struct winsize ws;
struct winsize ws;
/* Count entries for sort and find longest filename */
for (i = 0; g.gl_pathv[i]; i++)
@ -759,7 +759,7 @@ parse_args(const char **cpp, int *pflag, int *lflag, int *iflag,
*iflag = 1;
cp++;
}
/* Figure out which command we have */
for (i = 0; cmds[i].c; i++) {
int cmdlen = strlen(cmds[i].c);

View File

@ -968,7 +968,7 @@ main(int ac, char **av)
if (do_gen_candidates) {
FILE *out = fopen(out_file, "w");
if (out == NULL) {
error("Couldn't open modulus candidate file \"%s\": %s",
out_file, strerror(errno));

View File

@ -39,7 +39,7 @@
#include "pathnames.h"
#include "log.h"
RCSID("$Id: ssh-rand-helper.c,v 1.15 2003/11/21 12:48:56 djm Exp $");
RCSID("$Id: ssh-rand-helper.c,v 1.16 2003/11/21 12:56:47 djm Exp $");
/* Number of bytes we write out */
#define OUTPUT_SEED_SIZE 48
@ -779,7 +779,7 @@ main(int argc, char **argv)
/* Don't write binary data to a tty, unless we are forced to */
if (isatty(STDOUT_FILENO))
output_hex = 1;
while ((ch = getopt(argc, argv, "vxXhb:")) != -1) {
switch (ch) {
case 'v':
@ -806,7 +806,7 @@ main(int argc, char **argv)
}
log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);
#ifdef USE_SEED_FILES
prng_read_seedfile();
#endif
@ -816,7 +816,7 @@ main(int argc, char **argv)
/*
* Seed the RNG from wherever we can
*/
/* Take whatever is on the stack, but don't credit it */
RAND_add(buf, bytes, 0);
@ -859,9 +859,9 @@ main(int argc, char **argv)
printf("\n");
} else
ret = atomicio(vwrite, STDOUT_FILENO, buf, bytes);
memset(buf, '\0', bytes);
xfree(buf);
return ret == bytes ? 0 : 1;
}

View File

@ -546,7 +546,7 @@ process_gssapi_token(void *ctxt, gss_buffer_t recv_tok)
gss_buffer_desc gssbuf, mic;
OM_uint32 status, ms, flags;
Buffer b;
status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
recv_tok, &send_tok, &flags);
@ -555,12 +555,12 @@ process_gssapi_token(void *ctxt, gss_buffer_t recv_tok)
packet_start(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK);
else
packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
packet_put_string(send_tok.value, send_tok.length);
packet_send();
gss_release_buffer(&ms, &send_tok);
}
if (status == GSS_S_COMPLETE) {
/* send either complete or MIC, depending on mechanism */
if (!(flags & GSS_C_INTEG_FLAG)) {
@ -572,21 +572,21 @@ process_gssapi_token(void *ctxt, gss_buffer_t recv_tok)
gssbuf.value = buffer_ptr(&b);
gssbuf.length = buffer_len(&b);
status = ssh_gssapi_sign(gssctxt, &gssbuf, &mic);
if (!GSS_ERROR(status)) {
packet_start(SSH2_MSG_USERAUTH_GSSAPI_MIC);
packet_put_string(mic.value, mic.length);
packet_send();
}
buffer_free(&b);
gss_release_buffer(&ms, &mic);
}
}
}
return status;
}