1 --- proftpd-1.2.5/contrib/mod_sql.c Thu Jan 9 17:30:41 2003
2 +++ proftpd-1.2.5/contrib/mod_sql.c Thu Jan 9 17:30:33 2003
7 +static modret_t *check_auth_vmail(cmd_rec * cmd, const char *c_clear,
13 + while (!((*tmphash=='\0')||(*tmphash=='}'))) tmphash++;
14 + if (*tmphash =='}') tmphash++;
15 + if (*tmphash == '\0') return ERROR_INT(cmd,AUTH_BADPWD);
16 + if (!strncmp(c_hash,"{plaintext}",11))
17 + if (!strcmp(tmphash,c_clear)) return HANDLED(cmd);
18 + if (!strncmp(c_hash,"{crypt-md5}",11))
19 + if (!strcmp(tmphash,crypt(c_clear, tmphash))) return HANDLED(cmd);
20 + // not sure about that
21 + if (!strncmp(c_hash,"{crypt}",7))
22 + if (!strcmp(tmphash,crypt(c_clear, tmphash))) return HANDLED(cmd);
23 + // add other types (md5 etc.)
24 + return ERROR_INT(cmd,AUTH_BADPWD);
28 * support for general-purpose authentication schemes
32 #define OPENSSL_AUTH_FLAG 1<<4
34 +#define VMAIL_AUTH_FLAG 1<<5
37 typedef modret_t *(*auth_func_ptr) (cmd_rec *, const char *, const char *);
41 {"OpenSSL", check_auth_openssl, OPENSSL_AUTH_FLAG},
43 + {"VMail", check_auth_vmail, VMAIL_AUTH_FLAG},
44 + // backwards compatibility, somebody's using it?
45 + {"VMail_Crypt", check_auth_vmail, VMAIL_AUTH_FLAG},
47 * add additional encryption types below