apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r744002 - in /apr/apr-util/branches/1.4.x: ./ CHANGES dbd/apr_dbd_freetds.c
Date Fri, 13 Feb 2009 06:04:00 GMT
Author: bojan
Date: Fri Feb 13 06:04:00 2009
New Revision: 744002

URL: http://svn.apache.org/viewvc?rev=744002&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.4.x/   (props changed)
    apr/apr-util/branches/1.4.x/CHANGES
    apr/apr-util/branches/1.4.x/dbd/apr_dbd_freetds.c

Propchange: apr/apr-util/branches/1.4.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 13 06:04:00 2009
@@ -1 +1 @@
-/apr/apr-util/trunk:731033-731034,731225,731236,731291,731293,731379
+/apr/apr-util/trunk:731033-731034,731225,731236,731291,731293,731379,743986

Modified: apr/apr-util/branches/1.4.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/CHANGES?rev=744002&r1=744001&r2=744002&view=diff
==============================================================================
--- apr/apr-util/branches/1.4.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.4.x/CHANGES [utf-8] Fri Feb 13 06:04:00 2009
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.4.0
 
+  *) apr_dbd_freetds: Avoid segfault when process is NULL.
+     Do no print diagnostics to stderr. Never allow driver to exit
+     process. [Bojan Smojver]
+
   *) Do not include apr.h and apr_errno.h from system search path in
      apu_errno.h. PR 46487 [Rainer Jung <rainer.jung kippdata.de>]
 
@@ -10,7 +14,7 @@
   *) Add optional dbm, openssl and nss subpackages to the RPM spec file.
      [Graham Leggett]
 
-  *) apr_crypto_nss: Oh that it was this easy. Use pgk-config to find
+  *) apr_crypto_nss: Oh that it was this easy. Use pkg-config to find
      NSS where possible. [Graham Leggett]
 
   *) apr_crypto_nss: The nss.h header file could be in nss or nss3, the

Modified: apr/apr-util/branches/1.4.x/dbd/apr_dbd_freetds.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/dbd/apr_dbd_freetds.c?rev=744002&r1=744001&r2=744002&view=diff
==============================================================================
--- apr/apr-util/branches/1.4.x/dbd/apr_dbd_freetds.c (original)
+++ apr/apr-util/branches/1.4.x/dbd/apr_dbd_freetds.c Fri Feb 13 06:04:00 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);
 }
 



Mime
View raw message