View | Details | Raw Unified | Return to bug 2229
Collapse All | Expand All

(-)readconf.c (+8 lines)
Lines 336-341 add_identity_file(Options *options, cons Link Here
336
    int userprovided)
336
    int userprovided)
337
{
337
{
338
	char *path;
338
	char *path;
339
	int i;
339
340
340
	if (options->num_identity_files >= SSH_MAX_IDENTITY_FILES)
341
	if (options->num_identity_files >= SSH_MAX_IDENTITY_FILES)
341
		fatal("Too many identity files specified (max %d)",
342
		fatal("Too many identity files specified (max %d)",
Lines 345-350 add_identity_file(Options *options, cons Link Here
345
		path = xstrdup(filename);
346
		path = xstrdup(filename);
346
	else
347
	else
347
		(void)xasprintf(&path, "%.100s%.100s", dir, filename);
348
		(void)xasprintf(&path, "%.100s%.100s", dir, filename);
349
350
	/* Avoid registering duplicates */
351
	for (i = 0; i < options->num_identity_files; i++) {
352
		if (options->identity_file_userprovided[i] == userprovided &&
353
		    strcmp(options->identity_files[i], path) == 0)
354
			return;
355
	}
348
356
349
	options->identity_file_userprovided[options->num_identity_files] =
357
	options->identity_file_userprovided[options->num_identity_files] =
350
	    userprovided;
358
	    userprovided;

Return to bug 2229