This function returns 0 if the password specified by v was found in vals, or a non-zero value if the password v was not found in vals.