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

Collapse All | Expand All

(-)ssh.c (+2 lines)
Lines 1239-1244 load_public_identity_files(void) Link Here
1239
#endif /* SMARTCARD */
1239
#endif /* SMARTCARD */
1240
	if ((pw = getpwuid(original_real_uid)) == NULL)
1240
	if ((pw = getpwuid(original_real_uid)) == NULL)
1241
		fatal("load_public_identity_files: getpwuid failed");
1241
		fatal("load_public_identity_files: getpwuid failed");
1242
	pw = pwcopy(pw);
1242
	if (gethostname(thishost, sizeof(thishost)) == -1)
1243
	if (gethostname(thishost, sizeof(thishost)) == -1)
1243
		fatal("load_public_identity_files: gethostname: %s",
1244
		fatal("load_public_identity_files: gethostname: %s",
1244
		    strerror(errno));
1245
		    strerror(errno));
Lines 1256-1261 load_public_identity_files(void) Link Here
1256
		options.identity_files[i] = filename;
1257
		options.identity_files[i] = filename;
1257
		options.identity_keys[i] = public;
1258
		options.identity_keys[i] = public;
1258
	}
1259
	}
1260
	pwfree(pw);
1259
}
1261
}
1260
1262
1261
static void
1263
static void
(-)misc.c (+22 lines)
Lines 197-202 pwcopy(struct passwd *pw) Link Here
197
	return copy;
197
	return copy;
198
}
198
}
199
199
200
void
201
pwfree(struct passwd *pw)
202
{
203
#define PW_CLEAR_FREE(f) \
204
	do { \
205
		if (pw->f != NULL) { \
206
			bzero(pw->f, strlen(pw->f)); \
207
			xfree(pw->f); \
208
		} \
209
	} while (0)
210
211
	PW_CLEAR_FREE(pw_name);
212
	PW_CLEAR_FREE(pw_passwd);
213
	PW_CLEAR_FREE(pw_gecos);
214
	PW_CLEAR_FREE(pw_class);
215
	PW_CLEAR_FREE(pw_dir);
216
	PW_CLEAR_FREE(pw_shell);
217
	bzero(pw, sizeof(*pw));
218
	xfree(pw);
219
#undef PW_CLEAR_FREE
220
}
221
200
/*
222
/*
201
 * Convert ASCII string to TCP/IP port number.
223
 * Convert ASCII string to TCP/IP port number.
202
 * Port must be >0 and <=65535.
224
 * Port must be >0 and <=65535.
(-)misc.h (+1 lines)
Lines 35-40 char *tohex(const void *, size_t); Link Here
35
void	 sanitise_stdfd(void);
35
void	 sanitise_stdfd(void);
36
36
37
struct passwd *pwcopy(struct passwd *);
37
struct passwd *pwcopy(struct passwd *);
38
void	 pwfree(struct passwd *);
38
39
39
typedef struct arglist arglist;
40
typedef struct arglist arglist;
40
struct arglist {
41
struct arglist {

Return to bug 1377