View | Details | Raw Unified | Return to bug 1159 | Differences between
and this patch

Collapse All | Expand All

(-)openssh-4.3p2/Makefile.in (-1 / +1 lines)
Lines 148-154 Link Here
148
	$(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
148
	$(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
149
149
150
ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
150
ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
151
	$(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
151
	$(LD) -o $@ ssh-keygen.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
152
152
153
ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
153
ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
154
	$(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
154
	$(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
(-)openssh-4.3p2/ssh-keygen.c (-1 / +40 lines)
Lines 26-31 Link Here
26
#include "bufaux.h"
26
#include "bufaux.h"
27
#include "pathnames.h"
27
#include "pathnames.h"
28
#include "log.h"
28
#include "log.h"
29
#include "ssh.h"
30
#include "readconf.h"
29
#include "misc.h"
31
#include "misc.h"
30
#include "match.h"
32
#include "match.h"
31
#include "hostfile.h"
33
#include "hostfile.h"
Lines 95-100 Link Here
95
int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);
97
int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);
96
int prime_test(FILE *, FILE *, u_int32_t, u_int32_t);
98
int prime_test(FILE *, FILE *, u_int32_t, u_int32_t);
97
99
100
/*
101
 * General data structure for command line options and options configurable
102
 * in configuration files.  See readconf.h.
103
 */
104
Options options;
105
uid_t original_real_uid;
106
98
static void
107
static void
99
ask_filename(struct passwd *pw, const char *prompt)
108
ask_filename(struct passwd *pw, const char *prompt)
100
{
109
{
Lines 120-126 Link Here
120
			break;
129
			break;
121
		}
130
		}
122
131
123
	snprintf(identity_file, sizeof(identity_file), "%s/%s", pw->pw_dir, name);
132
	
133
	if(options.num_identity_files > 0) {
134
	  char *file=NULL;
135
	  char *p=strrchr(name,'/');
136
	  if(p) file = p+1;
137
138
	  name = tilde_expand_filename(options.identity_files[0],
139
				       original_real_uid);
140
	  name = percent_expand(name, "h", pw->pw_dir,	
141
				      "u", pw->pw_name, (char *)NULL);
142
	  p=strrchr(name,'/');
143
	  if(p) *p=0;
144
	    
145
	  if(file && *file) {
146
	    snprintf(identity_file, sizeof(identity_file), "%s/%s", name,file);
147
	  }
148
	  else {
149
	    snprintf(identity_file, sizeof(identity_file), "%s", name);
150
	  }
151
	} else {
152
	  snprintf(identity_file, sizeof(identity_file), "%s/%s", pw->pw_dir,
153
		   name);
154
	}
124
	fprintf(stderr, "%s (%s): ", prompt, identity_file);
155
	fprintf(stderr, "%s (%s): ", prompt, identity_file);
125
	if (fgets(buf, sizeof(buf), stdin) == NULL)
156
	if (fgets(buf, sizeof(buf), stdin) == NULL)
126
		exit(1);
157
		exit(1);
Lines 1015-1020 Link Here
1015
	int log_level = SYSLOG_LEVEL_INFO;
1046
	int log_level = SYSLOG_LEVEL_INFO;
1016
	BIGNUM *start = NULL;
1047
	BIGNUM *start = NULL;
1017
	FILE *f;
1048
	FILE *f;
1049
 	char buf[256];
1018
	const char *errstr;
1050
	const char *errstr;
1019
1051
1020
	extern int optind;
1052
	extern int optind;
Lines 1042-1047 Link Here
1042
		exit(1);
1074
		exit(1);
1043
	}
1075
	}
1044
1076
1077
 	snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir,
1078
 		 _PATH_SSH_USER_CONFFILE);
1079
 	(void)read_config_file(buf, hostname, &options, 1);
1080
 
1081
 	/* Read systemwide configuration file after user config. */
1082
 	(void)read_config_file(_PATH_HOST_CONFIG_FILE, hostname, &options, 0);
1083
 		
1045
	while ((opt = getopt(ac, av,
1084
	while ((opt = getopt(ac, av,
1046
	    "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) {
1085
	    "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) {
1047
		switch (opt) {
1086
		switch (opt) {
(-)openssh-4.3p2/ssh.c (+5 lines)
Lines 1202-1210 Link Here
1202
		xfree(keys);
1202
		xfree(keys);
1203
	}
1203
	}
1204
#endif /* SMARTCARD */
1204
#endif /* SMARTCARD */
1205
	struct passwd *pw;
1206
	pw=getpwuid(original_real_uid);
1207
	if (!pw) fatal("Unknown user id: %d", original_real_uid);
1205
	for (; i < options.num_identity_files; i++) {
1208
	for (; i < options.num_identity_files; i++) {
1206
		filename = tilde_expand_filename(options.identity_files[i],
1209
		filename = tilde_expand_filename(options.identity_files[i],
1207
		    original_real_uid);
1210
		    original_real_uid);
1211
		filename = percent_expand(filename, "h", pw->pw_dir,	
1212
					  "u", pw->pw_name, (char *)NULL);
1208
		public = key_load_public(filename, NULL);
1213
		public = key_load_public(filename, NULL);
1209
		debug("identity file %s type %d", filename,
1214
		debug("identity file %s type %d", filename,
1210
		    public ? public->type : -1);
1215
		    public ? public->type : -1);

Return to bug 1159