summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/mysql
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/mysql')
-rw-r--r--src/libstrongswan/plugins/mysql/Makefile.am2
-rw-r--r--src/libstrongswan/plugins/mysql/Makefile.in8
-rw-r--r--src/libstrongswan/plugins/mysql/mysql_database.c12
-rw-r--r--src/libstrongswan/plugins/mysql/mysql_database.h1
4 files changed, 15 insertions, 8 deletions
diff --git a/src/libstrongswan/plugins/mysql/Makefile.am b/src/libstrongswan/plugins/mysql/Makefile.am
index 588b7991b..11711b31b 100644
--- a/src/libstrongswan/plugins/mysql/Makefile.am
+++ b/src/libstrongswan/plugins/mysql/Makefile.am
@@ -3,7 +3,7 @@ AM_CPPFLAGS = \
AM_CFLAGS = \
$(MYSQLCFLAG) \
- -rdynamic
+ $(PLUGIN_CFLAGS)
if MONOLITHIC
noinst_LTLIBRARIES = libstrongswan-mysql.la
diff --git a/src/libstrongswan/plugins/mysql/Makefile.in b/src/libstrongswan/plugins/mysql/Makefile.in
index fb36d16a2..ebd0d90d8 100644
--- a/src/libstrongswan/plugins/mysql/Makefile.in
+++ b/src/libstrongswan/plugins/mysql/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -265,6 +265,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OPENSSL_LIB = @OPENSSL_LIB@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
@@ -283,6 +284,7 @@ PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PLUGIN_CFLAGS = @PLUGIN_CFLAGS@
PTHREADLIB = @PTHREADLIB@
PYTHON = @PYTHON@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
@@ -310,6 +312,7 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+aikgen_plugins = @aikgen_plugins@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -401,6 +404,7 @@ srcdir = @srcdir@
starter_plugins = @starter_plugins@
strongswan_conf = @strongswan_conf@
strongswan_options = @strongswan_options@
+swanctldir = @swanctldir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
t_plugins = @t_plugins@
@@ -416,7 +420,7 @@ AM_CPPFLAGS = \
AM_CFLAGS = \
$(MYSQLCFLAG) \
- -rdynamic
+ $(PLUGIN_CFLAGS)
@MONOLITHIC_TRUE@noinst_LTLIBRARIES = libstrongswan-mysql.la
@MONOLITHIC_FALSE@plugin_LTLIBRARIES = libstrongswan-mysql.la
diff --git a/src/libstrongswan/plugins/mysql/mysql_database.c b/src/libstrongswan/plugins/mysql/mysql_database.c
index 373e9dc7c..871cc59a0 100644
--- a/src/libstrongswan/plugins/mysql/mysql_database.c
+++ b/src/libstrongswan/plugins/mysql/mysql_database.c
@@ -14,12 +14,12 @@
* for more details.
*/
+#include "mysql_database.h"
+
#define _GNU_SOURCE
#include <string.h>
#include <mysql.h>
-#include "mysql_database.h"
-
#include <utils/debug.h>
#include <utils/chunk.h>
#include <threading/thread_value.h>
@@ -730,7 +730,7 @@ static bool finalize_transaction(private_mysql_database_t *this,
return TRUE;
}
-METHOD(database_t, commit, bool,
+METHOD(database_t, commit_, bool,
private_mysql_database_t *this)
{
return finalize_transaction(this, FALSE);
@@ -768,7 +768,7 @@ static bool parse_uri(private_mysql_database_t *this, char *uri)
/**
* parse mysql://username:pass@host:port/database uri
*/
- username = strdupa(uri + 8);
+ username = strdup(uri + 8);
pos = strchr(username, ':');
if (pos)
{
@@ -800,10 +800,12 @@ static bool parse_uri(private_mysql_database_t *this, char *uri)
this->password = strdup(password);
this->database = strdup(database);
this->port = atoi(port);
+ free(username);
return TRUE;
}
}
}
+ free(username);
DBG1(DBG_LIB, "parsing MySQL database uri '%s' failed", uri);
return FALSE;
}
@@ -828,7 +830,7 @@ mysql_database_t *mysql_database_create(char *uri)
.query = _query,
.execute = _execute,
.transaction = _transaction,
- .commit = _commit,
+ .commit = _commit_,
.rollback = _rollback,
.get_driver = _get_driver,
.destroy = _destroy,
diff --git a/src/libstrongswan/plugins/mysql/mysql_database.h b/src/libstrongswan/plugins/mysql/mysql_database.h
index 98ddcad36..bbf6a33e9 100644
--- a/src/libstrongswan/plugins/mysql/mysql_database.h
+++ b/src/libstrongswan/plugins/mysql/mysql_database.h
@@ -21,6 +21,7 @@
#ifndef MYSQL_DATABASE_H_
#define MYSQL_DATABASE_H_
+#include <library.h>
#include <database/database.h>
typedef struct mysql_database_t mysql_database_t;