This updates the ruby DataObjects ports to the latest version.  It also
includes patches to ruby-do_postgres backported from upstream to fix a
couple of use-after-free errors caught by the malloc junking.

Tested on i386, compiles on amd64.  Will be committing later this week
unless I hear objections.

Thanks,
Jeremy

Index: databases/ruby-data_objects/Makefile
===================================================================
RCS file: /cvs/ports/databases/ruby-data_objects/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- databases/ruby-data_objects/Makefile        26 Oct 2013 23:55:34 -0000      
1.16
+++ databases/ruby-data_objects/Makefile        16 Jun 2014 19:13:32 -0000
@@ -2,8 +2,7 @@
 
 COMMENT =      unified Ruby API for popular databases
 
-DISTNAME =     data_objects-0.10.12
-REVISION =     0
+DISTNAME =     data_objects-0.10.14
 CATEGORIES =   databases
 
 # MIT
Index: databases/ruby-data_objects/distinfo
===================================================================
RCS file: /cvs/ports/databases/ruby-data_objects/distinfo,v
retrieving revision 1.6
diff -u -p -r1.6 distinfo
--- databases/ruby-data_objects/distinfo        8 May 2013 17:10:23 -0000       
1.6
+++ databases/ruby-data_objects/distinfo        16 Jun 2014 19:13:32 -0000
@@ -1,2 +1,2 @@
-SHA256 (data_objects-0.10.12.gem) = 
V1ZnRaP6pjPf3ZivDeOrmyXdR50n8Fme2kWR6Ofp198=
-SIZE (data_objects-0.10.12.gem) = 29184
+SHA256 (data_objects-0.10.14.gem) = 
AepR60FwMCxYmpnltTmpq6gK6iXSBa6lY/V362xa0LY=
+SIZE (data_objects-0.10.14.gem) = 29696
Index: databases/ruby-do_mysql/Makefile
===================================================================
RCS file: /cvs/ports/databases/ruby-do_mysql/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- databases/ruby-do_mysql/Makefile    15 Jan 2014 02:13:57 -0000      1.16
+++ databases/ruby-do_mysql/Makefile    16 Jun 2014 19:13:32 -0000
@@ -2,9 +2,8 @@
 
 COMMENT=               ruby-data_objects driver for MySQL
 
-V=                     0.10.12
+V=                     0.10.14
 DISTNAME=              do_mysql-${V}
-REVISION=              4
 CATEGORIES=            databases
 
 # MIT
Index: databases/ruby-do_mysql/distinfo
===================================================================
RCS file: /cvs/ports/databases/ruby-do_mysql/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- databases/ruby-do_mysql/distinfo    8 May 2013 17:11:23 -0000       1.4
+++ databases/ruby-do_mysql/distinfo    16 Jun 2014 19:13:32 -0000
@@ -1,2 +1,2 @@
-SHA256 (do_mysql-0.10.12.gem) = ZyGCmqsgEVYj8pU/JD4Owi6BaRWud51A7F6ohvMzXHc=
-SIZE (do_mysql-0.10.12.gem) = 28160
+SHA256 (do_mysql-0.10.14.gem) = yit0MyLG1VG3JS2s7vtzvBZL4bWniWhnFYxL6LaLatc=
+SIZE (do_mysql-0.10.14.gem) = 29184
Index: databases/ruby-do_postgres/Makefile
===================================================================
RCS file: /cvs/ports/databases/ruby-do_postgres/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- databases/ruby-do_postgres/Makefile 15 Jan 2014 02:13:57 -0000      1.15
+++ databases/ruby-do_postgres/Makefile 16 Jun 2014 19:13:32 -0000
@@ -2,9 +2,8 @@
 
 COMMENT=               DataObjects driver for PostgreSQL
 
-V=                     0.10.12
+V=                     0.10.14
 DISTNAME=              do_postgres-${V}
-REVISION =             2
 CATEGORIES=            databases
 
 # MIT
