Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2007-01-16 02:34:29 UTC
Modified files:
ChangeLog doc/readme.iauth include/s_auth.h ircd/m_user.c
ircd/s_auth.c
Log message:
Pass the other two USER parameters to iauth.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.830 ircu2.10/ChangeLog:1.831
--- ircu2.10/ChangeLog:1.830 Mon Jan 15 18:31:57 2007
+++ ircu2.10/ChangeLog Mon Jan 15 18:34:18 2007
@@ -1,3 +1,14 @@
+2006-01-15 Michael Poole <[EMAIL PROTECTED]>
+
+ * doc/readme.iauth (U): Document extended fields.
+
+ * include/s_auth.h (auth_set_user): Declare new parameters.
+
+ * ircd/m_user.c (m_user): Pass new parameters.
+
+ * ircd/s_auth.c (auth_set_user): Accept new parameters. When
+ using Undernet extensions, forward them to the iauth process.
+
2006-01-14 Michael Poole <[EMAIL PROTECTED]>
* ircd/os_generic.c (os_recv_nonb): Set errno to zero when
Index: ircu2.10/doc/readme.iauth
diff -u ircu2.10/doc/readme.iauth:1.3 ircu2.10/doc/readme.iauth:1.4
--- ircu2.10/doc/readme.iauth:1.3 Thu Jul 27 16:34:16 2006
+++ ircu2.10/doc/readme.iauth Mon Jan 15 18:34:19 2007
@@ -162,16 +162,15 @@
enabled by requesting the A policy.
U - Client Username
-Syntax: <id> U <username> :<userinfo ...>
-Example: 5 U buddha :Gautama Siddhartha
+Syntax: <id> U <username> <hostname> <servername> :<userinfo ...>
+Example: 5 U buddha bodhisattva.example.com irc.undernet.org :Gautama
Siddhartha
States: REGISTER(1+)
Next State: -
Comments: Indicates the client's claimed username and "GECOS"
- information. This information is not reliable. This message is
- enabled by requesting the A policy.
-Compatibility: The <userinfo> field is an Undernet extension and ircd
- does not send it. It is enabled by the iauth instance requesting
- the U policy.
+ information, along with client hostname and server name. This
+ information is not reliable. This message is enabled by requesting
+ the A policy.
+Compatibility: ircd only sends the <username> parameter.
u - Client Username
Syntax: <id> u <username>
Index: ircu2.10/include/s_auth.h
diff -u ircu2.10/include/s_auth.h:1.9 ircu2.10/include/s_auth.h:1.10
--- ircu2.10/include/s_auth.h:1.9 Sun May 14 12:31:30 2006
+++ ircu2.10/include/s_auth.h Mon Jan 15 18:34:19 2007
@@ -17,7 +17,7 @@
*/
/** @file
* @brief Interface for DNS and ident lookups.
- * @version $Id: s_auth.h,v 1.9 2006/05/14 19:31:30 entrope Exp $
+ * @version $Id: s_auth.h,v 1.10 2007/01/16 02:34:19 entrope Exp $
*/
#ifndef INCLUDED_s_auth_h
#define INCLUDED_s_auth_h
@@ -36,7 +36,7 @@
extern void start_auth(struct Client *);
extern int auth_ping_timeout(struct Client *);
extern int auth_set_pong(struct AuthRequest *auth, unsigned int cookie);
-extern int auth_set_user(struct AuthRequest *auth, const char *username, const
char *userinfo);
+extern int auth_set_user(struct AuthRequest *auth, const char *username, const
char *hostname, const char *servername, const char *userinfo);
extern int auth_set_nick(struct AuthRequest *auth, const char *nickname);
extern int auth_set_password(struct AuthRequest *auth, const char *password);
extern int auth_cap_start(struct AuthRequest *auth);
Index: ircu2.10/ircd/m_user.c
diff -u ircu2.10/ircd/m_user.c:1.11 ircu2.10/ircd/m_user.c:1.12
--- ircu2.10/ircd/m_user.c:1.11 Fri Jul 14 15:47:52 2006
+++ ircu2.10/ircd/m_user.c Mon Jan 15 18:34:19 2007
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_user.c,v 1.11 2006/07/14 22:47:52 entrope Exp $
+ * $Id: m_user.c,v 1.12 2007/01/16 02:34:19 entrope Exp $
*/
#include "config.h"
@@ -88,6 +88,6 @@
info = (EmptyString(parv[parc - 1])) ? "No Info" : parv[parc - 1];
- return auth_set_user(cli_auth(cptr), username, info);
+ return auth_set_user(cli_auth(cptr), username, parv[2], parv[3], info);
}
Index: ircu2.10/ircd/s_auth.c
diff -u ircu2.10/ircd/s_auth.c:1.49 ircu2.10/ircd/s_auth.c:1.50
--- ircu2.10/ircd/s_auth.c:1.49 Sun Jul 23 11:17:50 2006
+++ ircu2.10/ircd/s_auth.c Mon Jan 15 18:34:19 2007
@@ -31,7 +31,7 @@
*/
/** @file
* @brief Implementation of DNS and ident lookups.
- * @version $Id: s_auth.c,v 1.49 2006/07/23 18:17:50 entrope Exp $
+ * @version $Id: s_auth.c,v 1.50 2007/01/16 02:34:19 entrope Exp $
*/
#include "config.h"
@@ -1043,10 +1043,14 @@
/** Record a user's claimed username and userinfo.
* @param[in] auth Authorization request for client.
* @param[in] username Client's asserted username.
+ * @param[in] hostname Third argument of USER command (client's
+ * hostname, per RFC 1459).
+ * @param[in] servername Fourth argument of USER command (server's
+ * name, per RFC 1459).
* @param[in] userinfo Client's asserted self-description.
* @return Zero if client should be kept, CPTR_KILLED if rejected.
*/
-int auth_set_user(struct AuthRequest *auth, const char *username, const char
*userinfo)
+int auth_set_user(struct AuthRequest *auth, const char *username, const char
*hostname, const char *servername, const char *userinfo)
{
struct Client *cptr;
@@ -1059,7 +1063,7 @@
ircd_strncpy(cli_user(cptr)->username, username, USERLEN);
ircd_strncpy(cli_user(cptr)->host, cli_sockhost(cptr), HOSTLEN);
if (IAuthHas(iauth, IAUTH_UNDERNET))
- sendto_iauth(cptr, "U %s :%s", username, userinfo);
+ sendto_iauth(cptr, "U %s %s %s :%s", username, hostname, servername,
userinfo);
else if (IAuthHas(iauth, IAUTH_ADDLINFO))
sendto_iauth(cptr, "U %s", username);
return check_auth_finished(auth);
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches