Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
MariaDB and MySQL Packaging Team
mariadb-5.5
Commits
1d043c8d
Commit
1d043c8d
authored
Aug 28, 2014
by
Otto Kekäläinen
Browse files
Add patch to fix kfreebsd build failure
parent
169a62b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
debian/patches/21_kfreebsd-peercred.diff
0 → 100644
View file @
1d043c8d
Author: Sergei Golubchik <serg@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))
debian/patches/90_spelling.diff
View file @
1d043c8d
...
@@ -91,7 +91,7 @@ Description: Fix spelling of preceding, specified, received, additionally
...
@@ -91,7 +91,7 @@ Description: Fix spelling of preceding, specified, received, additionally
# sessions at test end ($current sessions, assuming the test disconnects
# sessions at test end ($current sessions, assuming the test disconnects
--- a/mysql-test/mysql-test-run.pl
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -648
4
,7 +648
4
,7 @@
Misc options
@@ -648
9
,7 +648
9
,7 @@
Misc options
start-dirty Only start the servers (without initialization) for
start-dirty Only start the servers (without initialization) for
the first specified test case
the first specified test case
user-args In combination with start* and no test name, drops
user-args In combination with start* and no test name, drops
...
...
debian/patches/series
View file @
1d043c8d
20_kfreebsd_tests.diff
20_kfreebsd_tests.diff
21_kfreebsd-peercred.diff
33_scripts__mysql_create_system_tables__no_test.diff
33_scripts__mysql_create_system_tables__no_test.diff
38_scripts__mysqld_safe.sh__signals.diff
38_scripts__mysqld_safe.sh__signals.diff
41_scripts__mysql_install_db.sh__no_test.diff
41_scripts__mysql_install_db.sh__no_test.diff
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment