mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Support of AIX for auth_socket plugin
This commit is contained in:
parent
2f5d372444
commit
77d7de8d47
2 changed files with 20 additions and 0 deletions
|
@ -83,6 +83,19 @@ IF (HAVE_GETPEERUCRED AND HAVE_GETPWUID_POSIX_FINAL)
|
|||
SET(ok 1)
|
||||
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?
|
||||
# C'mon, show your creativity, be different! ifdef's are fun, aren't they?
|
||||
|
||||
|
@ -90,6 +103,7 @@ ENDIF()
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(ok)
|
||||
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c DEFAULT)
|
||||
|
|
|
@ -50,6 +50,12 @@
|
|||
#elif defined HAVE_GETPEERUCRED
|
||||
#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
|
||||
#error impossible
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue