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

Collapse All | Expand All

(-)./ssh.c (-1 / +8 lines)
Lines 44-49 Link Here
44
44
45
#include <openssl/evp.h>
45
#include <openssl/evp.h>
46
#include <openssl/err.h>
46
#include <openssl/err.h>
47
#include <stdlib.h>
47
48
48
#include "ssh.h"
49
#include "ssh.h"
49
#include "ssh1.h"
50
#include "ssh1.h"
Lines 221-226 Link Here
221
	int dummy;
222
	int dummy;
222
	extern int optind, optreset;
223
	extern int optind, optreset;
223
	extern char *optarg;
224
	extern char *optarg;
225
	char *original_user_home_dir,*original_user_login;
224
226
225
	__progname = get_progname(av[0]);
227
	__progname = get_progname(av[0]);
226
	init_rng();
228
	init_rng();
Lines 258-264 Link Here
258
	}
260
	}
259
	/* Take a copy of the returned structure. */
261
	/* Take a copy of the returned structure. */
260
	pw = pwcopy(pw);
262
	pw = pwcopy(pw);
261
263
	original_user_home_dir=(char *)malloc(sizeof(char)*200);
264
	original_user_login=(char *)malloc(sizeof(char)*200);
265
	original_user_home_dir = getenv("HOME");
266
	original_user_login = getenv("LOGNAME");
267
	pw->pw_dir = xstrdup(original_user_home_dir);
268
	pw->pw_name = xstrdup(original_user_login);
262
	/*
269
	/*
263
	 * Set our umask to something reasonable, as some files are created
270
	 * Set our umask to something reasonable, as some files are created
264
	 * with the default umask.  This will make them world-readable but
271
	 * with the default umask.  This will make them world-readable but
(-)./tildexpand.c (+10 lines)
Lines 13-18 Link Here
13
#include "includes.h"
13
#include "includes.h"
14
RCSID("$OpenBSD: tildexpand.c,v 1.13 2002/06/23 03:25:50 deraadt Exp $");
14
RCSID("$OpenBSD: tildexpand.c,v 1.13 2002/06/23 03:25:50 deraadt Exp $");
15
15
16
#include <stdlib.h>
16
#include "xmalloc.h"
17
#include "xmalloc.h"
17
#include "log.h"
18
#include "log.h"
18
#include "tildexpand.h"
19
#include "tildexpand.h"
Lines 30-35 Link Here
30
	struct passwd *pw;
31
	struct passwd *pw;
31
	char user[100];
32
	char user[100];
32
	int len;
33
	int len;
34
	char *original_user_home_dir,*original_user_login;
33
35
34
	/* Return immediately if no tilde. */
36
	/* Return immediately if no tilde. */
35
	if (filename[0] != '~')
37
	if (filename[0] != '~')
Lines 45-51 Link Here
45
	else
47
	else
46
		userlen = strlen(filename);	/* Nothing after username. */
48
		userlen = strlen(filename);	/* Nothing after username. */
47
	if (userlen == 0)
49
	if (userlen == 0)
50
	  {
48
		pw = getpwuid(my_uid);		/* Own home directory. */
51
		pw = getpwuid(my_uid);		/* Own home directory. */
52
		original_user_home_dir=(char *)malloc(sizeof(char)*200);
53
		original_user_login=(char *)malloc(sizeof(char)*200);
54
		original_user_home_dir = getenv("HOME");
55
		original_user_login = getenv("LOGNAME");
56
		pw->pw_dir = xstrdup(original_user_home_dir);
57
		pw->pw_name = xstrdup(original_user_login);
58
	  }
49
	else {
59
	else {
50
		/* Tilde refers to someone elses home directory. */
60
		/* Tilde refers to someone elses home directory. */
51
		if (userlen > sizeof(user) - 1)
61
		if (userlen > sizeof(user) - 1)

Return to bug 623