diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-04-29 16:25:48 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-04-29 16:25:48 +0200 |
commit | 51eaebf4f01ce8b8de4e32d679fe98b69ae64ad0 (patch) | |
tree | 1c9b8f069afb87b5fa77af85bf973c0d556df522 /sys/src/cmd/sshfs.c | |
parent | f00488ec70c0ca00396d3d3e47b38285599dd31a (diff) |
sshfs: don't crash when no /etc/password file could be read on the remote side
in a cygwin environment, theres no /etc/passwd file to
translate numeric uid/gid's. changing passwdparse() to
ignore nil string argument.
Diffstat (limited to 'sys/src/cmd/sshfs.c')
-rw-r--r-- | sys/src/cmd/sshfs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/cmd/sshfs.c b/sys/src/cmd/sshfs.c index cb5692d10..eaa32cb9d 100644 --- a/sys/src/cmd/sshfs.c +++ b/sys/src/cmd/sshfs.c @@ -1252,13 +1252,13 @@ out: void passwdparse(IDEnt **tab, char *s) { - char *p; - char *n; - int id; IDEnt *e, **b; + char *p, *n; + int id; - p = s; - for(;;){ + if(s == nil) + return; + for(p = s;;){ n = p; p = strpbrk(p, ":\n"); if(p == nil) break; if(*p != ':'){ p++; continue; } *p = 0; |