summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2016-01-19 00:34:37 +0800
committerMatt Johnston <matt@ucc.asn.au>2016-01-19 00:34:37 +0800
commitde70b02c2f357d6a2fd51b2de3bec2e0f345d5b1 (patch)
treebff622447c9daa84ef34dbc3f4d12bd91efaae67 /scp.c
parent6453b5b70ea151ad1f378d39ff42ade81f87d834 (diff)
downloaddropbear-de70b02c2f357d6a2fd51b2de3bec2e0f345d5b1.tar.gz
Don't fail if can't get the username
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/scp.c b/scp.c
index 4f6a579..8c94ec8 100644
--- a/scp.c
+++ b/scp.c
@@ -289,7 +289,6 @@ int okname(char *);
void run_err(const char *,...);
void verifydir(char *);
-struct passwd *pwd;
uid_t userid;
int errs, remin, remout;
int pflag, iamremote, iamrecursive, targetshouldbedirectory;
@@ -396,9 +395,6 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
- if ((pwd = getpwuid(userid = getuid())) == NULL)
- fatal("unknown user %u", (u_int) userid);
-
if (!isatty(STDERR_FILENO))
showprogress = 0;
@@ -514,7 +510,7 @@ toremote(char *targ, int argc, char **argv)
host = cleanhostname(host);
suser = argv[i];
if (*suser == '\0')
- suser = pwd->pw_name;
+ continue; /* pretend there wasn't any @ at all */
else if (!okname(suser))
continue;
addargs(&alist, "-l");
@@ -582,7 +578,7 @@ tolocal(int argc, char **argv)
*host++ = 0;
suser = argv[i];
if (*suser == '\0')
- suser = pwd->pw_name;
+ suser = NULL;
}
host = cleanhostname(host);
len = strlen(src) + CMDNEEDS + 20;