version 1.48.2.2, 2001/03/29 14:14:17 |
version 1.66.2.1, 2002/06/15 03:42:33 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
|
|
/*- |
/*- |
* Copyright (c) 1997-2000 The NetBSD Foundation, Inc. |
* Copyright (c) 1997-2001 The NetBSD Foundation, Inc. |
* All rights reserved. |
* All rights reserved. |
* |
* |
* This code is derived from software contributed to The NetBSD Foundation |
* This code is derived from software contributed to The NetBSD Foundation |
Line 97 __RCSID("$NetBSD$"); |
|
Line 97 __RCSID("$NetBSD$"); |
|
|
|
#include <ctype.h> |
#include <ctype.h> |
#include <errno.h> |
#include <errno.h> |
#include <glob.h> |
|
#include <pwd.h> |
#include <pwd.h> |
#include <setjmp.h> |
#include <setjmp.h> |
#include <signal.h> |
#include <signal.h> |
Line 121 static int cmd_type; |
|
Line 120 static int cmd_type; |
|
static int cmd_form; |
static int cmd_form; |
static int cmd_bytesz; |
static int cmd_bytesz; |
|
|
char cbuf[512]; |
char cbuf[FTP_BUFLEN]; |
|
char *cmdp; |
char *fromname; |
char *fromname; |
|
|
%} |
%} |
|
|
%type <s> pathstring pathname password username |
%type <s> pathstring pathname password username |
%type <s> mechanism_name base64data prot_code |
%type <s> mechanism_name base64data prot_code |
|
|
%start cmd_list |
%start cmd_sel |
|
|
%% |
%% |
|
|
cmd_list |
cmd_sel |
: /* empty */ |
: cmd |
|
|
| cmd_list cmd |
|
{ |
{ |
fromname = NULL; |
fromname = NULL; |
restart_point = (off_t) 0; |
restart_point = (off_t) 0; |
} |
} |
|
|
| cmd_list rcmd |
| rcmd |
|
|
; |
; |
|
|
|
|
|
|
| ABOR check_login CRLF |
| ABOR check_login CRLF |
{ |
{ |
if ($2) |
if (is_oob) |
|
abor(); |
|
else if ($2) |
reply(225, "ABOR command successful."); |
reply(225, "ABOR command successful."); |
} |
} |
|
|
|
|
{ |
{ |
int oldmask; |
int oldmask; |
|
|
if ($4 && CURCLASS_FLAGS_ISSET(modify)) { |
if ($4 && check_write("", 0)) { |
if (($6 == -1) || ($6 > 0777)) { |
if (($6 == -1) || ($6 > 0777)) { |
reply(501, "Bad UMASK value"); |
reply(501, "Bad UMASK value"); |
} else { |
} else { |
|
|
|
|
| STAT CRLF |
| STAT CRLF |
{ |
{ |
statcmd(); |
if (is_oob) |
|
statxfer(); |
|
else |
|
statcmd(); |
} |
} |
|
|
| HELP CRLF |
| HELP CRLF |
|
|
* others. |
* others. |
*/ |
*/ |
if (logged_in && $1 && *$1 == '~') { |
if (logged_in && $1 && *$1 == '~') { |
glob_t gl; |
char *path, *home, *result; |
int flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE; |
size_t len; |
|
|
|
path = strchr($1 + 1, '/'); |
|
if (path != NULL) |
|
*path++ = '\0'; |
if ($1[1] == '\0') |
if ($1[1] == '\0') |
$$ = xstrdup(homedir); |
home = homedir; |
else { |
else { |
memset(&gl, 0, sizeof(gl)); |
struct passwd *hpw; |
if (glob($1, flags, NULL, &gl) || |
|
gl.gl_pathc == 0) { |
if ((hpw = getpwnam($1 + 1)) != NULL) |
reply(550, "not found"); |
home = hpw->pw_dir; |
$$ = NULL; |
else |
} else |
home = $1; |
$$ = xstrdup(gl.gl_pathv[0]); |
} |
globfree(&gl); |
len = strlen(home) + 1; |
|
if (path != NULL) |
|
len += strlen(path) + 1; |
|
if ((result = malloc(len)) == NULL) |
|
fatal("Local resource failure: malloc"); |
|
strlcpy(result, home, len); |
|
if (path != NULL) { |
|
strlcat(result, "/", len); |
|
strlcat(result, path, len); |
} |
} |
|
$$ = result; |
free($1); |
free($1); |
} else |
} else |
$$ = $1; |
$$ = $1; |
|
|
#define SITECMD 7 /* SITE command */ |
#define SITECMD 7 /* SITE command */ |
#define NSTR 8 /* Number followed by a string */ |
#define NSTR 8 /* Number followed by a string */ |
#define NOARGS 9 /* No arguments allowed */ |
#define NOARGS 9 /* No arguments allowed */ |
|
#define EOLN 10 /* End of line */ |
|
|
struct tab cmdtab[] = { |
struct tab cmdtab[] = { |
/* From RFC 959, in order defined (5.3.1) */ |
/* From RFC 959, in order defined (5.3.1) */ |
Line 1198 struct tab cmdtab[] = { |
|
Line 1214 struct tab cmdtab[] = { |
|
{ "REST", REST, ARGS, 1, "<sp> offset (restart command)" }, |
{ "REST", REST, ARGS, 1, "<sp> offset (restart command)" }, |
{ "RNFR", RNFR, STR1, 1, "<sp> file-name" }, |
{ "RNFR", RNFR, STR1, 1, "<sp> file-name" }, |
{ "RNTO", RNTO, STR1, 1, "<sp> file-name" }, |
{ "RNTO", RNTO, STR1, 1, "<sp> file-name" }, |
{ "ABOR", ABOR, NOARGS, 1, "(abort operation)" }, |
{ "ABOR", ABOR, NOARGS, 4, "(abort operation)" }, |
{ "DELE", DELE, STR1, 1, "<sp> file-name" }, |
{ "DELE", DELE, STR1, 1, "<sp> file-name" }, |
{ "RMD", RMD, STR1, 1, "<sp> path-name" }, |
{ "RMD", RMD, STR1, 1, "<sp> path-name" }, |
{ "MKD", MKD, STR1, 1, "<sp> path-name" }, |
{ "MKD", MKD, STR1, 1, "<sp> path-name" }, |
Line 1207 struct tab cmdtab[] = { |
|
Line 1223 struct tab cmdtab[] = { |
|
{ "NLST", NLST, OSTR, 1, "[ <sp> path-name ]" }, |
{ "NLST", NLST, OSTR, 1, "[ <sp> path-name ]" }, |
{ "SITE", SITE, SITECMD, 1, "site-cmd [ <sp> arguments ]" }, |
{ "SITE", SITE, SITECMD, 1, "site-cmd [ <sp> arguments ]" }, |
{ "SYST", SYST, NOARGS, 1, "(get type of operating system)" }, |
{ "SYST", SYST, NOARGS, 1, "(get type of operating system)" }, |
{ "STAT", STAT, OSTR, 1, "[ <sp> path-name ]" }, |
{ "STAT", STAT, OSTR, 4, "[ <sp> path-name ]" }, |
{ "HELP", HELP, OSTR, 1, "[ <sp> <string> ]" }, |
{ "HELP", HELP, OSTR, 1, "[ <sp> <string> ]" }, |
{ "NOOP", NOOP, NOARGS, 2, "" }, |
{ "NOOP", NOOP, NOARGS, 2, "" }, |
|
|
Line 1217 struct tab cmdtab[] = { |
|
Line 1233 struct tab cmdtab[] = { |
|
{ "PROT", PROT, STR1, 1, "<sp> prot-code" }, |
{ "PROT", PROT, STR1, 1, "<sp> prot-code" }, |
{ "PBSZ", PBSZ, ARGS, 1, "<sp> decimal-integer" }, |
{ "PBSZ", PBSZ, ARGS, 1, "<sp> decimal-integer" }, |
{ "CCC", CCC, NOARGS, 1, "(Disable data protection)" }, |
{ "CCC", CCC, NOARGS, 1, "(Disable data protection)" }, |
{ "MIC", MIC, STR1, 1, "<sp> base64data" }, |
{ "MIC", MIC, STR1, 4, "<sp> base64data" }, |
{ "CONF", CONF, STR1, 1, "<sp> base64data" }, |
{ "CONF", CONF, STR1, 4, "<sp> base64data" }, |
{ "ENC", ENC, STR1, 1, "<sp> base64data" }, |
{ "ENC", ENC, STR1, 4, "<sp> base64data" }, |
|
|
/* From RFC 2389, in order defined */ |
/* From RFC 2389, in order defined */ |
{ "FEAT", FEAT, NOARGS, 1, "(display extended features)" }, |
{ "FEAT", FEAT, NOARGS, 1, "(display extended features)" }, |
Line 1269 extern int epsvall; |
|
Line 1285 extern int epsvall; |
|
/* |
/* |
* Check if a filename is allowed to be modified (isupload == 0) or |
* Check if a filename is allowed to be modified (isupload == 0) or |
* uploaded (isupload == 1), and if necessary, check the filename is `sane'. |
* uploaded (isupload == 1), and if necessary, check the filename is `sane'. |
|
* If the filename is NULL, fail. |
|
* If the filename is "", don't do the sane name check. |
*/ |
*/ |
static int |
static int |
check_write(const char *file, int isupload) |
check_write(const char *file, int isupload) |
Line 1289 check_write(const char *file, int isuplo |
|
Line 1307 check_write(const char *file, int isuplo |
|
reply(502, "No permission to use this command."); |
reply(502, "No permission to use this command."); |
return (0); |
return (0); |
} |
} |
|
|
/* checking sanenames */ |
/* checking sanenames */ |
if (CURCLASS_FLAGS_ISSET(sanenames)) { |
if (file[0] != '\0' && CURCLASS_FLAGS_ISSET(sanenames)) { |
const char *p; |
const char *p; |
|
|
if (file[0] == '.') |
if (file[0] == '.') |
Line 1418 toolong(int signo) |
|
Line 1437 toolong(int signo) |
|
dologout(1); |
dologout(1); |
} |
} |
|
|
|
void |
|
ftp_handle_line(char *cp) |
|
{ |
|
|
|
cmdp = cp; |
|
yyparse(); |
|
} |
|
|
|
void |
|
ftp_loop(void) |
|
{ |
|
|
|
while (1) { |
|
(void) signal(SIGALRM, toolong); |
|
(void) alarm(curclass.timeout); |
|
if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { |
|
reply(221, "You could at least say goodbye."); |
|
dologout(0); |
|
} |
|
(void) alarm(0); |
|
ftp_handle_line(cbuf); |
|
} |
|
/*NOTREACHED*/ |
|
} |
|
|
static int |
static int |
yylex(void) |
yylex(void) |
{ |
{ |
|
|
|
|
case CMD: |
case CMD: |
hasyyerrored = 0; |
hasyyerrored = 0; |
(void) signal(SIGALRM, toolong); |
if ((cp = strchr(cmdp, '\r'))) { |
(void) alarm(curclass.timeout); |
|
if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { |
|
reply(221, "You could at least say goodbye."); |
|
dologout(0); |
|
} |
|
(void) alarm(0); |
|
if ((cp = strchr(cbuf, '\r'))) { |
|
*cp = '\0'; |
*cp = '\0'; |
#if HAVE_SETPROCTITLE |
#if HAVE_SETPROCTITLE |
if (strncasecmp(cbuf, "PASS", 4) != 0 && |
if (strncasecmp(cmdp, "PASS", 4) != 0 && |
strncasecmp(cbuf, "ACCT", 4) != 0) |
strncasecmp(cmdp, "ACCT", 4) != 0) |
setproctitle("%s: %s", proctitle, cbuf); |
setproctitle("%s: %s", proctitle, cmdp); |
#endif /* HAVE_SETPROCTITLE */ |
#endif /* HAVE_SETPROCTITLE */ |
*cp++ = '\n'; |
*cp++ = '\n'; |
*cp = '\0'; |
*cp = '\0'; |
} |
} |
if ((cp = strpbrk(cbuf, " \n"))) |
if ((cp = strpbrk(cmdp, " \n"))) |
cpos = cp - cbuf; |
cpos = cp - cmdp; |
if (cpos == 0) |
if (cpos == 0) |
cpos = 4; |
cpos = 4; |
c = cbuf[cpos]; |
c = cmdp[cpos]; |
cbuf[cpos] = '\0'; |
cmdp[cpos] = '\0'; |
p = lookup(cmdtab, cbuf); |
p = lookup(cmdtab, cmdp); |
cbuf[cpos] = c; |
cmdp[cpos] = c; |
if (p != NULL) { |
if (p != NULL) { |
if (! CMD_IMPLEMENTED(p)) { |
if (is_oob && ! CMD_OOB(p)) { |
|
/* command will be handled in-band */ |
|
return (0); |
|
} else if (! CMD_IMPLEMENTED(p)) { |
reply(502, "%s command not implemented.", |
reply(502, "%s command not implemented.", |
p->name); |
p->name); |
hasyyerrored = 1; |
hasyyerrored = 1; |
|
|
break; |
break; |
|
|
case SITECMD: |
case SITECMD: |
if (cbuf[cpos] == ' ') { |
if (cmdp[cpos] == ' ') { |
cpos++; |
cpos++; |
return (SP); |
return (SP); |
} |
} |
cp = &cbuf[cpos]; |
cp = &cmdp[cpos]; |
if ((cp2 = strpbrk(cp, " \n"))) |
if ((cp2 = strpbrk(cp, " \n"))) |
cpos = cp2 - cbuf; |
cpos = cp2 - cmdp; |
c = cbuf[cpos]; |
c = cmdp[cpos]; |
cbuf[cpos] = '\0'; |
cmdp[cpos] = '\0'; |
p = lookup(sitetab, cp); |
p = lookup(sitetab, cp); |
cbuf[cpos] = c; |
cmdp[cpos] = c; |
if (p != NULL) { |
if (p != NULL) { |
if (!CMD_IMPLEMENTED(p)) { |
if (!CMD_IMPLEMENTED(p)) { |
reply(502, "SITE %s command not implemented.", |
reply(502, "SITE %s command not implemented.", |
|
|
break; |
break; |
|
|
case OSTR: |
case OSTR: |
if (cbuf[cpos] == '\n') { |
if (cmdp[cpos] == '\n') { |
state = CMD; |
state = EOLN; |
return (CRLF); |
return (CRLF); |
} |
} |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
|
|
case STR1: |
case STR1: |
case ZSTR1: |
case ZSTR1: |
dostr1: |
dostr1: |
if (cbuf[cpos] == ' ') { |
if (cmdp[cpos] == ' ') { |
cpos++; |
cpos++; |
state = state == OSTR ? STR2 : state+1; |
state = state == OSTR ? STR2 : state+1; |
return (SP); |
return (SP); |
|
|
break; |
break; |
|
|
case ZSTR2: |
case ZSTR2: |
if (cbuf[cpos] == '\n') { |
if (cmdp[cpos] == '\n') { |
state = CMD; |
state = EOLN; |
return (CRLF); |
return (CRLF); |
} |
} |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
|
|
case STR2: |
case STR2: |
cp = &cbuf[cpos]; |
cp = &cmdp[cpos]; |
n = strlen(cp); |
n = strlen(cp); |
cpos += n - 1; |
cpos += n - 1; |
/* |
/* |
* Make sure the string is nonempty and \n terminated. |
* Make sure the string is nonempty and \n terminated. |
*/ |
*/ |
if (n > 1 && cbuf[cpos] == '\n') { |
if (n > 1 && cmdp[cpos] == '\n') { |
cbuf[cpos] = '\0'; |
cmdp[cpos] = '\0'; |
yylval.s = xstrdup(cp); |
yylval.s = xstrdup(cp); |
cbuf[cpos] = '\n'; |
cmdp[cpos] = '\n'; |
state = ARGS; |
state = ARGS; |
return (STRING); |
return (STRING); |
} |
} |
break; |
break; |
|
|
case NSTR: |
case NSTR: |
if (cbuf[cpos] == ' ') { |
if (cmdp[cpos] == ' ') { |
cpos++; |
cpos++; |
return (SP); |
return (SP); |
} |
} |
if (isdigit(cbuf[cpos])) { |
if (isdigit(cmdp[cpos])) { |
cp = &cbuf[cpos]; |
cp = &cmdp[cpos]; |
while (isdigit(cbuf[++cpos])) |
while (isdigit(cmdp[++cpos])) |
; |
; |
c = cbuf[cpos]; |
c = cmdp[cpos]; |
cbuf[cpos] = '\0'; |
cmdp[cpos] = '\0'; |
yylval.i = atoi(cp); |
yylval.i = atoi(cp); |
cbuf[cpos] = c; |
cmdp[cpos] = c; |
state = STR1; |
state = STR1; |
return (NUMBER); |
return (NUMBER); |
} |
} |
|
|
goto dostr1; |
goto dostr1; |
|
|
case ARGS: |
case ARGS: |
if (isdigit(cbuf[cpos])) { |
if (isdigit(cmdp[cpos])) { |
cp = &cbuf[cpos]; |
cp = &cmdp[cpos]; |
while (isdigit(cbuf[++cpos])) |
while (isdigit(cmdp[++cpos])) |
; |
; |
c = cbuf[cpos]; |
c = cmdp[cpos]; |
cbuf[cpos] = '\0'; |
cmdp[cpos] = '\0'; |
yylval.i = atoi(cp); |
yylval.i = atoi(cp); |
cbuf[cpos] = c; |
cmdp[cpos] = c; |
return (NUMBER); |
return (NUMBER); |
} |
} |
if (strncasecmp(&cbuf[cpos], "ALL", 3) == 0 |
if (strncasecmp(&cmdp[cpos], "ALL", 3) == 0 |
&& !isalnum(cbuf[cpos + 3])) { |
&& !isalnum(cmdp[cpos + 3])) { |
yylval.s = xstrdup("ALL"); |
yylval.s = xstrdup("ALL"); |
cpos += 3; |
cpos += 3; |
return ALL; |
return ALL; |
} |
} |
switch (cbuf[cpos++]) { |
switch (cmdp[cpos++]) { |
|
|
case '\n': |
case '\n': |
state = CMD; |
state = EOLN; |
return (CRLF); |
return (CRLF); |
|
|
case ' ': |
case ' ': |
|
|
break; |
break; |
|
|
case NOARGS: |
case NOARGS: |
if (cbuf[cpos] == '\n') { |
if (cmdp[cpos] == '\n') { |
state = CMD; |
state = EOLN; |
return (CRLF); |
return (CRLF); |
} |
} |
c = cbuf[cpos]; |
c = cmdp[cpos]; |
cbuf[cpos] = '\0'; |
cmdp[cpos] = '\0'; |
reply(501, "'%s' command does not take any arguments.", cbuf); |
reply(501, "'%s' command does not take any arguments.", cmdp); |
hasyyerrored = 1; |
hasyyerrored = 1; |
cbuf[cpos] = c; |
cmdp[cpos] = c; |
break; |
break; |
|
|
|
case EOLN: |
|
state = CMD; |
|
return (0); |
|
|
default: |
default: |
fatal("Unknown state in scanner."); |
fatal("Unknown state in scanner."); |
} |
} |
yyerror(NULL); |
yyerror(NULL); |
state = CMD; |
state = CMD; |
|
is_oob = 0; |
longjmp(errcatch, 0); |
longjmp(errcatch, 0); |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
Line 1660 yyerror(char *s) |
|
Line 1705 yyerror(char *s) |
|
{ |
{ |
char *cp; |
char *cp; |
|
|
if (hasyyerrored) |
if (hasyyerrored || is_oob) |
return; |
return; |
if ((cp = strchr(cbuf,'\n')) != NULL) |
if ((cp = strchr(cmdp,'\n')) != NULL) |
*cp = '\0'; |
*cp = '\0'; |
reply(500, "'%s': command not understood.", cbuf); |
reply(500, "'%s': command not understood.", cmdp); |
hasyyerrored = 1; |
hasyyerrored = 1; |
} |
} |
|
|
Line 1673 help(struct tab *ctab, const char *s) |
|
Line 1718 help(struct tab *ctab, const char *s) |
|
{ |
{ |
struct tab *c; |
struct tab *c; |
int width, NCMDS; |
int width, NCMDS; |
char *type; |
char *htype; |
|
|
if (ctab == sitetab) |
if (ctab == sitetab) |
type = "SITE "; |
htype = "SITE "; |
else |
else |
type = ""; |
htype = ""; |
width = 0, NCMDS = 0; |
width = 0, NCMDS = 0; |
for (c = ctab; c->name != NULL; c++) { |
for (c = ctab; c->name != NULL; c++) { |
int len = strlen(c->name); |
int len = strlen(c->name); |
Line 1693 help(struct tab *ctab, const char *s) |
|
Line 1738 help(struct tab *ctab, const char *s) |
|
int columns, lines; |
int columns, lines; |
|
|
reply(-214, "%s", ""); |
reply(-214, "%s", ""); |
reply(0, "The following %scommands are recognized.", type); |
reply(0, "The following %scommands are recognized.", htype); |
reply(0, "(`-' = not implemented, `+' = supports options)"); |
reply(0, "(`-' = not implemented, `+' = supports options)"); |
columns = 76 / width; |
columns = 76 / width; |
if (columns == 0) |
if (columns == 0) |
Line 1732 help(struct tab *ctab, const char *s) |
|
Line 1777 help(struct tab *ctab, const char *s) |
|
return; |
return; |
} |
} |
if (CMD_IMPLEMENTED(c)) |
if (CMD_IMPLEMENTED(c)) |
reply(214, "Syntax: %s%s %s", type, c->name, c->help); |
reply(214, "Syntax: %s%s %s", htype, c->name, c->help); |
else |
else |
reply(214, "%s%-*s\t%s; not implemented.", type, width, |
reply(214, "%s%-*s\t%s; not implemented.", htype, width, |
c->name, c->help); |
c->name, c->help); |
} |
} |
|
|
Line 1746 help(struct tab *ctab, const char *s) |
|
Line 1791 help(struct tab *ctab, const char *s) |
|
static void |
static void |
port_check(const char *cmd, int family) |
port_check(const char *cmd, int family) |
{ |
{ |
|
char h1[NI_MAXHOST], h2[NI_MAXHOST]; |
|
char s1[NI_MAXHOST], s2[NI_MAXHOST]; |
|
#ifdef NI_WITHSCOPEID |
|
const int niflags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; |
|
#else |
|
const int niflags = NI_NUMERICHOST | NI_NUMERICSERV; |
|
#endif |
|
|
if (epsvall) { |
if (epsvall) { |
reply(501, "%s disallowed after EPSV ALL", cmd); |
reply(501, "%s disallowed after EPSV ALL", cmd); |
Line 1763 port_check(const char *cmd, int family) |
|
Line 1815 port_check(const char *cmd, int family) |
|
|
|
/* be paranoid, if told so */ |
/* be paranoid, if told so */ |
if (CURCLASS_FLAGS_ISSET(checkportcmd)) { |
if (CURCLASS_FLAGS_ISSET(checkportcmd)) { |
if ((ntohs(data_dest.su_port) < IPPORT_RESERVED) || |
|
(data_dest.su_len != his_addr.su_len)) |
|
goto port_check_fail; |
|
switch (data_dest.su_family) { |
|
case AF_INET: |
|
if (memcmp(&data_dest.su_addr, &his_addr.su_addr, |
|
data_dest.su_len) != 0) |
|
goto port_check_fail; |
|
break; |
|
#ifdef INET6 |
#ifdef INET6 |
case AF_INET6: |
/* |
if (memcmp(&data_dest.su_6addr, &his_addr.su_6addr, |
* be paranoid, there are getnameinfo implementation that does |
sizeof(data_dest.su_6addr)) != 0) |
* not present scopeid portion |
goto port_check_fail; |
*/ |
if (data_dest.su_scope_id != his_addr.su_scope_id) |
if (data_dest.su_family == AF_INET6 && |
goto port_check_fail; |
data_dest.su_scope_id != his_addr.su_scope_id) |
break; |
goto port_check_fail; |
#endif |
#endif |
default: |
|
|
if (getnameinfo((struct sockaddr *)&data_dest, data_dest.su_len, |
|
h1, sizeof(h1), s1, sizeof(s1), niflags)) |
|
goto port_check_fail; |
|
if (getnameinfo((struct sockaddr *)&his_addr, his_addr.su_len, |
|
h2, sizeof(h2), s2, sizeof(s2), niflags)) |
|
goto port_check_fail; |
|
|
|
if (atoi(s1) < IPPORT_RESERVED || strcmp(h1, h2) != 0) |
goto port_check_fail; |
goto port_check_fail; |
} |
|
} |
} |
|
|
usedefault = 0; |
usedefault = 0; |