repo: ngircd
action: commit
revision: 
path_from: 
revision_from: eda2556e0919e48aa8fb7556383aa81a089b4135:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit eda2556e0919e48aa8fb7556383aa81a089b4135
Author: Florian Westphal 
Date:   Sun Jan 9 18:17:35 2011 +0100

    conf: Warn if PAM=true when ngircd was built without PAM support

diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index db5286938c1760c88c944d1d9a481ac54114fa09..
index ..5a992eb58830a4b8e4e532c15ccdf2d1f1700277 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -899,8 +899,20 @@ WarnIdent(int UNUSED Line)
 	if (Conf_Ident) {
 		/* user has enabled ident lookups explicitly, but ... */
 		Config_Error(LOG_WARNING,
-			"%s: line %d: Ident=True, but ngircd was built without IDENT support",
-			NGIRCd_ConfFile, Line);
+			"%s: line %d: %s=True, but ngircd was built without support",
+			NGIRCd_ConfFile, Line, "Ident");
+	}
+#endif
+}
+
+static void
+WarnPAM(int UNUSED Line)
+{
+#ifndef PAM
+	if (Conf_PAM) {
+		Config_Error(LOG_WARNING,
+			"%s: line %d: %s=True, but ngircd was built without support",
+			NGIRCd_ConfFile, Line, "PAM");
 	}
 #endif
 }
@@ -1109,6 +1121,8 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
 					NGIRCd_ConfFile, Line, NoNo(Var), InvertArg(Arg));
 		if (strcasecmp(Var, "NoIdent") == 0)
 			WarnIdent(Line);
+		else if (strcasecmp(Var, "NoPam") == 0)
+			WarnPAM(Line);
 		return;
 	}
 	if( strcasecmp( Var, "DNS" ) == 0 ) {
@@ -1125,6 +1139,7 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
 	if(strcasecmp(Var, "PAM") == 0) {
 		/* use PAM library to authenticate users */
 		Conf_PAM = Check_ArgIsTrue(Arg);
+		WarnPAM(Line);
 		return;
 	}
 	if(strcasecmp(Var, "ZeroConf") == 0) {

-----END OF PAGE-----