ref: 16675d656637e4b83b6eb4569fd8225cc15ede86
parent: 2e463a08ea1fb49ec6b998b078cc358d21616757
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Apr 29 12:25:48 EDT 2017
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.
--- a/sys/src/cmd/sshfs.c
+++ b/sys/src/cmd/sshfs.c
@@ -1252,13 +1252,13 @@
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;
--
⑨