diff --git a/Changes b/Changes index e1e517f75..9de87ffbe 100644 --- a/Changes +++ b/Changes @@ -1166,3 +1166,5 @@ v- Fixed some bugreport stuff (suggested by dimplesx #0000058 - Made the win32 version set log files to writable if they are read only (reported by dimplesx #0000057) +- Removed useless stuff in m_oper (null ptr thing, just dont set them) +- Fixed auth.c to use random salt diff --git a/src/auth.c b/src/auth.c index 9daa123fc..5c503df3e 100644 --- a/src/auth.c +++ b/src/auth.c @@ -176,10 +176,7 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para) /* If our data is like 1 or none, we just let em through .. */ if (!(as->data[0] && as->data[1])) return 1; - salt[0] = as->data[0]; - salt[1] = as->data[1]; - salt[2] = '\0'; - if (!strcmp(crypt(para, salt), as->data)) + if (!strcmp(crypt(para, as->data), as->data)) return 2; else return -1; @@ -292,9 +289,7 @@ char *Auth_Make(short type, char *para) /* If our data is like 1 or none, we just let em through .. */ if (!(para[0] && para[1])) return NULL; - salt[0] = para[0]; - salt[1] = para[1]; - salt[2] = '\0'; + sprintf(salt, "%02X", (rand() >> 24) & 0xFF); return(crypt(para, salt)); break; #endif diff --git a/src/modules/m_oper.c b/src/modules/m_oper.c index f59dd8e91..ff8347842 100644 --- a/src/modules/m_oper.c +++ b/src/modules/m_oper.c @@ -255,7 +255,7 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) { sptr->oflag = aconf->oflags; if ((aconf->oflags & OFLAG_HIDE) && iNAH && !BadPtr(host)) { - iNAH_host(sptr, (host != NULL) ? host : "eek.host.is.null.pointer"); + iNAH_host(sptr, host); } if (announce != NULL) {