aboutsummaryrefslogtreecommitdiff
path: root/pam_sql/pam_mysql.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-08-14 08:50:50 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-08-14 08:50:50 +0000
commit1c004f2fe64e78613bb318f469e1f4abbb71e467 (patch)
treecc6be4b97325d18ac4363921a60ad86f8763966f /pam_sql/pam_mysql.c
parent35c5bc9e42987b1c432c233c910b552fff4dedca (diff)
downloadpam-modules-1c004f2fe64e78613bb318f469e1f4abbb71e467.tar.gz
pam-modules-1c004f2fe64e78613bb318f469e1f4abbb71e467.tar.bz2
* pam_fshadow/pam_fshadow.c: Include config.h and time.h
* pam_sql/pam_mysql.c, pam_sql/pam_pgsql.c, pam_sql/pam_sql.c: Use _pam_log for diagnostics. * pam_regex/pam_regex.c (pam_sm_authenticate): Remove unused variable. * configure.ac: New option --enable-debug * common.c (wait_debug): Bugfix * pam_log/pam_log.c: Include ctype.h (parse_priority): Change return type. * pam_fshadow/Makefile.am, pam_log/Makefile.am, pam_regex/Makefile.am, pam_sql/Makefile.am: Use CPPFLAGS in cc rules. git-svn-id: file:///svnroot/pam-modules/trunk@58 56984be4-0537-0410-a56c-fcb268c96130
Diffstat (limited to 'pam_sql/pam_mysql.c')
-rw-r--r--pam_sql/pam_mysql.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pam_sql/pam_mysql.c b/pam_sql/pam_mysql.c
index 57a1916..6a16b39 100644
--- a/pam_sql/pam_mysql.c
+++ b/pam_sql/pam_mysql.c
@@ -1,5 +1,5 @@
/* This file is part of pam-modules.
- Copyright (C) 2005, 2006 Sergey Poznyakoff
+ Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -266,13 +266,13 @@ check_query_result(MYSQL *mysql, const char *pass)
result = mysql_store_result(mysql);
if (!result) {
- _pam_err(LOG_ERR, "MySQL: query returned 0 tuples");
+ _pam_log(LOG_ERR, "MySQL: query returned 0 tuples");
rc = PAM_AUTH_ERR;
} else {
MYSQL_ROW row;
long n = mysql_num_rows(result);
if (n != 1) {
- _pam_err(LOG_WARNING,
+ _pam_log(LOG_WARNING,
"MySQL: query returned %d tuples", n);
if (n == 0) {
mysql_free_result(result);
@@ -281,7 +281,7 @@ check_query_result(MYSQL *mysql, const char *pass)
}
n = mysql_num_fields(result);
if (n != 1) {
- _pam_err(LOG_WARNING,
+ _pam_log(LOG_WARNING,
"MySQL: query returned %d fields", n);
}
@@ -331,7 +331,7 @@ verify_user_pass(const char *username, const char *password)
CHKVAR(port);
portno = strtoul (port, &p, 0);
if (*p) {
- _pam_err(LOG_ERR, "Invalid port number: %s", port);
+ _pam_log(LOG_ERR, "Invalid port number: %s", port);
return PAM_SERVICE_ERR;
}
@@ -349,7 +349,7 @@ verify_user_pass(const char *username, const char *password)
exquery = sql_expand_query (&mysql, query, username, password);
if (!exquery) {
- _pam_err(LOG_ERR, "cannot expand query");
+ _pam_log(LOG_ERR, "cannot expand query");
return PAM_SERVICE_ERR;
}
@@ -358,14 +358,14 @@ verify_user_pass(const char *username, const char *password)
if (!mysql_real_connect(&mysql, hostname,
login, pass, db,
portno, socket_path, 0)) {
- _pam_err(LOG_ERR, "cannot connect to MySQL");
+ _pam_log(LOG_ERR, "cannot connect to MySQL");
mysql_close(&mysql);
free(exquery);
return PAM_SERVICE_ERR;
}
if (mysql_query(&mysql, exquery)) {
- _pam_err(LOG_ERR, "MySQL: %s", mysql_error(&mysql));
+ _pam_log(LOG_ERR, "MySQL: %s", mysql_error(&mysql));
mysql_close(&mysql);
free(exquery);
return PAM_SERVICE_ERR;

Return to:

Send suggestions and report system problems to the System administrator.