* ftpd had a function getline() with non standards compatible parameters.

* This fixes the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38881 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-10-04 14:00:44 +00:00
parent 80c5b9b5ee
commit f1c26ec658
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ void fatalerror(char *);
void ftpd_logwtmp(char *, char *, struct sockaddr *addr); void ftpd_logwtmp(char *, char *, struct sockaddr *addr);
int ftpd_pclose(FILE *); int ftpd_pclose(FILE *);
FILE *ftpd_popen(char *, char *); FILE *ftpd_popen(char *, char *);
char *getline(char *, int, FILE *); char *ftpd_getline(char *, int, FILE *);
void lreply(int, const char *, ...) __printflike(2, 3); void lreply(int, const char *, ...) __printflike(2, 3);
void makedir(char *); void makedir(char *);
void nack(char *); void nack(char *);
+4 -4
View File
@@ -542,7 +542,7 @@ cmd
case MODE_S: case MODE_S:
reply(200, "MODE S accepted."); reply(200, "MODE S accepted.");
break; break;
default: default:
reply(502, "Unimplemented MODE type."); reply(502, "Unimplemented MODE type.");
} }
@@ -1194,10 +1194,10 @@ lookup(struct tab *p, char *cmd)
#include <arpa/telnet.h> #include <arpa/telnet.h>
/* /*
* getline - a hacked up version of fgets to ignore TELNET escape codes. * ftpd_getline - a hacked up version of fgets to ignore TELNET escape codes.
*/ */
char * char *
getline(char *s, int n, FILE *iop) ftpd_getline(char *s, int n, FILE *iop)
{ {
int c; int c;
register char *cs; register char *cs;
@@ -1305,7 +1305,7 @@ yylex(void)
case CMD: case CMD:
(void) signal(SIGALRM, toolong); (void) signal(SIGALRM, toolong);
(void) alarm(timeout); (void) alarm(timeout);
if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { if (ftpd_getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) {
reply(221, "You could at least say goodbye."); reply(221, "You could at least say goodbye.");
dologout(0); dologout(0);
} }
+5 -5
View File
@@ -1062,7 +1062,7 @@ user(char *name)
reply(530, "Sorry, only anonymous ftp allowed."); reply(530, "Sorry, only anonymous ftp allowed.");
return; return;
} }
if ((pw = sgetpwnam(name))) { if ((pw = sgetpwnam(name))) {
if ((shell = pw->pw_shell) == NULL || *shell == 0) if ((shell = pw->pw_shell) == NULL || *shell == 0)
shell = _PATH_BSHELL; shell = _PATH_BSHELL;
@@ -2838,7 +2838,7 @@ myoob(void)
return (0); return (0);
} }
cp = tmpline; cp = tmpline;
if (getline(cp, 7, stdin) == NULL) { if (ftpd_getline(cp, 7, stdin) == NULL) {
reply(221, "You could at least say goodbye."); reply(221, "You could at least say goodbye.");
dologout(0); dologout(0);
} }
@@ -2930,7 +2930,7 @@ passive(void)
#endif #endif
else else
goto pasv_error; goto pasv_error;
p = (char *) &pasv_addr.su_port; p = (char *) &pasv_addr.su_port;
#define UC(b) (((int) b) & 0xff) #define UC(b) (((int) b) & 0xff)
@@ -2989,7 +2989,7 @@ long_passive(char *cmd, int pf)
return; return;
} }
} }
pdata = socket(ctrl_addr.su_family, SOCK_STREAM, 0); pdata = socket(ctrl_addr.su_family, SOCK_STREAM, 0);
if (pdata < 0) { if (pdata < 0) {
perror_reply(425, "Can't open passive connection"); perror_reply(425, "Can't open passive connection");
@@ -3128,7 +3128,7 @@ guniquefd(char *local, char **name)
/* -4 is for the .nn<null> we put on the end below */ /* -4 is for the .nn<null> we put on the end below */
(void) snprintf(new, sizeof(new) - 4, "%s", local); (void) snprintf(new, sizeof(new) - 4, "%s", local);
cp = new + strlen(new); cp = new + strlen(new);
/* /*
* Don't generate dotfile unless requested explicitly. * Don't generate dotfile unless requested explicitly.
* This covers the case when basename gets truncated off * This covers the case when basename gets truncated off
* by buffer size. * by buffer size.