#include "s_conf.h"
#include "modules.h"
#include "messages.h"
+#include "send.h"
#include <string.h>
-static int m_mkpasswd(struct Client *client_p, struct Client *source_p,
+static int m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
int parc, const char *parv[]);
-static int mo_mkpasswd(struct Client *client_p, struct Client *source_p,
+static int mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
int parc, const char *parv[]);
static char *make_md5_salt(int);
/* 0 .. 63, ascii - 64 */
struct Message mkpasswd_msgtab = {
- "MKPASSWD", 0, 0, 0, MFLG_SLOW,
+ "MKPASSWD", 0, 0, 0, 0,
{mg_unreg, {m_mkpasswd, 2}, mg_ignore, mg_ignore, mg_ignore, {mo_mkpasswd, 2}}
};
* parv[2] = type
*/
static int
-m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
static time_t last_used = 0;
char *salt;
* parv[2] = type
*/
static int
-mo_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
char *salt;
const char *crypted;
if(read(fd, buf, length) != length)
{
free(buf);
+ close(fd);
return (generate_poor_salt(salt, length));
}
salt[i] = saltChars[abs(buf[i]) % 64];
}
free(buf);
+ close(fd);
return (salt);
}