Branch: Tag:

2020-08-14

2020-08-14 09:36:53 by Henrik Grubbström (Grubba) <grubba@grubba.org>

EFUNs: Do not throw errors on validation failure in crypt().

The glibc crypt() implementation in RHEL 8 apparently sometimes
performs misguided "validation" of the salt even for "$6$" and
fails with EINVAL instead of actually validating the password.

Throwing an error on validation failure is not what existing
code expects, so just return a failure instead in this case.

Fixes #10050.

See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714219

3280:   #error No crypt function found and fallback failed.   #endif   #endif +  if(args < 2) +  {    if (!ret) {    switch(errno) {   #ifdef ELIBACC
3297:    break;    }    } -  if(args < 2) -  { +     pop_n_elems(args);    push_text(ret);    }else{    int i; -  i=!strcmp(ret,saltp); +  i = ret && !strcmp(ret,saltp);    pop_n_elems(args);    push_int(i);    }