Pass the other two USER parameters to iauth.
authorMichael Poole <mdpoole@troilus.org>
Tue, 16 Jan 2007 01:21:37 +0000 (01:21 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 16 Jan 2007 01:21:37 +0000 (01:21 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1748 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
doc/readme.iauth
include/s_auth.h
ircd/m_user.c
ircd/s_auth.c

index 98e368963c2d673acc9b747b3535927c8db786c4..cbf4a80c3c271bd5cc767e930f8fae9fcff3ad30 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-01-15  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
 
        * ircd/os_generic.c (os_recv_nonb): Set errno to zero when
index b8cd123b24cbbac898ef8e846b95d4ca0c5b402f..133e4e228927d43444e60d6c48d58071de69bb83 100644 (file)
@@ -162,14 +162,15 @@ Comments: Indicates the client's password information.  This may be a
   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: ircd does not include the <userinfo> data.
+  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 2831088816bd63a7518ab6bd46c582710e599996..14c55a1210b7d55832906e19d5ccd6888138eedc 100644 (file)
@@ -36,7 +36,7 @@ struct StatDesc;
 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 babbd34d88641fcc237dec4889994c00feb8a3a1..17fa10042d7fa83e0d5391273e218cc1388c7930 100644 (file)
@@ -139,6 +139,6 @@ int m_user(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
 
   info     = (EmptyString(parv[4])) ? "No Info" : parv[4];
 
-  return auth_set_user(cli_auth(cptr), username, info);
+  return auth_set_user(cli_auth(cptr), username, parv[2], parv[3], info);
 }
 
index 7984b5df8bd205219f00ecf7b505d4b7197ddde6..d3e816b772567052d9e9dcfa9b4b78040c08a2e6 100644 (file)
@@ -1043,10 +1043,14 @@ int auth_set_pong(struct AuthRequest *auth, unsigned int cookie)
 /** 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 @@ int auth_set_user(struct AuthRequest *auth, const char *username, const char *us
   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);