summaryrefslogtreecommitdiff
path: root/tildexpand.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-25 11:54:57 +1100
committerDamien Miller <djm@mindrot.org>1999-11-25 11:54:57 +1100
commit5428f646ad32da88ddd04a8c287d595524674fbf (patch)
treecc1f1e5d7852e1f44d41077f776abf7dab7ac06d /tildexpand.c
parent9072e1889648988da38b7b81bce95291c1dc3a23 (diff)
- More reformatting merged from OpenBSD CVS
- Merged OpenBSD CVS changes: - [channels.c] report from mrwizard@psu.edu via djm@ibs.com.au - [channels.c] set SO_REUSEADDR and SO_LINGER for forwarded ports. chip@valinux.com via damien@ibs.com.au - [nchan.c] it's not an error() if shutdown_write failes in nchan. - [readconf.c] remove dead #ifdef-0-code - [readconf.c servconf.c] strcasecmp instead of tolower - [scp.c] progress meter overflow fix from damien@ibs.com.au - [ssh-add.1 ssh-add.c] SSH_ASKPASS support - [ssh.1 ssh.c] postpone fork_after_authentication until command execution, request/patch from jahakala@cc.jyu.fi via damien@ibs.com.au plus: use daemon() for backgrounding
Diffstat (limited to 'tildexpand.c')
-rw-r--r--tildexpand.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tildexpand.c b/tildexpand.c
index 92422ee3f..8ee551f13 100644
--- a/tildexpand.c
+++ b/tildexpand.c
@@ -6,7 +6,7 @@
6 */ 6 */
7 7
8#include "includes.h" 8#include "includes.h"
9RCSID("$Id: tildexpand.c,v 1.2 1999/11/24 13:26:23 damien Exp $"); 9RCSID("$Id: tildexpand.c,v 1.3 1999/11/25 00:54:59 damien Exp $");
10 10
11#include "xmalloc.h" 11#include "xmalloc.h"
12#include "ssh.h" 12#include "ssh.h"
@@ -38,7 +38,7 @@ tilde_expand_filename(const char *filename, uid_t my_uid)
38 else 38 else
39 userlen = strlen(filename); /* Nothing after username. */ 39 userlen = strlen(filename); /* Nothing after username. */
40 if (userlen == 0) 40 if (userlen == 0)
41 pw = getpwuid(my_uid); /* Own home directory. */ 41 pw = getpwuid(my_uid); /* Own home directory. */
42 else { 42 else {
43 /* Tilde refers to someone elses home directory. */ 43 /* Tilde refers to someone elses home directory. */
44 if (userlen > sizeof(user) - 1) 44 if (userlen > sizeof(user) - 1)
@@ -47,12 +47,12 @@ tilde_expand_filename(const char *filename, uid_t my_uid)
47 user[userlen] = 0; 47 user[userlen] = 0;
48 pw = getpwnam(user); 48 pw = getpwnam(user);
49 } 49 }
50 /* Check that we found the user. */
51 if (!pw) 50 if (!pw)
52 fatal("Unknown user %100s.", user); 51 fatal("Unknown user %100s.", user);
53 52
54 /* If referring to someones home directory, return it now. */ 53 /* If referring to someones home directory, return it now. */
55 if (!cp) { /* Only home directory specified */ 54 if (!cp) {
55 /* Only home directory specified */
56 return xstrdup(pw->pw_dir); 56 return xstrdup(pw->pw_dir);
57 } 57 }
58 /* Build a path combining the specified directory and path. */ 58 /* Build a path combining the specified directory and path. */