diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-02-29 21:55:33 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-02-29 21:55:33 +0100 |
commit | a2478a6c7269128ebf30ad539b919a9a70ee9f58 (patch) | |
tree | a805cd2005264434ef5388d85a1f2048c98ba024 /plugin | |
parent | e4bfb6f161b77a8c5801ba71b4ffd980066a1399 (diff) | |
download | mariadb-git-a2478a6c7269128ebf30ad539b919a9a70ee9f58.tar.gz |
fixing pam plugin to compile again
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/auth_pam/CMakeLists.txt | 3 | ||||
-rw-r--r-- | plugin/auth_pam/auth_pam.c | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index f75c2f01f06..51317527c77 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -5,6 +5,9 @@ CHECK_INCLUDE_FILES (security/pam_appl.h HAVE_PAM_APPL_H) CHECK_FUNCTION_EXISTS (strndup HAVE_STRNDUP) IF(HAVE_PAM_APPL_H) + IF(HAVE_STRNDUP) + ADD_DEFINITIONS(-DHAVE_STRNDUP) + ENDIF(HAVE_STRNDUP) MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY) ENDIF(HAVE_PAM_APPL_H) diff --git a/plugin/auth_pam/auth_pam.c b/plugin/auth_pam/auth_pam.c index 6507c482ef9..d8211294910 100644 --- a/plugin/auth_pam/auth_pam.c +++ b/plugin/auth_pam/auth_pam.c @@ -14,13 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE /* For strndup() */ -#endif +#define _GNU_SOURCE 1 /* for strndup */ #include <mysql/plugin_auth.h> #include <string.h> -#include <my_config.h> #include <security/pam_appl.h> #include <security/pam_modules.h> @@ -123,8 +120,7 @@ static int pam_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) const char *new_username; struct param param; /* The following is written in such a way to make also solaris happy */ - struct pam_conv pam_start_arg = { &conv, NULL }; - pam_start_arg.appdata_ptr= (char*) ¶m; + struct pam_conv pam_start_arg = { &conv, (char*) ¶m }; /* get the service name, as specified in |