Handle failure from ftpd_popen in statfilecmd().
Reviewed by: attilio MFC after: 1 week
This commit is contained in:
parent
5568050d57
commit
763e8c9623
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216943
@ -2350,6 +2350,10 @@ statfilecmd(char *filename)
|
|||||||
code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213;
|
code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213;
|
||||||
(void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename);
|
(void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename);
|
||||||
fin = ftpd_popen(line, "r");
|
fin = ftpd_popen(line, "r");
|
||||||
|
if (fin == NULL) {
|
||||||
|
perror_reply(551, filename);
|
||||||
|
return;
|
||||||
|
}
|
||||||
lreply(code, "Status of %s:", filename);
|
lreply(code, "Status of %s:", filename);
|
||||||
atstart = 1;
|
atstart = 1;
|
||||||
while ((c = getc(fin)) != EOF) {
|
while ((c = getc(fin)) != EOF) {
|
||||||
|
Loading…
Reference in New Issue
Block a user