Revision: 1911
          
http://undernet-ircu.svn.sourceforge.net/undernet-ircu/?rev=1911&view=rev
Author:   entrope
Date:     2009-03-26 02:50:39 +0000 (Thu, 26 Mar 2009)

Log Message:
-----------
Fix SourceForge bug #1722030.

Modified Paths:
--------------
    ircu2/branches/u2_10_12_branch/ChangeLog
    ircu2/branches/u2_10_12_branch/ircd/s_auth.c
    ircu2/branches/u2_10_12_branch/tools/iauth-test

Modified: ircu2/branches/u2_10_12_branch/ChangeLog
===================================================================
--- ircu2/branches/u2_10_12_branch/ChangeLog    2009-03-26 02:16:26 UTC (rev 
1910)
+++ ircu2/branches/u2_10_12_branch/ChangeLog    2009-03-26 02:50:39 UTC (rev 
1911)
@@ -1,5 +1,13 @@
 2009-03-25  Michael Poole <[email protected]>
 
+       * ircd/s_auth.c (iauth_cmd_hostname): Properly assign the spoofed
+       hostname (yea, even as the "real" host) in the hurry state.
+
+       * tools/iauth-test: Add reminder about perl's RTMIN signal and a
+       new handler to exercise the N command in the hurry state.
+
+2009-03-25  Michael Poole <[email protected]>
+
        * ircd/channel.c (mode_parse): Add Doxygen comment.  When bouncing
        a mode from a desynced U-lined server, do not set the modes or
        send the change as a HACK(4) message.

Modified: ircu2/branches/u2_10_12_branch/ircd/s_auth.c
===================================================================
--- ircu2/branches/u2_10_12_branch/ircd/s_auth.c        2009-03-26 02:16:26 UTC 
(rev 1910)
+++ ircu2/branches/u2_10_12_branch/ircd/s_auth.c        2009-03-26 02:50:39 UTC 
(rev 1911)
@@ -1736,6 +1736,14 @@
   }
   /* Set hostname from params. */
   ircd_strncpy(cli_sockhost(cli), params[0], HOSTLEN);
+  /* If we have gotten here, the user is in a "hurry" state and has
+   * been pre-registered.  Their hostname was set during that, and
+   * needs to be overwritten now.
+   */
+  if (FlagHas(&auth->flags, AR_IAUTH_HURRY)) {
+    ircd_strncpy(cli_user(cli)->host, cli_sockhost(cli), HOSTLEN);
+    ircd_strncpy(cli_user(cli)->realhost, cli_sockhost(cli), HOSTLEN);
+  }
   return 1;
 }
 

Modified: ircu2/branches/u2_10_12_branch/tools/iauth-test
===================================================================
--- ircu2/branches/u2_10_12_branch/tools/iauth-test     2009-03-26 02:16:26 UTC 
(rev 1910)
+++ ircu2/branches/u2_10_12_branch/tools/iauth-test     2009-03-26 02:50:39 UTC 
(rev 1911)
@@ -26,6 +26,8 @@
 # SIGRTMIN + 2 -> Set policy options ('O').
 # SIGRTMIN + 3 -> Simulate config change ('a', 'A').
 # SIGRTMIN + 4 -> Simulate statistics change ('s', 'S').
+# Note that Perl's value for SIGRTMIN may be different than your OS's.
+# The easiest check is by running "perl -V:sig_num -V:sig_name".
 
 # In the following discussion, sX means message X from the server, and
 # iX means message X from iauth.  The hard part is the ordering of
@@ -175,6 +177,7 @@
                 '127.0.2.0'  => { C_reply => 'N iauth.assigned.host',
                                   H_reply => 'D' },
                 '127.0.2.1'  => { C_reply => \&ip_change },
+                '127.0.2.2'  => { H_reply => \&host_change_and_done },
                 # 127.0.3.x: iC/sP functionality.
                 '127.0.3.0'  => { C_reply => 'C :Please enter the password.',
                                   P_reply => \&passwd_check },
@@ -198,6 +201,16 @@
     reply 'D', $client;
 }
 
+# Note to potential debuggers: You will have to change the iauth
+# policy before this (or any other H_reply hooks) will have any
+# effect.  Do this by sending two signals of $SIG{RTMIN+2} to the
+# iauth-test process, as noted near the beginning of this script.
+sub host_change_and_done ($$) {
+    my ($client, $extra) = @_;
+    reply 'N iauth.assigned.host', $client;
+    reply 'D', $client;
+}
+
 sub passwd_check ($$) {
     my ($client, $extra) = @_;
     if ($extra eq 'secret') {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to