From: Michael Poole Date: Tue, 16 Jan 2007 01:21:37 +0000 (+0000) Subject: Pass the other two USER parameters to iauth. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=24fae9fd9a4db0b11b13e186b8b86affca73b29f Pass the other two USER parameters to iauth. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1748 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 98e3689..cbf4a80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-01-15 Michael Poole + + * 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 * ircd/os_generic.c (os_recv_nonb): Set errno to zero when diff --git a/doc/readme.iauth b/doc/readme.iauth index b8cd123..133e4e2 100644 --- a/doc/readme.iauth +++ b/doc/readme.iauth @@ -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: U : -Example: 5 U buddha :Gautama Siddhartha +Syntax: U : +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 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 parameter. u - Client Username Syntax: u diff --git a/include/s_auth.h b/include/s_auth.h index 2831088..14c55a1 100644 --- a/include/s_auth.h +++ b/include/s_auth.h @@ -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); diff --git a/ircd/m_user.c b/ircd/m_user.c index babbd34..17fa100 100644 --- a/ircd/m_user.c +++ b/ircd/m_user.c @@ -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); } diff --git a/ircd/s_auth.c b/ircd/s_auth.c index 7984b5d..d3e816b 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -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);