Commit 77d7de8d authored by Etienne Guesnet's avatar Etienne Guesnet Committed by Daniel Black

Support of AIX for auth_socket plugin

parent 2f5d3724
...@@ -83,6 +83,19 @@ IF (HAVE_GETPEERUCRED AND HAVE_GETPWUID_POSIX_FINAL) ...@@ -83,6 +83,19 @@ IF (HAVE_GETPEERUCRED AND HAVE_GETPWUID_POSIX_FINAL)
SET(ok 1) SET(ok 1)
ELSE() ELSE()
# AIX also!
CHECK_CXX_SOURCE_COMPILES(
"#include <sys/socket.h>
int main() {
struct peercred_struct cred;
getsockopt(0, SOL_SOCKET, SO_PEERID, &cred, 0);
}" HAVE_PEERCRED_STRUCT)
IF (HAVE_PEERCRED_STRUCT)
ADD_DEFINITIONS(-DHAVE_PEERCRED_STRUCT)
SET(ok 1)
ELSE()
# Who else? Anyone? # Who else? Anyone?
# C'mon, show your creativity, be different! ifdef's are fun, aren't they? # C'mon, show your creativity, be different! ifdef's are fun, aren't they?
...@@ -90,6 +103,7 @@ ENDIF() ...@@ -90,6 +103,7 @@ ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF()
IF(ok) IF(ok)
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c DEFAULT) MYSQL_ADD_PLUGIN(auth_socket auth_socket.c DEFAULT)
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
#elif defined HAVE_GETPEERUCRED #elif defined HAVE_GETPEERUCRED
#include <ucred.h> #include <ucred.h>
#elif defined HAVE_PEERCRED_STRUCT
#define level SOL_SOCKET
#define SO_PEERCRED SO_PEERID
#define uid euid
#define ucred peercred_struct
#else #else
#error impossible #error impossible
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment