Changeset 756 in openpam


Ignore:
Timestamp:
Jan 22, 2014, 3:13:56 PM (7 years ago)
Author:
Dag-Erling Smørgrav
Message:

Do not use oath_[ht]otp_match() as predicates - a non-zero return can
mean an error occurred. We should probably switch to the standard
Unix idiom of returning 0 for success.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/pam_oath/pam_oath.c

    r753 r756  
    272272        }
    273273        openpam_log(PAM_LOG_VERBOSE, "verification code %s",
    274             ret ? "matched" : "did not match");
    275         if (ret == 0) {
    276                 pam_err = PAM_AUTH_ERR;
     274            ret > 0 ? "matched" : "did not match");
     275        if (ret <= 0) {
     276                pam_err = ret < 0 ? PAM_SERVICE_ERR : PAM_AUTH_ERR;
    277277                goto done;
    278278        }
Note: See TracChangeset for help on using the changeset viewer.