about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj4
-rw-r--r--doc/sample-ngircd.conf.tmpl5
-rw-r--r--man/ngircd.conf.5.tmpl11
-rw-r--r--src/ngircd/conf.c7
-rw-r--r--src/ngircd/conf.h3
-rw-r--r--src/ngircd/conn.c22
6 files changed, 46 insertions, 6 deletions
diff --git a/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj b/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
index 594a8999..2f9124e4 100644
--- a/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
+++ b/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
@@ -181,7 +181,6 @@
 		FA322D9E0CEF752C001761B3 /* README-AUX.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "README-AUX.txt"; sourceTree = "<group>"; };
 		FA322D9F0CEF752C001761B3 /* README-BeOS.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "README-BeOS.txt"; sourceTree = "<group>"; };
 		FA322DA00CEF752C001761B3 /* RFC.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = RFC.txt; sourceTree = "<group>"; };
-		FA322DA10CEF752C001761B3 /* sample-ngircd.conf */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "sample-ngircd.conf"; sourceTree = "<group>"; };
 		FA322DA40CEF752C001761B3 /* Doxyfile */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Doxyfile; sourceTree = "<group>"; };
 		FA322DA50CEF752C001761B3 /* footer.inc.html */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.html; path = footer.inc.html; sourceTree = "<group>"; };
 		FA322DA60CEF752C001761B3 /* header.inc.html */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.html; path = header.inc.html; sourceTree = "<group>"; };
@@ -197,6 +196,7 @@
 		FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = ng_ipaddr.c; path = ipaddr/ng_ipaddr.c; sourceTree = "<group>"; };
 		FA407F2D0DB159F400271AF1 /* ng_ipaddr.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = ng_ipaddr.h; path = ipaddr/ng_ipaddr.h; sourceTree = "<group>"; };
 		FA407F380DB15AC700271AF1 /* GIT.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = GIT.txt; sourceTree = "<group>"; };
+		FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sample-ngircd.conf.tmpl"; sourceTree = "<group>"; };
 		FA85178A0FA061EC006A1F5A /* op.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = op.h; sourceTree = "<group>"; };
 		FA85178B0FA061EC006A1F5A /* op.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = op.c; sourceTree = "<group>"; };
 		FA99428A10E82A27007F27ED /* proc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = proc.h; sourceTree = "<group>"; };
@@ -561,7 +561,7 @@
 				FA322D9E0CEF752C001761B3 /* README-AUX.txt */,
 				FA322D9F0CEF752C001761B3 /* README-BeOS.txt */,
 				FA322DA00CEF752C001761B3 /* RFC.txt */,
-				FA322DA10CEF752C001761B3 /* sample-ngircd.conf */,
+				FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */,
 				FA322DA20CEF752C001761B3 /* src */,
 				FA322DA90CEF752C001761B3 /* SSL.txt */,
 			);
diff --git a/doc/sample-ngircd.conf.tmpl b/doc/sample-ngircd.conf.tmpl
index 6e02048f..b5a36b84 100644
--- a/doc/sample-ngircd.conf.tmpl
+++ b/doc/sample-ngircd.conf.tmpl
@@ -154,6 +154,11 @@
 	# maximum nick name length!
 	;MaxNickLength = 9
 
+	# Normally ngIRCd doesn't send any messages to a client until it is
+	# registered. Enable this option to let the daemon send "NOTICE AUTH"
+	# messages to clients while connecting.
+	;NoticeAuth = no
+
 	# Let ngIRCd send an "authentication PING" when a new client connects,
 	# and register this client only after receiving the corresponding
 	# "PONG" reply.
diff --git a/man/ngircd.conf.5.tmpl b/man/ngircd.conf.5.tmpl
index bcdad1f8..d1a0a64a 100644
--- a/man/ngircd.conf.5.tmpl
+++ b/man/ngircd.conf.5.tmpl
@@ -251,12 +251,17 @@ Maximum length of an user nick name (Default: 9, as in RFC 2812). Please
 note that all servers in an IRC network MUST use the same maximum nick name
 length!
 .TP
-\fBRequireAuthPing\fR
+\fBNoticeAuth\fR (boolean)
+Normally ngIRCd doesn't send any messages to a client until it is registered.
+Enable this option to let the daemon send "NOTICE AUTH" messages to clients
+while connecting. Default: no.
+.TP
+\fBRequireAuthPing\fR (boolean)
 Let ngIRCd send an "authentication PING" when a new client connects, and
 register this client only after receiving the corresponding "PONG" reply.
 Default: no.
 .TP
