- Fix with Ruby 1.9

PR:		ports/159171
Submitted by:	swills
Approved by:	maintainer (bapt)
This commit is contained in:
Steve Wills 2011-07-25 22:44:29 +00:00
parent 0982b5834c
commit 4ad820565c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=278332
3 changed files with 59 additions and 8 deletions

View file

@ -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>

View file

@ -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

View file

@ -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);