atheme / atheme-contrib-modules

Community-supported modules for Atheme
https://atheme.github.io/
Other
33 stars 39 forks source link

use config_options.default_pass_length for ns_sendpassmail.c #57

Open jesopo opened 2 years ago

aaronmdjones commented 2 years ago

This option does not exist in version 7.2 of services; it needs some version detection logic.

diff --git a/src/ns_sendpassmail.c b/src/ns_sendpassmail.c
index d9e51d1..873448c 100644
--- a/src/ns_sendpassmail.c
+++ b/src/ns_sendpassmail.c
@@ -76,7 +76,11 @@ sendpassmail_foreach_cb(myentity_t *mt, void *privdata)
        return 0;
    }

+#if (CURRENT_ABI_REVISION < 730000)
    key = random_string(12);
+#else
+   key = random_string(config_options.default_pass_length);
+#endif

    const char *const hash = crypt_password(key);

(Edited to actually use random_string() >_>)