You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bo...@apache.org on 2009/02/13 07:04:28 UTC

svn commit: r744003 - in /apr/apr-util/branches/1.3.x: ./ CHANGES dbd/apr_dbd_freetds.c dbd/apr_dbd_pgsql.c

Author: bojan
Date: Fri Feb 13 06:04:28 2009
New Revision: 744003

URL: http://svn.apache.org/viewvc?rev=744003&view=rev
Log:
Backport r743986 from the trunk.
Do not crash if process is NULL.
Do not print diagnostics to stderr (APU DBD operates silently).
Do not allow driver to exit the process (always return INT_CANCEL on error).

Modified:
    apr/apr-util/branches/1.3.x/   (props changed)
    apr/apr-util/branches/1.3.x/CHANGES
    apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c
    apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c   (props changed)

Propchange: apr/apr-util/branches/1.3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 13 06:04:28 2009
@@ -1,2 +1,2 @@
 /apr/apr-util/branches/1.3.x:692751
-/apr/apr-util/trunk:692751,731225
+/apr/apr-util/trunk:692751,731225,743986

Modified: apr/apr-util/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/CHANGES?rev=744003&r1=744002&r2=744003&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.3.x/CHANGES [utf-8] Fri Feb 13 06:04:28 2009
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.3.5
 
+  *) apr_dbd_freetds: Avoid segfault when process is NULL.
+     Do no print diagnostics to stderr. Never allow driver to exit
+     process. [Bojan Smojver]
+
   *) apr_dbd_freetds: The sybdb.h header file might be freetds/sybdb.h
      or sybdb.h. [Graham Leggett]
 

Modified: apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c?rev=744003&r1=744002&r2=744003&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c (original)
+++ apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c Fri Feb 13 06:04:28 2009
@@ -606,9 +606,7 @@
 
     process = dbopen(login, server);
 
-    fprintf(stderr, "databaseName [%s]\n", databaseName);
-
-    if (databaseName != NULL)
+    if (process != NULL && databaseName != NULL)
     {
         dbuse(process, databaseName);
     }
@@ -691,6 +689,11 @@
     regfree(&dbd_freetds_find_arg);
     return APR_SUCCESS;
 }
+static int freetds_err_handler(DBPROCESS *dbproc, int severity, int dberr,
+                               int oserr, char *dberrstr, char *oserrstr)
+{
+    return INT_CANCEL; /* never exit */
+}
 static void dbd_freetds_init(apr_pool_t *pool)
 {
     int rv = regcomp(&dbd_freetds_find_arg,
@@ -701,6 +704,7 @@
         fprintf(stderr, "regcomp failed: %s\n", errmsg);
     }
     dbinit();
+    dberrhandle(freetds_err_handler);
     apr_pool_cleanup_register(pool, NULL, freetds_term, apr_pool_cleanup_null);
 }
 

Propchange: apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 13 06:04:28 2009
@@ -1,2 +1,2 @@
 /apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c:692751
-/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c:692751,704986,731225
+/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c:692751,704986,731225,743986