]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd-vmail.patch
- pgsql support added
[packages/proftpd.git] / proftpd-vmail.patch
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
3 @@ -517,6 +517,26 @@
4  }
5  #endif
6  
7 +static modret_t *check_auth_vmail(cmd_rec * cmd, const char *c_clear,
8 +                                 const char *c_hash)
9 +{
10 +  int success = 0;
11 +  char * tmphash;
12 +  tmphash=c_hash
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);
25 +}
26 +
27  /*
28   * support for general-purpose authentication schemes 
29   */
30 @@ -528,6 +548,8 @@
31  #ifdef HAVE_OPENSSL
32  #define OPENSSL_AUTH_FLAG       1<<4
33  #endif
34 +#define VMAIL_AUTH_FLAG   1<<5
35 +
36  
37  typedef modret_t *(*auth_func_ptr) (cmd_rec *, const char *, const char *);
38  
39 @@ -546,6 +568,9 @@
40  #ifdef HAVE_OPENSSL
41    {"OpenSSL", check_auth_openssl, OPENSSL_AUTH_FLAG},
42  #endif
43 +  {"VMail", check_auth_vmail, VMAIL_AUTH_FLAG},
44 +  // backwards compatibility, somebody's using it? 
45 +  {"VMail_Crypt", check_auth_vmail, VMAIL_AUTH_FLAG},
46    /*
47     * add additional encryption types below 
48     */
This page took 0.036084 seconds and 3 git commands to generate.