-\fBCloakHost\fR
+\fBCloakHost\fR (string)
 Set this hostname for every client instead of the real one. Default: empty,
 don't change.
 .PP
@@ -266,7 +271,7 @@ don't change.
 Don't use the percentage sign ("%"), it is reserved for future extensions!
 .RE
 .TP
-\fBCloakUserToNick\fR
+\fBCloakUserToNick\fR (boolean)
 Set every clients' user name to their nick name and hide the one supplied
 by the IRC client. Default: no.
 .SH [OPERATOR]
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index 452f744f..a00049ee 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -352,6 +352,7 @@ Conf_Test( void )
 	printf("  MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
 	printf("  MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
 	printf("  MaxNickLength = %u\n", Conf_MaxNickLength - 1);
+	printf("  NoticeAuth = %s\n", yesno_to_str(Conf_NoticeAuth));
 	printf("  CloakHost = %s\n", Conf_CloakHost);
 	printf("  CloakUserToNick = %s\n", yesno_to_str(Conf_CloakUserToNick));
 #ifndef STRICT_RFC
@@ -617,6 +618,7 @@ Set_Defaults(bool InitServers)
 	Conf_PongTimeout = 20;
 	Conf_ConnectRetry = 60;
 	Conf_DNS = true;
+	Conf_NoticeAuth = false;
 
 	Conf_Oper_Count = 0;
 	Conf_Channel_Count = 0;
@@ -1200,6 +1202,11 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
 		Conf_MaxNickLength = Handle_MaxNickLength(Line, Arg);
 		return;
 	}
+	if(strcasecmp(Var, "NoticeAuth") == 0) {
+		/* send NOTICE AUTH messages to clients on connect */
+		Conf_NoticeAuth = Check_ArgIsTrue(Arg);
+		return;
+	}
 
 	if( strcasecmp( Var, "Listen" ) == 0 ) {
 		/* IP-Address to bind sockets */
diff --git a/src/ngircd/conf.h b/src/ngircd/conf.h
index a183fcec..80d18187 100644
--- a/src/ngircd/conf.h
+++ b/src/ngircd/conf.h
@@ -178,6 +178,9 @@ GLOBAL bool Conf_Ident;
 /** Enable all usage of PAM, even when compiled with support for it */
 GLOBAL bool Conf_PAM;
 
+/** Enable NOTICE AUTH messages on connect */
+GLOBAL bool Conf_NoticeAuth;
+
 /*
  * try to connect to remote systems using the ipv6 protocol,
  * if they have an ipv6 address? (default yes)
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 275215d6..cc4364c4 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -1444,9 +1444,20 @@ New_Connection(int Sock)
 	if (!Conf_Ident)
 		identsock = -1;
 #endif
-	if (Conf_DNS)
+	if (Conf_DNS) {
+		if (Conf_NoticeAuth) {
+#ifdef IDENTAUTH
+			if (Conf_Ident)
+				(void)Conn_WriteStr(new_sock,
+					"NOTICE AUTH :*** Looking up your hostname and checking ident");
+			else
+#endif
+				(void)Conn_WriteStr(new_sock,
+					"NOTICE AUTH :*** Looking up your hostname");
+		}
 		Resolve_Addr(&My_Connections[new_sock].proc_stat, &new_addr,
 			     identsock, cb_Read_Resolver_Result);
+	}
 
 	Account_Connection();
 	return new_sock;
@@ -2175,13 +2186,22 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
 		strlcpy(My_Connections[i].host, readbuf,
 			sizeof(My_Connections[i].host));
 		Client_SetHostname(c, readbuf);
+		if (Conf_NoticeAuth)
+			(void)Conn_WriteStr(i,
+					"NOTICE AUTH :*** Found your hostname");
 #ifdef IDENTAUTH
 		++identptr;
 		if (*identptr) {
 			Log(LOG_INFO, "IDENT lookup for connection %d: \"%s\".", i, identptr);
 			Client_SetUser(c, identptr, true);
+			if (Conf_NoticeAuth)
+				(void)Conn_WriteStr(i,
+					"NOTICE AUTH :*** Got ident response");
 		} else {
 			Log(LOG_INFO, "IDENT lookup for connection %d: no result.", i);
+			if (Conf_NoticeAuth && Conf_Ident)
+				(void)Conn_WriteStr(i,
+					"NOTICE AUTH :*** No ident response");
 		}
 #endif
 	}