Created
November 19, 2012 00:01
-
-
Save kaikuchn/4108256 to your computer and use it in GitHub Desktop.
some more debug info via patchfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 24739f29e62afd1463db5251909eb31f7f5f1a68 Mon Sep 17 00:00:00 2001 | |
From: Kai Kuchenbecker <kuchenbecker.k@gmail.com> | |
Date: Mon, 19 Nov 2012 00:59:37 +0100 | |
Subject: [PATCH] added some more logging info | |
--- | |
src/log_pgsql.c | 14 ++++++++++---- | |
1 file changed, 10 insertions(+), 4 deletions(-) | |
diff --git a/src/log_pgsql.c b/src/log_pgsql.c | |
index 524f682..baf7351 100644 | |
--- a/src/log_pgsql.c | |
+++ b/src/log_pgsql.c | |
@@ -474,7 +474,7 @@ void pw_pgsql_check(AuthResult * const result, | |
escaped_account, escaped_ip, | |
escaped_port, escaped_peer_ip, | |
escaped_decimal_ip)) == NULL) { | |
- goto bye; | |
+ die(421, LOG_ERR, MSG_CONF_ERR ": Could not fetch crypted_password from db."); | |
} | |
if (uid == NULL) { | |
uid = pw_pgsql_getquery(id_sql_server, sqlreq_getuid, | |
@@ -483,7 +483,7 @@ void pw_pgsql_check(AuthResult * const result, | |
escaped_decimal_ip); | |
} | |
if (uid == NULL) { | |
- goto bye; | |
+ die(421, LOG_ERR, MSG_CONF_ERR ": Could not fetch user_id (uid) from db."); | |
} | |
if (gid == NULL) { | |
gid = pw_pgsql_getquery(id_sql_server, sqlreq_getgid, | |
@@ -492,26 +492,32 @@ void pw_pgsql_check(AuthResult * const result, | |
escaped_decimal_ip); | |
} | |
if (gid == NULL) { | |
- goto bye; | |
+ die(421, LOG_ERR, MSG_CONF_ERR ": Could not fetch group_id (gid) from db."); | |
} | |
if ((dir = pw_pgsql_getquery(id_sql_server, sqlreq_getdir, | |
escaped_account, escaped_ip, | |
escaped_port, escaped_peer_ip, | |
escaped_decimal_ip)) == NULL) { | |
- goto bye; | |
+ die(421, LOG_ERR, MSG_CONF_ERR ": Could not fetch ftp directory name from db."); | |
} | |
result->auth_ok--; /* -1 */ | |
+ logfile(LOG_DEBUG, "Choosing the encryption method according to config-file.."); | |
if (strcasecmp(crypto, PASSWD_SQL_ANY) == 0) { | |
+ logfile(LOG_DEBUG, "Encryption is: Any"); | |
crypto_crypt++; | |
crypto_md5++; | |
crypto_sha1++; | |
} else if (strcasecmp(crypto, PASSWD_SQL_CRYPT) == 0) { | |
+ logfile(LOG_DEBUG, "Encryption is: Crypt"); | |
crypto_crypt++; | |
} else if (strcasecmp(crypto, PASSWD_SQL_MD5) == 0) { | |
+ logfile(LOG_DEBUG, "Encryption is: Md5"); | |
crypto_md5++; | |
} else if (strcasecmp(crypto, PASSWD_SQL_SHA1) == 0) { | |
+ logfile(LOG_DEBUG, "Encryption is: SHA1"); | |
crypto_sha1++; | |
} else { /* default to plaintext */ | |
+ logfile(LOG_DEBUG, "No Encryption: Plaintext is used."); | |
crypto_plain++; | |
} | |
-- | |
1.8.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment