diff options
| author | Alexander Barton <alex@barton.de> | 2011-03-27 20:56:50 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2011-03-27 20:56:50 +0200 |
| commit | cf7e3b1c0201ec298acb43e52dc1f05abcb8c80d (patch) | |
| tree | 263cc6111f6f753307314a7676f7bcb326195fbb /src | |
| parent | 1b5d1064deb4a4e382be1132e2ef058a8dc415f6 (diff) | |
| parent | 680db6755bdd7904a5aaae8290e074cb008425b5 (diff) | |
| download | ngircd-cf7e3b1c0201ec298acb43e52dc1f05abcb8c80d.tar.gz ngircd-cf7e3b1c0201ec298acb43e52dc1f05abcb8c80d.zip | |
Merge branch 'NoticeAuth'
* NoticeAuth: Add documentation for "NoticeAuth" configuration option Configuration: move "NoticeAuth" to GLOBAL section New configuration option "NoticeAuth": send NOTICE AUTH on connect
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/conf.c | 7 | ||||
| -rw-r--r-- | src/ngircd/conf.h | 3 | ||||
| -rw-r--r-- | src/ngircd/conn.c | 22 |
3 files changed, 31 insertions, 1 deletions
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index 32461f35..568b9e7a 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\n", yesno_to_str(Conf_CloakUserToNick)); @@ -614,6 +615,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; @@ -1192,6 +1194,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 305ccaa1..1633bc99 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 63093c25..9d17a738 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 } |