/***********************************************************************
X3 ChangeLog
-2007-02-12 Alex Schumann <rubin@afternet.org>
+2007-02-13 Alex Schumann <rubin@afternet.org>
+
+ * src/nickserv.c: Fix bugs with ldap cookies. Fix opt_password
+ warning/crash potential
+
+2007-02-13 Alex Schumann <rubin@afternet.org>
* src/x3ldap.c: Fix double-hashing of passwords when using ldap and
resetpass cookie system.
switch (hi->cookie->type) {
case ACTIVATION:
+#ifdef WITH_LDAP
+ if(nickserv_conf.ldap_enable && nickserv_conf.ldap_admin_dn) {
+ int rc;
+ if((rc = ldap_do_modify(hi->handle, hi->cookie->data, NULL)) != LDAP_SUCCESS) {
+ /* Falied to update email in ldap, but still
+ * updated it here.. what should we do? */
+ reply("NSMSG_LDAP_FAIL", ldap_err2string(rc));
+ return 0;
+ }
+ }
+#endif
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
set_user_handle_info(user, hi, 1);
reply("NSMSG_HANDLE_ACTIVATED");
SyncLog("ACCOUNTACC %s", hi->handle);
break;
case PASSWORD_CHANGE:
+#ifdef WITH_LDAP
+ if(nickserv_conf.ldap_enable && nickserv_conf.ldap_admin_dn) {
+ int rc;
+ if((rc = ldap_do_modify(hi->handle, hi->cookie->data, NULL)) != LDAP_SUCCESS) {
+ /* Falied to update email in ldap, but still
+ * updated it here.. what should we do? */
+ reply("NSMSG_LDAP_FAIL", ldap_err2string(rc));
+ return 0;
+ }
+ }
+#endif
set_user_handle_info(user, hi, 1);
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
reply("NSMSG_PASSWORD_CHANGED");
static OPTION_FUNC(opt_password)
{
char crypted[MD5_CRYPT_LENGTH+1];
+ if(argc < 1) {
+ return 0;
+ }
if (!override) {
reply("NSMSG_USE_CMD_PASS");
return 0;