[MDEV-4175] Fix auth_socket to build on OpenBSD / Bitrig Created: 2013-02-15  Updated: 2013-03-08  Resolved: 2013-03-08

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.29
Fix Version/s: 5.5.30

Type: Bug Priority: Major
Reporter: Brad Smith Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

OpenBSD


Attachments: File patch-config_h_cmake     File patch-plugin_auth_socket_CMakeLists_txt     File patch-plugin_auth_socket_auth_socket_c    

 Description   

The attached patches for MariaDB 5.5 and newer allow the auth_socket plugin to build on OpenBSD and Bitrig.



 Comments   
Comment by Sergei Golubchik [ 2013-02-15 ]

Why did you add #include <my_global.h> into plugin/auth_socket/auth_socket.c ?

Comment by Brad Smith [ 2013-02-15 ]

That is where the define is set for ucred vs sockpeercred.

Comment by Brad Smith [ 2013-02-15 ]

Added one more patch I missed.

Comment by Brad Smith [ 2013-03-07 ]

Any chance of getting this reviewed and into the tree?

Comment by Sergei Golubchik [ 2013-03-07 ]

yes
it has "Fix Version: 5.5.30" - it doesn't matter when it's reviewed as long as it's before 5.5.30 release.
You can start worrying only if the priority is decreased or he fix-version changes.

Comment by Sergei Golubchik [ 2013-03-07 ]

I'd prefer to avoid changing files outside of the plugin directory.
Could you please check the following patch and see if it works for you?
*******************************************************************
=== modified file 'plugin/auth_socket/CMakeLists.txt'
— plugin/auth_socket/CMakeLists.txt 2011-07-12 12:34:47 +0000
+++ plugin/auth_socket/CMakeLists.txt 2013-03-07 14:49:43 +0000
@@ -21,7 +21,19 @@ int main()

{ struct ucred cred; 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)
+ENDIF()

-IF(HAVE_PEERCRED)
+IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED)
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c MODULE_ONLY)
ENDIF()
*******************************************************************

Generated at Thu Feb 08 06:54:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.