[Pkg-mysql-commits] [mariadb-5.5] 02/02: Add patch to fix kfreebsd build failure

Otto Kekäläinen ottok-guest at moszumanska.debian.org
Thu Aug 28 08:34:20 UTC 2014


This is an automated email from the git hooks/post-receive script.

ottok-guest pushed a commit to branch master
in repository mariadb-5.5.

commit 1d043c8df79378c6f10f6c339043b0ffd7b3a230
Author: Otto Kekäläinen <otto.kekalainen at seravo.fi>
Date:   Thu Aug 28 09:32:04 2014 +0300

    Add patch to fix kfreebsd build failure
---
 debian/patches/21_kfreebsd-peercred.diff | 112 +++++++++++++++++++++++++++++++
 debian/patches/90_spelling.diff          |   2 +-
 debian/patches/series                    |   1 +
 3 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/debian/patches/21_kfreebsd-peercred.diff b/debian/patches/21_kfreebsd-peercred.diff
new file mode 100644
index 0000000..1cc04ec
--- /dev/null
+++ b/debian/patches/21_kfreebsd-peercred.diff
@@ -0,0 +1,112 @@
+Author: Sergei Golubchik <serg at mariadb.org>
+Descriptiong: Experimental patch from https://mariadb.atlassian.net/browse/MDEV-6577
+
+=== modified file 'plugin/auth_socket/CMakeLists.txt'
+--- a/plugin/auth_socket/CMakeLists.txt	2013-03-08 18:09:15 +0000
++++ b/plugin/auth_socket/CMakeLists.txt	2014-08-13 14:44:30 +0000
+@@ -22,18 +22,48 @@ int main() {
+   getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0);
+ }" HAVE_PEERCRED)
+  
+-IF (NOT HAVE_PEERCRED)
+-  # Hi, OpenBSD!
+-  CHECK_CXX_SOURCE_COMPILES(
+-  "#include <sys/types.h>
+-  #include <sys/socket.h>
+-  int main() {
+-    struct sockpeercred cred;
+-    getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0);
+-    }" HAVE_SOCKPEERCRED)
+-  ADD_DEFINITIONS(-Ducred=sockpeercred)
++IF (HAVE_PEERCRED)
++  ADD_DEFINITIONS(-DHAVE_PEERCRED)
++  SET(ok 1)
++ELSE()
++
++# Hi, OpenBSD!
++CHECK_CXX_SOURCE_COMPILES(
++"#include <sys/types.h>
++#include <sys/socket.h>
++int main() {
++  struct sockpeercred cred;
++  getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0);
++  }" HAVE_SOCKPEERCRED)
++
++IF (HAVE_SOCKPEERCRED)
++  ADD_DEFINITIONS(-DHAVE_SOCKPEERCRED)
++  SET(ok 1)
++ELSE()
++
++# FreeBSD, is that you?
++CHECK_CXX_SOURCE_COMPILES(
++"#include <sys/types.h>
++#include <sys/socket.h>
++#include <sys/un.h>
++#include <sys/ucred.h>
++int main() {
++  struct xucred cred;
++  getsockopt(0, 0, LOCAL_PEERCRED, &cred, 0);
++  }" HAVE_XUCRED)
++
++IF (HAVE_XUCRED)
++  ADD_DEFINITIONS(-DHAVE_XUCRED)
++  SET(ok 1)
++ELSE()
++
++# What else? C'mon, show your creativity, be different!
++
++ENDIF()
++ENDIF()
+ ENDIF()
+ 
+-IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED)
++IF(ok)
+   MYSQL_ADD_PLUGIN(auth_socket auth_socket.c MODULE_ONLY)
+ ENDIF()
++
+
+=== modified file 'plugin/auth_socket/auth_socket.c'
+--- a/plugin/auth_socket/auth_socket.c	2012-02-15 17:08:08 +0000
++++ b/plugin/auth_socket/auth_socket.c	2014-08-13 14:46:42 +0000
+@@ -27,9 +27,29 @@
+ #define _GNU_SOURCE 1 /* for struct ucred */
+ 
+ #include <mysql/plugin_auth.h>
+-#include <sys/socket.h>
+-#include <pwd.h>
+ #include <string.h>
++#include <pwd.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++
++#ifdef HAVE_PEERCRED
++#define level SOL_SOCKET
++
++#elif defined HAVE_SOCKPEERCRED
++#define level SOL_SOCKET
++#define ucred socketpeercred
++
++#elif defined HAVE_XUCRED
++#include <sys/un.h>
++#include <sys/ucred.h>
++#define level 0
++#define SO_PEERCRED LOCAL_PEERCRED
++#define uid cr_uid
++#define ucred xucred
++
++#else
++#error impossible
++#endif
+ 
+ /**
+   perform the unix socket based authentication
+@@ -63,7 +83,7 @@ static int socket_auth(MYSQL_PLUGIN_VIO
+     return CR_ERROR;
+ 
+   /* get the UID of the client process */
+-  if (getsockopt(vio_info.socket, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len))
++  if (getsockopt(vio_info.socket, level, SO_PEERCRED, &cred, &cred_len))
+     return CR_ERROR;
+ 
+   if (cred_len != sizeof(cred))
+
diff --git a/debian/patches/90_spelling.diff b/debian/patches/90_spelling.diff
index 2f7a46f..7d6b753 100644
--- a/debian/patches/90_spelling.diff
+++ b/debian/patches/90_spelling.diff
@@ -91,7 +91,7 @@ Description: Fix spelling of preceding, specified, received, additionally
  #       sessions at test end ($current sessions, assuming the test disconnects
 --- a/mysql-test/mysql-test-run.pl
 +++ b/mysql-test/mysql-test-run.pl
-@@ -6484,7 +6484,7 @@ Misc options
+@@ -6489,7 +6489,7 @@ Misc options
    start-dirty           Only start the servers (without initialization) for
                          the first specified test case
    user-args             In combination with start* and no test name, drops
diff --git a/debian/patches/series b/debian/patches/series
index 9d73132..0a8da2e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
 20_kfreebsd_tests.diff
+21_kfreebsd-peercred.diff
 33_scripts__mysql_create_system_tables__no_test.diff
 38_scripts__mysqld_safe.sh__signals.diff
 41_scripts__mysql_install_db.sh__no_test.diff

-- 
Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-mysql/mariadb-5.5.git



More information about the Pkg-mysql-commits mailing list