diff options
author | ru <ru@FreeBSD.org> | 2000-06-14 16:09:35 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-06-14 16:09:35 +0000 |
commit | 3fa18b8916fe9b25c5597ac51644d51a66e57238 (patch) | |
tree | d69af5730e2b0b6f917d67e1eb14b4671f019e7e /lib/libalias/alias_db.c | |
parent | 7fdfc2ad2ca6774773c812876c9e0c5b7023d9cb (diff) | |
download | FreeBSD-src-3fa18b8916fe9b25c5597ac51644d51a66e57238.zip FreeBSD-src-3fa18b8916fe9b25c5597ac51644d51a66e57238.tar.gz |
- Added support for passive mode FTP by aliasing 227 replies.
It does mean that it is now possible to run passive-mode FTP
server behind NAT.
- SECURITY: FTP aliasing engine now ensures that:
o the segment preceding a PORT/227 segment terminates with a \r\n;
o the IP address in the PORT/227 matches the source IP address of
the packet;
o the port number in the PORT command or 277 reply is greater than
or equal to 1024.
Submitted by: Erik Salander <erik@whistle.com>
Reviewed by: ru
Diffstat (limited to 'lib/libalias/alias_db.c')
-rw-r--r-- | lib/libalias/alias_db.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c index e7a8901..211a7c2 100644 --- a/lib/libalias/alias_db.c +++ b/lib/libalias/alias_db.c @@ -274,6 +274,7 @@ struct alias_link /* Main data structure */ #define LINK_PERMANENT 0x04 #define LINK_PARTIALLY_SPECIFIED 0x03 /* logical-or of first two bits */ #define LINK_UNFIREWALLED 0x08 +#define LINK_LAST_LINE_CRLF_TERMED 0x10 int timestamp; /* Time link was last accessed */ int expire_time; /* Expire time for link */ @@ -1596,6 +1597,7 @@ FindAliasAddress(struct in_addr original_addr) GetOriginalPort(), GetAliasPort() SetAckModified(), GetAckModified() GetDeltaAckIn(), GetDeltaSeqOut(), AddSeq() + SetLastLineCrlfTermed(), GetLastLineCrlfTermed() */ @@ -1961,6 +1963,23 @@ ClearCheckNewLink(void) newDefaultLink = 0; } +void +SetLastLineCrlfTermed(struct alias_link *link, int yes) +{ + + if (yes) + link->flags |= LINK_LAST_LINE_CRLF_TERMED; + else + link->flags &= ~LINK_LAST_LINE_CRLF_TERMED; +} + +int +GetLastLineCrlfTermed(struct alias_link *link) +{ + + return (link->flags & LINK_LAST_LINE_CRLF_TERMED); +} + /* Miscellaneous Functions |