Skip to content

Commit

Permalink
Handle failure from ftpd_popen in statfilecmd().
Browse files Browse the repository at this point in the history
Reviewed by:	attilio
MFC after:	1 week
  • Loading branch information
emaste committed Jan 4, 2011
1 parent 5568050 commit 763e8c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libexec/ftpd/ftpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 763e8c9

Please sign in to comment.