[Pdns-dev] [PATCH] Load default mysql options

Sven Wegener swegener at gentoo.org
Wed Aug 6 21:47:07 CEST 2008


(This patch is ancient, I posted in about three years ago, but nothing 
happened)

Hi all!

Please find attached a small patch that makes the pdns server load the 
default mysql client options from the my.cnf file. This allows us to set 
additional options like SSL encryption. Maybe we should not load the 
"client" section, but a pdns specific section. But I think you get the 
nature of the idea. (The patch is the one based on 2.9.18 from three years 
ago I already posted, but should apply cleanly to current versions.)

Sven

-- 
Sven Wegener
Gentoo Developer
http://www.gentoo.org/
-------------- next part --------------
diff -Nur pdns-2.9.18.orig/modules/gmysqlbackend/smysql.cc pdns-2.9.18/modules/gmysqlbackend/smysql.cc
--- pdns-2.9.18.orig/modules/gmysqlbackend/smysql.cc	2005-04-23 23:40:15.000000000 +0200
+++ pdns-2.9.18/modules/gmysqlbackend/smysql.cc	2005-07-17 10:38:35.363597586 +0200
@@ -15,6 +15,9 @@
 	       const string &password)
 {
   mysql_init(&d_db);
+#if MYSQL_VERSION_ID > 32349
+  mysql_options(&d_db, MYSQL_READ_DEFAULT_GROUP, "client");
+#endif
   if (!mysql_real_connect(&d_db, host.empty() ? 0 : host.c_str(), 
 			  user.empty() ? 0 : user.c_str(), 
 			  password.empty() ? 0 : password.c_str(),


More information about the Pdns-dev mailing list