/[dragonmtn]/snowwhite/chanserv.c
ViewVC logotype

Diff of /snowwhite/chanserv.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by Halcy0n, Thu Apr 7 01:37:00 2005 UTC revision 1.3 by Halcy0n, Tue Apr 12 06:18:29 2005 UTC
# Line 173  interp::service_cmd_t chanserv_commands[ Line 173  interp::service_cmd_t chanserv_commands[
173    { "getpass",  cs_getpass,              0,     LOG_NO, CMD_REG,         5},    { "getpass",  cs_getpass,              0,     LOG_NO, CMD_REG,         5},
174    { "setpass",  cs_setpass,              0,     LOG_NO, CMD_REG,         5},    { "setpass",  cs_setpass,              0,     LOG_NO, CMD_REG,         5},
175    { "setrealpass",  cs_setrealpass,  OOPER,     LOG_OK, CMD_REG,         5},    { "setrealpass",  cs_setrealpass,  OOPER,     LOG_OK, CMD_REG,         5},
 #ifndef NOGRPCMD  
   { "getrealpass",cs_getrealpass,        0,     LOG_NO, CMD_REG,         5},  
 #endif  
176    { "save",             cs_save,         0,     LOG_NO, CMD_REG,         15},    { "save",             cs_save,         0,     LOG_NO, CMD_REG,         15},
177    { "unban",    cs_unban,        0,     LOG_NO, CMD_REG,          5},    { "unban",    cs_unban,        0,     LOG_NO, CMD_REG,          5},
178    { "invite",   cs_invite,       0,     LOG_NO, CMD_REG,          3},    { "invite",   cs_invite,       0,     LOG_NO, CMD_REG,          3},
# Line 6309  CCMD(cs_getpass) Line 6306  CCMD(cs_getpass)
6306  }  }
6307    
6308  /*--------------------------------------------------------------------*/  /*--------------------------------------------------------------------*/
 /* Debug command: Get the value of the password struct */  
   
 /**  
  * \cscmd Getrealpass  
  * \plr This command is slated for removal and now only exists to debug  
  *      the new implementation of passwords.  -Mysid  
  * \warning Do not use.  
  */  
 CCMD(cs_getrealpass)  
 {  
         char *from = nick->nick;  
         RegChanList *chan;  
   
   
         if (!isRoot(nick)) {  
                 sSend(":%s NOTICE %s :Access denied", ChanServ, from);  
                 return RET_NOPERM;  
         }  
   
         if (!opFlagged(nick, OROOT | OVERRIDE)) {  
                 sSend(":%s NOTICE %s :Restricted -- getrealpass is a debugging and administrative command not for password recovery.",  
                          ChanServ, from);  
                 return RET_NOPERM;  
         }  
   
         if (numargs != 2) {  
                 sSend(":%s NOTICE %s :Must supply a channel name", ChanServ, from);  
                 return RET_SYNTAX;  
         }  
   
         chan = getRegChanData(args[1]);  
   
         if (chan == NULL) {  
                 sSend(":%s NOTICE %s :%s is not registered", ChanServ, from,  
                           args[1]);  
                 return RET_NOTARGET;  
         }  
   
         sSend(":%s GLOBOPS :%s used getrealpass on %s", ChanServ, from,  
                   chan->name);  
         if (!(chan->flags & CENCRYPT))  
                 sSend(":%s NOTICE %s :The password for %s is %s", ChanServ, from,  
                           args[1], chan->password);  
         else {  
                 u_char *p = toBase64(chan->password, 16);  
   
                 sSend(":%s NOTICE %s :The password for %s is encrypted: %s", ChanServ, from,  
                           args[1], md5_printable(chan->password));  
                 if (p) {  
                         sSend(":%s NOTICE %s :Base64 representation: $%s", ChanServ, from,  
                                  p);  
                         FREE(p);  
                 }  
         }  
         operlog->log(nick, CS_GETREALPASS, args[1]);  
         return RET_OK;  
 }  
   
 /*--------------------------------------------------------------------*/  
6309    
6310  /**  /**
6311   * \cscmd Invite   * \cscmd Invite

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26