mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
RFC 959 states that the following codes should be used
for status replies on file system objects: 212 Directory status. 213 File status. Reported by: Oleg Koreshkov <okor -at- zone.salut.ru> MFC after: 1 week
This commit is contained in:
parent
94175098f1
commit
41c57b487e
1 changed files with 5 additions and 3 deletions
|
|
@ -2235,12 +2235,14 @@ statfilecmd(char *filename)
|
|||
{
|
||||
FILE *fin;
|
||||
int atstart;
|
||||
int c;
|
||||
int c, code;
|
||||
char line[LINE_MAX];
|
||||
struct stat st;
|
||||
|
||||
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");
|
||||
lreply(211, "status of %s:", filename);
|
||||
lreply(code, "status of %s:", filename);
|
||||
atstart = 1;
|
||||
while ((c = getc(fin)) != EOF) {
|
||||
if (c == '\n') {
|
||||
|
|
@ -2269,7 +2271,7 @@ statfilecmd(char *filename)
|
|||
atstart = (c == '\n');
|
||||
}
|
||||
(void) ftpd_pclose(fin);
|
||||
reply(211, "End of Status");
|
||||
reply(code, "End of Status");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue