Subversion Repositories wimsdev

Rev

Rev 14712 | Rev 15328 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14712 Rev 15324
Line 1949... Line 1949...
1949
{
1949
{
1950
  _http2env(tmplbuf,p); mystrncpy(p,tmplbuf,MAX_LINELEN);
1950
  _http2env(tmplbuf,p); mystrncpy(p,tmplbuf,MAX_LINELEN);
1951
}
1951
}
1952
 
1952
 
1953
/*
1953
/*
1954
char *saltchar="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./";
1954
...0 gives the number of DES rounds (2 here)
1955
*/
1955
*/
1956
 
-
 
1957
void calc_passcheck(char *p)
-
 
1958
{
-
 
1959
 
-
 
1960
}
-
 
1961
 
-
 
1962
void calc_passcrypt(char *p)
1956
void _passcrypt(char *p, char *salted_hash)
1963
{
1957
{
1964
#ifdef HAVE_CRYPT
1958
#ifdef HAVE_CRYPT
1965
  char saltstr[4];
1959
  char* saltstr=salted_hash ? salted_hash : "_...0smiw";
1966
  char *p1, *p2, *pp, *s, buf[MAX_LINELEN+1];
1960
  char *p1, *p2, *pp, *s, buf[MAX_LINELEN+1];
1967
  saltstr[0]='N'; saltstr[1]='v'; saltstr[2]=0; buf[0]=0; pp=buf;
1961
  buf[0]=0; pp=buf;
1968
  for(p1=find_word_start(p);*p1;p1=find_word_start(p2)) {
1962
  for(p1=find_word_start(p);*p1;p1=find_word_start(p2)) {
1969
    p2=find_word_end(p1); if(*p2) *p2++=0;
1963
    p2=find_word_end(p1); if(*p2) *p2++=0;
1970
    pp=pp+strlen(pp);
1964
    pp=pp+strlen(pp);
1971
    if(pp>buf) s=" "; else s="";
1965
    if(pp>buf) s=" "; else s="";
1972
    if(*p1=='*')
1966
    if(*p1=='*')
1973
      snprintf(pp,MAX_LINELEN-(pp-buf),"%s%s",s,p1);
1967
      snprintf(pp,MAX_LINELEN-(pp-buf),"%s%s",s,p1);
1974
    else
1968
    else
1975
      snprintf(pp,MAX_LINELEN-(pp-buf),"%s*%s",s,crypt(p1,saltstr));
1969
      snprintf(pp,MAX_LINELEN-(pp-buf),"%s*%s",s,crypt(p1,saltstr));
1976
  }
1970
  }
1977
  ovlstrcpy(p,buf);
1971
  ovlstrcpy(p,buf);
1978
#endif
1972
#endif
-
 
1973
}
-
 
1974
 
-
 
1975
void calc_passcrypt(char *p)
-
 
1976
{
-
 
1977
  _passcrypt(p, NULL);
-
 
1978
}
-
 
1979
/*
-
 
1980
 syntax: passcheck nocrypt and list of words as *cryptwords
-
 
1981
 check if the passcrypt of nocrypt is amongs the list of words
-
 
1982
*/
-
 
1983
void calc_passcheck(char *p)
-
 
1984
{
-
 
1985
  char cl[MAX_LINELEN+1],sh[MAX_LINELEN+1];
-
 
1986
  char *qq, *pp=wordchr(p,"and");
-
 
1987
  if(pp==NULL) module_error("syntax_error");
-
 
1988
  *pp=0;ovlstrcpy(cl,p); ovlstrcpy(sh,pp+strlen("and"));
-
 
1989
  substit(cl); substit(sh);
-
 
1990
  for (pp = sh;*pp; pp=qq){
-
 
1991
    while (*pp && *pp != '*') ++pp;
-
 
1992
    /* delete the star */
-
 
1993
    pp++;
-
 
1994
    if(!*pp) break;
-
 
1995
    for (qq = pp; *qq && *qq != ' '; ++qq);
-
 
1996
    if (*qq) *qq++ = 0;
-
 
1997
    _passcrypt(cl, pp);
-
 
1998
    if (!strcmp(cl+1, pp))
-
 
1999
    {ovlstrcpy(p, "yes"); return;}
-
 
2000
  }
-
 
2001
  ovlstrcpy(p, "no");
1979
}
2002
}
1980
 
2003
 
1981
void exec_readproc(char *p);
2004
void exec_readproc(char *p);
1982
 
2005
 
1983
/* crypted mail interface */
2006
/* crypted mail interface */
Line 2280... Line 2303...
2280
      {"nonempty", 0, calc_nonempty},
2303
      {"nonempty", 0, calc_nonempty},
2281
      {"nospace", 0, nospace},
2304
      {"nospace", 0, nospace},
2282
      {"nosubst", 1, calc_subst},
2305
      {"nosubst", 1, calc_subst},
2283
      {"nosubstit", 1, calc_subst},
2306
      {"nosubstit", 1, calc_subst},
2284
      {"nosubstitute", 1, calc_subst},
2307
      {"nosubstitute", 1, calc_subst},
2285
      {"passcheck", 0, calc_passcheck},
2308
      {"passcheck", 1, calc_passcheck},
2286
      {"passcrypt", 0, calc_passcrypt},
2309
      {"passcrypt", 0, calc_passcrypt},
2287
      {"pedia",  0, pedia},
2310
      {"pedia",  0, pedia},
2288
      {"perl",  0, calc_perl},
2311
      {"perl",  0, calc_perl},
2289
      {"position", 1, calc_pos},
2312
      {"position", 1, calc_pos},
2290
      {"positionof", 1, calc_pos},
2313
      {"positionof", 1, calc_pos},