+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
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>
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);
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);
}
/** 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;
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);