Index: databases/ruby-do_postgres/distinfo
===================================================================
RCS file: /cvs/ports/databases/ruby-do_postgres/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- databases/ruby-do_postgres/distinfo 8 May 2013 17:11:55 -0000       1.4
+++ databases/ruby-do_postgres/distinfo 16 Jun 2014 19:13:32 -0000
@@ -1,2 +1,2 @@
-SHA256 (do_postgres-0.10.12.gem) = l1+tTLwyBWEuxT1sgidnZPTn4mfjbtDxVFJKoPLxsgw=
-SIZE (do_postgres-0.10.12.gem) = 30720
+SHA256 (do_postgres-0.10.14.gem) = oi4jWHhimr5ctuk7m2KRRkZiJeVn1iSNELJxAVelO9Y=
+SIZE (do_postgres-0.10.14.gem) = 31744
Index: databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_c
===================================================================
RCS file: databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_c
diff -N databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_c        
16 Jun 2014 19:13:32 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+Fix use-after-free, upstream commit 23cea14f4576acea9d53df3358280ba8db7b9e5b.
+
+--- ext/do_postgres/do_common.c.orig   Thu Feb 13 02:59:50 2014
++++ ext/do_postgres/do_common.c        Mon Jun 16 11:08:01 2014
+@@ -63,7 +63,7 @@ void data_objects_debug(VALUE connection, VALUE string
+   rb_funcall(connection, DO_ID_LOG, 1, message);
+ }
+ 
+-void data_objects_raise_error(VALUE self, const struct errcodes *errors, int 
errnum, const char *message, VALUE query, VALUE state) {
++void data_objects_raise_error(VALUE self, const struct errcodes *errors, int 
errnum, VALUE message, VALUE query, VALUE state) {
+   const char *exception_type = "SQLError";
+   const struct errcodes *e;
+   VALUE uri, exception;
+@@ -82,7 +82,7 @@ void data_objects_raise_error(VALUE self, const struct
+     data_objects_const_get(mDO, exception_type),
+     DO_ID_NEW,
+     5,
+-    rb_str_new2(message),
++    message,
+     INT2NUM(errnum),
+     state,
+     query,
Index: databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_h
===================================================================
RCS file: databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_h
diff -N databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_common_h        
16 Jun 2014 19:13:32 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Fix use-after-free, upstream commit 23cea14f4576acea9d53df3358280ba8db7b9e5b.
+
+--- ext/do_postgres/do_common.h.orig   Thu Feb 13 02:59:50 2014
++++ ext/do_postgres/do_common.h        Mon Jun 16 11:08:01 2014
+@@ -123,7 +123,7 @@ static inline void data_objects_define_errors(VALUE sc
+   }
+ }
+ 
+-extern void data_objects_raise_error(VALUE self, const struct errcodes 
*errors, int errnum, const char *message, VALUE query, VALUE state);
++extern void data_objects_raise_error(VALUE self, const struct errcodes 
*errors, int errnum, VALUE message, VALUE query, VALUE state);
+ 
+ extern VALUE data_objects_typecast(const char *value, long length, const 
VALUE type, int encoding);
+ 
Index: databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_postgres_c
===================================================================
RCS file: databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_postgres_c
diff -N databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_postgres_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ databases/ruby-do_postgres/patches/patch-ext_do_postgres_do_postgres_c      
16 Jun 2014 19:13:32 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+Fix use-after-free, upstream commits 5cec3c5b723d14b210eada26519258255a175c05
+and 23cea14f4576acea9d53df3358280ba8db7b9e5b.
+
+--- ext/do_postgres/do_postgres.c.orig Thu Feb 13 02:59:50 2014
++++ ext/do_postgres/do_postgres.c      Mon Jun 16 11:11:55 2014
+@@ -99,13 +99,14 @@ VALUE do_postgres_typecast(const char *value, long len
+ }
+ 
+ void do_postgres_raise_error(VALUE self, PGresult *result, VALUE query) {
+-  const char *message = PQresultErrorMessage(result);
++  VALUE message = rb_str_new2(PQresultErrorMessage(result));
+   char *sql_state = PQresultErrorField(result, PG_DIAG_SQLSTATE);
+   int postgres_errno = MAKE_SQLSTATE(sql_state[0], sql_state[1], 
sql_state[2], sql_state[3], sql_state[4]);
++  VALUE str = rb_str_new2(sql_state);
+ 
+   PQclear(result);
+ 
+-  data_objects_raise_error(self, do_postgres_errors, postgres_errno, message, 
query, rb_str_new2(sql_state));
++  data_objects_raise_error(self, do_postgres_errors, postgres_errno, message, 
query, str);
+ }
+ 
+ /* ====== Public API ======= */
Index: databases/ruby-do_sqlite3/Makefile
===================================================================
RCS file: /cvs/ports/databases/ruby-do_sqlite3/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- databases/ruby-do_sqlite3/Makefile  15 Jan 2014 02:13:57 -0000      1.22
+++ databases/ruby-do_sqlite3/Makefile  16 Jun 2014 19:13:32 -0000
@@ -2,9 +2,8 @@
 
 COMMENT =      DataObjects driver for SQLite3
 
-VERSION =      0.10.12
+VERSION =      0.10.14
 DISTNAME =     do_sqlite3-${VERSION}
-REVISION =     2
 CATEGORIES =   databases
 
 # MIT
Index: databases/ruby-do_sqlite3/distinfo
===================================================================
RCS file: /cvs/ports/databases/ruby-do_sqlite3/distinfo,v
retrieving revision 1.6
diff -u -p -r1.6 distinfo
--- databases/ruby-do_sqlite3/distinfo  8 May 2013 17:12:27 -0000       1.6
+++ databases/ruby-do_sqlite3/distinfo  16 Jun 2014 19:13:32 -0000
@@ -1,2 +1,2 @@
-SHA256 (do_sqlite3-0.10.12.gem) = +2yaBreSCS/nHo7ZQ4dkbGACRwZygac7GWNK3fE/saI=
-SIZE (do_sqlite3-0.10.12.gem) = 22016
+SHA256 (do_sqlite3-0.10.14.gem) = dDRG/LM41ErxyMxiGL4Ew9XXcHqdMLUlhgYn8d87zts=
+SIZE (do_sqlite3-0.10.14.gem) = 23040

Reply via email to