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}, |
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 |