Use uniform punctuation, capitalization, and language style

in server messages wherever this doesn't contradict to a particular
message format.
This commit is contained in:
Yaroslav Tykhiy 2004-11-18 11:45:13 +00:00
parent eb5b2bb3ae
commit 02c9749295
2 changed files with 44 additions and 45 deletions

View File

@ -183,7 +183,7 @@ cmd
| PORT check_login SP host_port CRLF
{
if (epsvall) {
reply(501, "no PORT allowed after EPSV ALL");
reply(501, "No PORT allowed after EPSV ALL.");
goto port_done;
}
if (!$2)
@ -206,7 +206,7 @@ cmd
| LPRT check_login SP host_long_port CRLF
{
if (epsvall) {
reply(501, "no LPRT allowed after EPSV ALL");
reply(501, "No LPRT allowed after EPSV ALL.");
goto lprt_done;
}
if (!$2)
@ -236,7 +236,7 @@ cmd
int i;
if (epsvall) {
reply(501, "no EPRT allowed after EPSV ALL");
reply(501, "No EPRT allowed after EPSV ALL.");
goto eprt_done;
}
if (!$2)
@ -329,14 +329,14 @@ cmd
| PASV check_login CRLF
{
if (epsvall)
reply(501, "no PASV allowed after EPSV ALL");
reply(501, "No PASV allowed after EPSV ALL.");
else if ($2)
passive();
}
| LPSV check_login CRLF
{
if (epsvall)
reply(501, "no LPSV allowed after EPSV ALL");
reply(501, "No LPSV allowed after EPSV ALL.");
else if ($2)
long_passive("LPSV", PF_UNSPEC);
}
@ -363,8 +363,7 @@ cmd
| EPSV check_login_epsv SP ALL CRLF
{
if ($2) {
reply(200,
"EPSV ALL command successful.");
reply(200, "EPSV ALL command successful.");
epsvall++;
}
}
@ -416,7 +415,7 @@ cmd
switch ($4) {
case STRU_F:
reply(200, "STRU F ok.");
reply(200, "STRU F accepted.");
break;
default:
@ -430,7 +429,7 @@ cmd
switch ($4) {
case MODE_S:
reply(200, "MODE S ok.");
reply(200, "MODE S accepted.");
break;
default:
@ -453,7 +452,7 @@ cmd
| RETR check_login SP pathname CRLF
{
if (noretr || (guest && noguestretr))
reply(500, "RETR command is disabled");
reply(500, "RETR command disabled.");
else if ($2 && $4 != NULL)
retrieve(NULL, $4);
@ -626,7 +625,7 @@ cmd
if ($4) {
oldmask = umask(0);
(void) umask(oldmask);
reply(200, "Current UMASK is %03o", oldmask);
reply(200, "Current UMASK is %03o.", oldmask);
}
}
| SITE SP UMASK check_login SP octal_number CRLF
@ -635,11 +634,11 @@ cmd
if ($4) {
if (($6 == -1) || ($6 > 0777)) {
reply(501, "Bad UMASK value");
reply(501, "Bad UMASK value.");
} else {
oldmask = umask($6);
reply(200,
"UMASK set to %03o (was %03o)",
"UMASK set to %03o (was %03o).",
$6, oldmask);
}
}
@ -648,7 +647,7 @@ cmd
{
if ($4 && ($8 != NULL)) {
if (($6 == -1 ) || ($6 > 0777))
reply(501, "Bad mode value");
reply(501, "Bad mode value.");
else if (chmod($8, $6) < 0)
perror_reply(550, $8);
else
@ -661,7 +660,7 @@ cmd
{
if ($3)
reply(200,
"Current IDLE time limit is %d seconds; max %d",
"Current IDLE time limit is %d seconds; max %d.",
timeout, maxtimeout);
}
| SITE SP check_login IDLE SP NUMBER CRLF
@ -669,13 +668,13 @@ cmd
if ($3) {
if ($6.i < 30 || $6.i > maxtimeout) {
reply(501,
"Maximum IDLE time must be between 30 and %d seconds",
"Maximum IDLE time must be between 30 and %d seconds.",
maxtimeout);
} else {
timeout = $6.i;
(void) alarm(timeout);
reply(200,
"Maximum IDLE time set to %d seconds",
"Maximum IDLE time set to %d seconds.",
timeout);
}
}
@ -1030,7 +1029,7 @@ check_login_epsv
: /* empty */
{
if (noepsv) {
reply(500, "EPSV command disabled");
reply(500, "EPSV command disabled.");
$$ = 0;
}
else
@ -1732,11 +1731,11 @@ expglob(char *s)
else if (n == 1)
rval = strdup(p);
else {
reply(550, "ambiguous");
reply(550, "Wildcard is ambiguous.");
rval = NULL;
}
} else {
reply(550, "wildcard expansion error");
reply(550, "Wildcard expansion error.");
rval = NULL;
}
globfree(&gl);

View File

@ -894,7 +894,7 @@ sgetsave(char *s)
char *new = malloc(strlen(s) + 1);
if (new == NULL) {
perror_reply(421, "Local resource failure: malloc");
reply(421, "Ran out of memory.");
dologout(1);
/* NOTREACHED */
}
@ -1526,7 +1526,7 @@ pass(char *passwd)
reply(550, "Root is inaccessible.");
goto bad;
}
lreply(230, "No directory! Logging in with home=/");
lreply(230, "No directory! Logging in with home=/.");
}
}
@ -1710,7 +1710,7 @@ store(char *name, char *mode, int unique)
unique = 0;
}
if (guest && noguestmod) {
reply(550, "Appending to existing file denied");
reply(550, "Appending to existing file denied.");
goto err;
}
restart_point = 0; /* not affected by preceding REST */
@ -1719,7 +1719,7 @@ store(char *name, char *mode, int unique)
restart_point = 0;
if (guest && noguestmod) {
if (restart_point) { /* guest STOR w/REST */
reply(550, "Modifying existing file denied");
reply(550, "Modifying existing file denied.");
goto err;
} else /* treat guest STOR as STOU */
unique = 1;
@ -2068,7 +2068,7 @@ send_data(FILE *instr, FILE *outstr, size_t blksize, off_t filesize, int isreg)
oldway:
if ((buf = malloc(blksize)) == NULL) {
transflag = 0;
perror_reply(451, "Local resource failure: malloc");
reply(451, "Ran out of memory.");
return (-1);
}
@ -2086,7 +2086,7 @@ send_data(FILE *instr, FILE *outstr, size_t blksize, off_t filesize, int isreg)
return (0);
default:
transflag = 0;
reply(550, "Unimplemented TYPE %d in send_data", type);
reply(550, "Unimplemented TYPE %d in send_data.", type);
return (-1);
}
@ -2175,25 +2175,25 @@ receive_data(FILE *instr, FILE *outstr)
transflag = 0;
if (bare_lfs) {
lreply(226,
"WARNING! %d bare linefeeds received in ASCII mode",
"WARNING! %d bare linefeeds received in ASCII mode.",
bare_lfs);
(void)printf(" File may not have transferred correctly.\r\n");
}
return (0);
default:
reply(550, "Unimplemented TYPE %d in receive_data", type);
reply(550, "Unimplemented TYPE %d in receive_data.", type);
transflag = 0;
return (-1);
}
data_err:
transflag = 0;
perror_reply(426, "Data Connection");
perror_reply(426, "Data connection");
return (-1);
file_err:
transflag = 0;
perror_reply(452, "Error writing file");
perror_reply(452, "Error writing to file");
return (-1);
got_oob:
@ -2220,7 +2220,7 @@ statfilecmd(char *filename)
while ((c = getc(fin)) != EOF) {
if (c == '\n') {
if (ferror(stdout)){
perror_reply(421, "control connection");
perror_reply(421, "Control connection");
(void) ftpd_pclose(fin);
dologout(1);
/* NOTREACHED */
@ -2244,7 +2244,7 @@ statfilecmd(char *filename)
atstart = (c == '\n');
}
(void) ftpd_pclose(fin);
reply(code, "End of status");
reply(code, "End of status.");
}
void
@ -2377,7 +2377,7 @@ epsvonly:;
#undef UC
} else
printf(" No data connection\r\n");
reply(211, "End of status");
reply(211, "End of status.");
}
void
@ -2450,7 +2450,7 @@ yyerror(char *s)
if ((cp = strchr(cbuf,'\n')))
*cp = '\0';
reply(500, "'%s': command not understood.", cbuf);
reply(500, "%s: command not understood.", cbuf);
}
void
@ -2471,7 +2471,7 @@ delete(char *name)
goto done;
}
if (guest && noguestmod) {
reply(550, "Operation not permitted");
reply(550, "Operation not permitted.");
return;
}
if (unlink(name) < 0) {
@ -2499,7 +2499,7 @@ makedir(char *name)
LOGCMD("mkdir", name);
if (guest && noguestmkd)
reply(550, "%s: permission denied", name);
reply(550, "%s: permission denied.", name);
else if (mkdir(name, 0777) < 0)
perror_reply(550, name);
else {
@ -2542,14 +2542,14 @@ renamefrom(char *name)
struct stat st;
if (guest && noguestmod) {
reply(550, "Operation not permitted");
reply(550, "Operation not permitted.");
return (NULL);
}
if (lstat(name, &st) < 0) {
perror_reply(550, name);
return (NULL);
}
reply(350, "File exists, ready for destination name");
reply(350, "File exists, ready for destination name.");
return (name);
}
@ -2561,7 +2561,7 @@ renamecmd(char *from, char *to)
LOGCMD2("rename", from, to);
if (guest && (stat(to, &st) == 0)) {
reply(550, "%s: permission denied", to);
reply(550, "%s: permission denied.", to);
return;
}
@ -2654,15 +2654,15 @@ myoob(void)
if (strcmp(cp, "ABOR\r\n") == 0) {
tmpline[0] = '\0';
reply(426, "Transfer aborted. Data connection closed.");
reply(226, "Abort successful");
reply(226, "Abort successful.");
}
if (strcmp(cp, "STAT\r\n") == 0) {
tmpline[0] = '\0';
if (file_size != -1)
reply(213, "Status: %jd of %jd bytes transferred",
reply(213, "Status: %jd of %jd bytes transferred.",
(intmax_t)byte_count, (intmax_t)file_size);
else
reply(213, "Status: %jd bytes transferred",
reply(213, "Status: %jd bytes transferred.",
(intmax_t)byte_count);
}
}
@ -2786,7 +2786,7 @@ long_passive(char *cmd, int pf)
reply(522, "Network protocol mismatch, "
"use (%d)", pf);
} else
reply(501, "Network protocol mismatch"); /*XXX*/
reply(501, "Network protocol mismatch."); /*XXX*/
return;
}
@ -2918,7 +2918,7 @@ guniquefd(char *local, char **name)
* In this extreme case dot won't be put in front of suffix.
*/
if (strlen(local) > sizeof(new) - 4) {
reply(553, "Pathname too long");
reply(553, "Pathname too long.");
return (-1);
}
*cp = '/';
@ -2986,7 +2986,7 @@ send_file_list(char *whichf)
flags |= GLOB_LIMIT;
freeglob = 1;
if (glob(whichf, flags, 0, &gl)) {
reply(550, "not found");
reply(550, "No matching files found.");
goto out;
} else if (gl.gl_pathc == 0) {
errno = ENOENT;