* Author: Nicolas Baradakis <nicolas.baradakis@cegetel.net>
*
* Copyright (C) 2005 Cegetel
+ * Copyright 2006 The FreeRADIUS server project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "autoconf.h"
+#include <freeradius-devel/ident.h>
+RCSID("$Id$")
+
+#include <freeradius-devel/radiusd.h>
+#include <freeradius-devel/modules.h>
#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/stat.h>
-#include "libradius.h"
-#include "radiusd.h"
-#include "modules.h"
-#include "conffile.h"
-
-static const char rcsid[] = "$Id$";
-
static int sql_log_instantiate(CONF_SECTION *conf, void **instance);
static int sql_log_detach(void *instance);
static int sql_log_accounting(void *instance, REQUEST *request);
pairdelete(&request->packet->vps, PW_SQL_USER_NAME);
if (username != NULL) {
- strNcpy(tmpuser, username, MAX_STRING_LEN);
+ strlcpy(tmpuser, username, MAX_STRING_LEN);
} else if (inst->sql_user_name[0] != '\0') {
radius_xlat(tmpuser, sizeof(tmpuser), inst->sql_user_name,
request, NULL);
}
if (tmpuser[0] != '\0') {
- strNcpy(sqlusername, tmpuser, sizeof(tmpuser));
+ strlcpy(sqlusername, tmpuser, sizeof(tmpuser));
DEBUG2("rlm_sql_log (%s): sql_set_user escaped user --> '%s'",
inst->name, sqlusername);
vp = pairmake("SQL-User-Name", sqlusername, 0);
* is single-threaded.
*/
module_t rlm_sql_log = {
+ RLM_MODULE_INIT,
"sql_log",
RLM_TYPE_THREAD_SAFE, /* type */
- NULL, /* initialization */
sql_log_instantiate, /* instantiation */
+ sql_log_detach, /* detach */
{
NULL, /* authentication */
NULL, /* authorization */
NULL, /* post-proxy */
sql_log_postauth /* post-auth */
},
- sql_log_detach, /* detach */
- NULL, /* destroy */
};