ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_pass.c
(Generate patch)

Comparing ircd-hybrid-8/modules/m_pass.c (file contents):
Revision 1178 by michael, Mon Aug 15 08:11:31 2011 UTC vs.
Revision 1230 by michael, Thu Sep 22 19:41:19 2011 UTC

# Line 35 | Line 35
35   #include "s_serv.h"
36   #include "s_user.h"
37  
38 – static void mr_pass(struct Client *, struct Client *, int, char *[]);
39 –
40 – struct Message pass_msgtab = {
41 –  "PASS", 0, 0, 2, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
42 –  { mr_pass, m_registered, m_ignore, m_ignore, m_registered, mr_pass }
43 – };
44 –
45 – void
46 – _modinit(void)
47 – {
48 –  mod_add_cmd(&pass_msgtab);
49 – }
50 –
51 – void
52 – _moddeinit(void)
53 – {
54 –  mod_del_cmd(&pass_msgtab);
55 – }
56 –
57 – const char *_version = "$Revision$";
38  
39   /*
40   * m_pass() - Added Sat, 4 March 1989
# Line 71 | Line 51 | mr_pass(struct Client *client_p, struct
51   {
52    char *password = parv[1];
53  
54 +  assert(client_p == source_p);
55 +
56    if (EmptyString(password))
57    {
58 <    sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS),
59 <               me.name, EmptyString(parv[0]) ? "*" : parv[0], "PASS");
58 >    sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name,
59 >               source_p->name[0] ? source_p->name : "*", "PASS");
60      return;
61    }
62  
63 <  MyFree(client_p->localClient->passwd);
63 >  MyFree(source_p->localClient->passwd);
64    if (strlen(password) > PASSWDLEN)
65      password[PASSWDLEN] = '\0';
66 <  DupString(client_p->localClient->passwd, password);
66 >  DupString(source_p->localClient->passwd, password);
67  
68    if (parc > 2)
69    {
# Line 92 | Line 74 | mr_pass(struct Client *client_p, struct
74       * safely assume if there is a ":TS" then its a TS server
75       * -Dianora
76       */
77 <    if (!irccmp(parv[2], "TS") && client_p->tsinfo == 0)
78 <      client_p->tsinfo = TS_DOESTS;
77 >    if (!irccmp(parv[2], "TS") && source_p->tsinfo == 0)
78 >      source_p->tsinfo = TS_DOESTS;
79    }
80  
81    /* only do this stuff if we are doing ts6 */
# Line 101 | Line 83 | mr_pass(struct Client *client_p, struct
83    {
84      if (atoi(parv[3]) >= 6 && valid_sid(parv[4]))
85      {
86 <      strlcpy(client_p->id, parv[4], sizeof(client_p->id));
87 <      SetCapable(client_p, CAP_TS6);
86 >      strlcpy(source_p->id, parv[4], sizeof(source_p->id));
87 >      SetCapable(source_p, CAP_TS6);
88      }
89    }
90   }
91 +
92 + static struct Message pass_msgtab = {
93 +  "PASS", 0, 0, 2, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
94 +  { mr_pass, m_registered, m_ignore, m_ignore, m_registered, mr_pass }
95 + };
96 +
97 + static void
98 + module_init(void)
99 + {
100 +  mod_add_cmd(&pass_msgtab);
101 + }
102 +
103 + static void
104 + module_exit(void)
105 + {
106 +  mod_del_cmd(&pass_msgtab);
107 + }
108 +
109 + struct module module_entry = {
110 +  .node    = { NULL, NULL, NULL },
111 +  .name    = NULL,
112 +  .version = "$Revision$",
113 +  .handle  = NULL,
114 +  .modinit = module_init,
115 +  .modexit = module_exit,
116 +  .flags   = 0
117 + };

Diff Legend

– Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)