aboutsummaryrefslogtreecommitdiff
path: root/security/arirang
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2011-07-25 22:44:29 +0000
committerSteve Wills <swills@FreeBSD.org>2011-07-25 22:44:29 +0000
commit4ad820565ce607f11c74d0f1e81ff96b5753a70f (patch)
tree8efbfb2f2f77abdaaeeb4271dde6770916da7e02 /security/arirang
parent0982b5834cdc5e7fb81f8da7b59eceb8c367960e (diff)
downloadports-4ad820565ce607f11c74d0f1e81ff96b5753a70f.tar.gz
ports-4ad820565ce607f11c74d0f1e81ff96b5753a70f.zip
Notes
Diffstat (limited to 'security/arirang')
-rw-r--r--security/arirang/Makefile10
-rw-r--r--security/arirang/files/extra-patch-ruby1919
-rw-r--r--security/arirang/files/patch-ariruby.c38
3 files changed, 59 insertions, 8 deletions
diff --git a/security/arirang/Makefile b/security/arirang/Makefile
index 1e9e85b22928..19e4d6680d72 100644
--- a/security/arirang/Makefile
+++ b/security/arirang/Makefile
@@ -7,7 +7,7 @@
PORTNAME= arirang
PORTVERSION= 2.02
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= security www
MASTER_SITES= http://monkey.org/~pilot/arirang/
@@ -24,6 +24,8 @@ USE_LIBRUBY= yes
USE_OPENSSL= yes
+CFLAGS+= -I${LOCALBASE}/include/ruby-${RUBY_VER} -I${LOCALBASE}/include/ruby-${RUBY_VER}/${RUBY_ARCH}
+
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/arirang ${PREFIX}/sbin
${MKDIR} ${PREFIX}/share/arirang
@@ -31,4 +33,8 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/scanrule/*.uxe ${PREFIX}/share/arirang
${INSTALL_DATA} ${WRKSRC}/script/*.rb ${PREFIX}/share/arirang
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+.if ${RUBY_VER} == 1.9
+EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ruby19
+.endif
+.include <bsd.port.post.mk>
diff --git a/security/arirang/files/extra-patch-ruby19 b/security/arirang/files/extra-patch-ruby19
new file mode 100644
index 000000000000..ef7b1551f326
--- /dev/null
+++ b/security/arirang/files/extra-patch-ruby19
@@ -0,0 +1,19 @@
+--- ariruby.c.orig 2011-07-24 21:50:51.119557755 -0400
++++ ariruby.c 2011-07-24 21:52:04.985558821 -0400
+@@ -63,6 +63,7 @@
+
+ static int sock;
+ int nb = 0;
++void* rb_load_file_return;
+ struct sockaddr_in http;
+ struct hostent *he;
+ char *sendbuf = NULL;
+@@ -132,7 +133,7 @@
+ ariruby_run(void)
+ {
+ int status;
+- status = ruby_exec();
++ status = ruby_run_node(rb_load_file_return);
+ #ifdef DEBUG
+ printf("status = %d \n", status);
+ #endif
diff --git a/security/arirang/files/patch-ariruby.c b/security/arirang/files/patch-ariruby.c
index b44c4f587eb5..2a057ad26349 100644
--- a/security/arirang/files/patch-ariruby.c
+++ b/security/arirang/files/patch-ariruby.c
@@ -1,5 +1,31 @@
---- ariruby.c.orig Fri Apr 29 09:23:11 2011
-+++ ariruby.c Fri Apr 29 09:24:14 2011
+--- ariruby.c.orig 2011-04-27 21:34:36.000000000 -0400
++++ ariruby.c 2011-07-24 21:50:51.119557755 -0400
+@@ -189,7 +189,7 @@
+ static VALUE
+ ariprint(VALUE self, VALUE outbuf)
+ {
+- fprintf(stdout, "%s", RSTRING(outbuf)->ptr);
++ fprintf(stdout, "%s", RSTRING_PTR(outbuf));
+
+ return self;
+ }
+@@ -198,14 +198,14 @@
+ arisend(VALUE self, VALUE data)
+ {
+ int len;
+- len = RSTRING(data)->len;
++ len = RSTRING_LEN(data);
+
+ if ((sendbuf = (char *)malloc(len + 1)) == NULL) {
+ perror("arisend malloc failed");
+ close(sock);
+ exit(0);
+ }
+- memcpy(sendbuf, RSTRING(data)->ptr, len);
++ memcpy(sendbuf, RSTRING_PTR(data), len);
+
+ if (len == 0) {
+ fprintf(stderr, "please set a data in arisend function \n");
@@ -519,9 +519,6 @@
if (sendbuf != NULL)
free(sendbuf);
@@ -10,13 +36,13 @@
if (nb == -1 || nb == -2) {
#if !(defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__))
alarm(0);
-@@ -543,6 +540,9 @@
- if (!pflags)
+@@ -544,6 +541,9 @@
exit(0);
}
-+
+
+ if (headbuf != NULL)
+ free(headbuf);
-
++
if (sslflags)
ssl_free(ctx, ssl);
+