コード例 #1
0
ファイル: m_user.c プロジェクト: KSoute/oftc-hybrid
/*
** mr_user
**      parv[0] = sender prefix
**      parv[1] = username (login name, account)
**      parv[2] = client host name (used only from other servers)
**      parv[3] = server host name (used only from other servers)
**      parv[4] = users real name info
*/
static void
mr_user(struct Client *client_p, struct Client *source_p,
        int parc, char *parv[])
{
  char *p;
  char *user;

  if (source_p->localClient->listener->flags & LISTENER_SERVER)
  {
    exit_client(source_p, &me, "Use a different port");
    return;
  }

  if ((p = strchr(parv[1], '@')) != NULL)
    *p = '\0'; 

  if (EmptyString(parv[4]))
  {
    sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name,
               source_p->name[0] ? source_p->name : "*", "USER");
    return;
  }

  if(!EmptyString(source_p->name))
  {
    user = parv[1];
    if(*user == '&')
    {
      user++;
      if(EmptyString(user))
        user = parv[1];
      else
      {
        if(!EmptyString(source_p->certfp))
        {
          char buf[SHA_DIGEST_LENGTH*2+1];

          base16_encode(buf, sizeof(buf), source_p->certfp, sizeof(source_p->certfp));
          sendto_server(&me, NULL, NOCAPS, NOCAPS, ":%s AUTH 1 %s %s %s", me.name,
              user, source_p->name, buf);
        }
        else
        {
          sendto_server(&me, NULL, NOCAPS, NOCAPS, ":%s AUTH 0 %s %s %s", me.name,
              user, source_p->name, source_p->localClient->passwd);
        }
        
        strlcpy(source_p->info, parv[4], sizeof(source_p->info));

        return;
      }
    }
  }

  do_local_user(parv[0], client_p, source_p,
                parv[1], /* username */
                parv[2], /* host     */
                parv[3], /* server   */
                parv[4]	 /* users real name */ );
}
コード例 #2
0
ファイル: m_user.c プロジェクト: mdharris/ircd
/*
** mr_user
**      parv[0] = sender prefix
**      parv[1] = username (login name, account)
**      parv[2] = client host name (used only from other servers)
**      parv[3] = server host name (used only from other servers)
**      parv[4] = users real name info
*/
static void
mr_user(struct Client *client_p, struct Client *source_p,
        int parc, char *parv[])
{
  char *p = NULL;

  if (source_p->localClient->listener->flags & LISTENER_SERVER)
  {
    exit_client(source_p, &me, "Use a different port");
    return;
  }

  if ((p = strchr(parv[1], '@')) != NULL)
    *p = '\0'; 

  if (EmptyString(parv[4]))
  {
    sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name,
               source_p->name[0] ? source_p->name : "*", "USER");
    return;
  }

  do_local_user(source_p,
                parv[1], /* username */
                parv[2], /* host     */
                parv[3], /* server   */
                parv[4]	 /* users real name */ );
}
コード例 #3
0
ファイル: m_user.c プロジェクト: ntchambers/charybdis
/* mr_user()
 *      parv[1] = username (login name, account)
 *      parv[2] = client host name (ignored)
 *      parv[3] = server host name (ignored)
 *      parv[4] = users gecos
 */
static int
mr_user(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
    static char buf[BUFSIZE];
    char *p;

    if (strlen(client_p->id) == 3)
    {
        exit_client(client_p, client_p, client_p, "Mixing client and server protocol");
        return 0;
    }

    if(source_p->flags & FLAGS_SENTUSER)
        return 0;

    if((p = strchr(parv[1], '@')))
        *p = '\0';

    rb_snprintf(buf, sizeof(buf), "%s %s", parv[2], parv[3]);
    rb_free(source_p->localClient->fullcaps);
    source_p->localClient->fullcaps = rb_strdup(buf);

    do_local_user(client_p, source_p, parv[1], parv[4]);
    return 0;
}
コード例 #4
0
ファイル: m_user.c プロジェクト: BackupTheBerlios/shadowircd
/*
** mr_user
**      parv[0] = sender prefix
**      parv[1] = username (login name, account)
**      parv[2] = client host name (used only from other servers)
**      parv[3] = server host name (used only from other servers)
**      parv[4] = users real name info
*/
static void
mr_user(struct Client *client_p, struct Client *source_p,
        int parc, char *parv[])
{
  char *p;

  if ((p = strchr(parv[1],'@')) != NULL)
    *p = '\0'; 

  if (*parv[4] == '\0')
  {
    sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
               me.name, EmptyString(parv[0]) ? "*" : parv[0], "USER");
    return;
  }

  do_local_user(parv[0], client_p, source_p,
                parv[1], /* username */
                parv[2], /* host     */
                parv[3], /* server   */
                parv[4]	 /* users real name */ );
}