summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-02-10 22:50:09 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-02-10 22:50:09 +0000
commit4f7a64a64fb5de0f9642074915dd39bd7167fbd4 (patch)
treec8052021f7d94530bc8ed5409bc68b52b3c71b4e
parent9d3a859e8cafcc1de4908a17caeeaab52d491b03 (diff)
- deraadt@cvs.openbsd.org 2001/02/08 14:39:36
[readconf.c] snprintf
-rw-r--r--ChangeLog5
-rw-r--r--readconf.c18
2 files changed, 15 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 136feadb4..224909bac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,9 @@
55 - markus@cvs.openbsd.org 2001/02/06 22:43:02 55 - markus@cvs.openbsd.org 2001/02/06 22:43:02
56 [clientloop.h] 56 [clientloop.h]
57 remove confusing callback code 57 remove confusing callback code
58 - deraadt@cvs.openbsd.org 2001/02/08 14:39:36
59 [readconf.c]
60 snprintf
58 - (bal) fixed sftp-client.c. Return 'status' instead of '0' 61 - (bal) fixed sftp-client.c. Return 'status' instead of '0'
59 (from the OpenBSD tree) 62 (from the OpenBSD tree)
60 - (bal) Synced ssh.1 and sshd.8 w/ OpenBSD 63 - (bal) Synced ssh.1 and sshd.8 w/ OpenBSD
@@ -3841,4 +3844,4 @@
3841 - Wrote replacements for strlcpy and mkdtemp 3844 - Wrote replacements for strlcpy and mkdtemp
3842 - Released 1.0pre1 3845 - Released 1.0pre1
3843 3846
3844$Id: ChangeLog,v 1.727 2001/02/10 22:44:12 mouring Exp $ 3847$Id: ChangeLog,v 1.728 2001/02/10 22:50:09 mouring Exp $
diff --git a/readconf.c b/readconf.c
index e3a1dd742..f62905c29 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.60 2001/01/28 20:36:16 stevesk Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.61 2001/02/08 14:39:36 deraadt Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -717,6 +717,8 @@ initialize_options(Options * options)
717void 717void
718fill_default_options(Options * options) 718fill_default_options(Options * options)
719{ 719{
720 int len;
721
720 if (options->forward_agent == -1) 722 if (options->forward_agent == -1)
721 options->forward_agent = 0; 723 options->forward_agent = 0;
722 if (options->forward_x11 == -1) 724 if (options->forward_x11 == -1)
@@ -783,16 +785,18 @@ fill_default_options(Options * options)
783 options->protocol = SSH_PROTO_1|SSH_PROTO_2|SSH_PROTO_1_PREFERRED; 785 options->protocol = SSH_PROTO_1|SSH_PROTO_2|SSH_PROTO_1_PREFERRED;
784 if (options->num_identity_files == 0) { 786 if (options->num_identity_files == 0) {
785 if (options->protocol & SSH_PROTO_1) { 787 if (options->protocol & SSH_PROTO_1) {
788 len = 2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1;
786 options->identity_files[options->num_identity_files] = 789 options->identity_files[options->num_identity_files] =
787 xmalloc(2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1); 790 xmalloc(len);
788 sprintf(options->identity_files[options->num_identity_files++], 791 snprintf(options->identity_files[options->num_identity_files++],
789 "~/%.100s", _PATH_SSH_CLIENT_IDENTITY); 792 len, "~/%.100s", _PATH_SSH_CLIENT_IDENTITY);
790 } 793 }
791 if (options->protocol & SSH_PROTO_2) { 794 if (options->protocol & SSH_PROTO_2) {
795 len = 2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1;
792 options->identity_files[options->num_identity_files] = 796 options->identity_files[options->num_identity_files] =
793 xmalloc(2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1); 797 xmalloc(len);
794 sprintf(options->identity_files[options->num_identity_files++], 798 snprintf(options->identity_files[options->num_identity_files++],
795 "~/%.100s", _PATH_SSH_CLIENT_ID_DSA); 799 len, "~/%.100s", _PATH_SSH_CLIENT_ID_DSA);
796 } 800 }
797 } 801 }
798 if (options->escape_char == -1) 802 if (options->escape_char == -1)