Handle failure from ftpd_popen in statfilecmd().

Reviewed by:	attilio
MFC after:	1 week
This commit is contained in:
Ed Maste 2011-01-04 00:11:09 +00:00
parent 5568050d57
commit 763e8c9623
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216943

View File

@ -2350,6 +2350,10 @@ statfilecmd(char *filename)
code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213;
(void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename);
fin = ftpd_popen(line, "r");
if (fin == NULL) {
perror_reply(551, filename);
return;
}
lreply(code, "Status of %s:", filename);
atstart = 1;
while ((c = getc(fin)) != EOF) {