diff options
author | pawel <pawel@FreeBSD.org> | 2014-02-08 03:58:27 +0800 |
---|---|---|
committer | pawel <pawel@FreeBSD.org> | 2014-02-08 03:58:27 +0800 |
commit | 0e2a4852fb991bc2946fe609f505b73a456a827d (patch) | |
tree | 54f2a1f7affd057e97ec332433952e67d0550c17 /net/netsed | |
parent | b4038debdec8951f5312cb8999bbe039378c8456 (diff) | |
download | freebsd-ports-gnome-0e2a4852fb991bc2946fe609f505b73a456a827d.tar.gz freebsd-ports-gnome-0e2a4852fb991bc2946fe609f505b73a456a827d.tar.zst freebsd-ports-gnome-0e2a4852fb991bc2946fe609f505b73a456a827d.zip |
- Update to version 1.2, take maintainership [1]
- Stage support
PR: ports/186511 [1]
Submitted by: Nikola Kolev <koue@chaosophia.net>
Diffstat (limited to 'net/netsed')
-rw-r--r-- | net/netsed/Makefile | 21 | ||||
-rw-r--r-- | net/netsed/distinfo | 4 | ||||
-rw-r--r-- | net/netsed/files/patch-netsed.c | 78 |
3 files changed, 9 insertions, 94 deletions
diff --git a/net/netsed/Makefile b/net/netsed/Makefile index a4d8970e8e7f..c4863c8fc684 100644 --- a/net/netsed/Makefile +++ b/net/netsed/Makefile @@ -2,29 +2,22 @@ # $FreeBSD$ PORTNAME= netsed -PORTVERSION= 0.01 -PORTREVISION= 1 +PORTVERSION= 1.2 CATEGORIES= net security -MASTER_SITES= # no original distfile site available -DISTNAME= ${PORTNAME} -EXTRACT_SUFX= .tgz +MASTER_SITES= http://silicone.homelinux.org/release/netsed/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= koue@chaosophia.net COMMENT= Alters the contents of network packets in real time +USES= gmake MAKE_ARGS= CFLAGS="${CFLAGS}" -WRKSRC= ${WRKDIR} - PLIST_FILES= bin/${PORTNAME} PORTDOCS= README -NO_STAGE= yes do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} -.endif + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} .include <bsd.port.mk> diff --git a/net/netsed/distinfo b/net/netsed/distinfo index 3b94d5af1718..7b88e4b59feb 100644 --- a/net/netsed/distinfo +++ b/net/netsed/distinfo @@ -1,2 +1,2 @@ -SHA256 (netsed.tgz) = a04f6b235d787b1efd96ecdb398e6c8456301dbf965840e6fcbad36c68372dce -SIZE (netsed.tgz) = 6352 +SHA256 (netsed-1.2.tar.gz) = 0a7f12bac83d02c6fc837055bf4ff02c1bdfc8ea478227afcc762e92d1661c80 +SIZE (netsed-1.2.tar.gz) = 28835 diff --git a/net/netsed/files/patch-netsed.c b/net/netsed/files/patch-netsed.c deleted file mode 100644 index ed5fc3d88a06..000000000000 --- a/net/netsed/files/patch-netsed.c +++ /dev/null @@ -1,78 +0,0 @@ ---- netsed.c.orig Fri Jan 5 18:58:22 2001 -+++ netsed.c Sun Aug 11 14:32:29 2002 -@@ -2,6 +2,7 @@ - #include <unistd.h> - #include <sys/types.h> - #include <sys/socket.h> -+#include <sys/wait.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <fcntl.h> -@@ -45,11 +46,11 @@ - ERR("This will replace all occurences of pat1 with pat2 in matching packets.\n"); - ERR("Additional parameter (count) can be used to expire rule after 'count'\n"); - ERR("succesful substitutions. Eight-bit characters, including NULL and '/', can\n"); -- ERR("be passed using HTTP-alike hex escape sequences (eg. %%0a%%0d). Single '%%'\n"); -- ERR("can be reached by using '%%%%'. Examples:\n\n"); -- ERR(" 's/anrew/mike/1' - replace 'andrew' with 'mike' (once)\n"); -- ERR(" 's/anrew/mike' - replace all occurences of 'andrew' with 'mike'\n"); -- ERR(" 's/anrew/mike%%00' - replace 'andrew' with 'mike\\x00' (to keep orig. size)\n"); -+ ERR("be passed using HTTP-alike hex escape sequences (eg. CRLF -> %%0a%%0d).\n"); -+ ERR("Single '%%' can be reached by using '%%%%'. Examples:\n\n"); -+ ERR(" 's/andrew/mike/1' - replace 'andrew' with 'mike' (once)\n"); -+ ERR(" 's/andrew/mike' - replace all occurrences of 'andrew' with 'mike'\n"); -+ ERR(" 's/andrew/mike%%00' - replace 'andrew' with 'mike\\x00' (to keep orig. size)\n"); - ERR(" 's/%%%%/%%2f/20' - replace '%%' with '/' in first 20 packets\n\n"); - ERR("Rules are not working on cross-packet boundaries and are evaluated from\n"); - ERR("first to last not expired rule.\n"); -@@ -134,8 +135,10 @@ - - - void bind_and_listen(int tcp,int port) { -+ int on=1; - struct sockaddr_in laddr; - lsock=socket(PF_INET,tcp ? SOCK_STREAM:SOCK_DGRAM,0); -+ setsockopt(lsock, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)); - fcntl(lsock,F_SETFL,O_NONBLOCK); - laddr.sin_family = PF_INET; - laddr.sin_port = htons (port); -@@ -186,7 +189,6 @@ - rd=read(s1,buf,sizeof(buf)); - if (rd<0 && errno!=EAGAIN) return 0; // s1 not connected - if (rd>0) { -- fcntl(s2,F_SETFL,O_SYNC); - printf("[+] Caught server -> client packet.\n"); - rd=sed_the_buffer(rd); - if (write(s2,b2,rd)<=0) return 0; // not able to send -@@ -195,7 +197,6 @@ - rd=read(s2,buf,sizeof(buf)); - if (rd<0 && errno!=EAGAIN) return 0; // s2 not connected - if (rd>0) { -- fcntl(s1,F_SETFL,O_SYNC); - printf("[+] Caught client -> server packet.\n"); - rd=sed_the_buffer(rd); - if (write(s1,b2,rd)<=0) return 0; // not able to send -@@ -204,6 +205,14 @@ - return 1; - } - -+void sig_chld(int signo) -+{ -+ pid_t pid; -+ int stat; -+ while ( (pid = waitpid(-1, &stat, WNOHANG)) > 0) -+ printf("child %d terminated\n", pid); -+ return; -+} - - int main(int argc,char* argv[]) { - int i; -@@ -242,7 +251,7 @@ - if (fixedhost && fixedport) printf("[+] Using fixed forwarding to %s:%s.\n",argv[3],argv[4]); - else printf("[+] Using dynamic (transparent proxy) forwarding.\n"); - signal(SIGPIPE,SIG_IGN); -- signal(SIGCHLD,SIG_IGN); -+ signal(SIGCHLD,sig_chld); - - // Am I bad coder?;> - |