|
From: | Fredrik Lindgren |
Subject: | Re: [OATH-Toolkit-help] OATH_PRINTF_ERROR with more tha n one user in users.oath |
Date: | Wed, 04 Apr 2012 10:36:34 +0200 |
User-agent: | Roundcube Webmail/0.7.2 |
2012-04-04 10:27 skrev Simon Josefsson:
Fredrik Lindgren <address@hidden> writes:2012-04-04 10:03 skrev Simon Josefsson:Fredrik Lindgren <address@hidden> writes:[pam_oath.c:pam_sm_authenticate(301)] authenticate rc 4711 (UNKNOWN:Liboath unknown error) last otp Mon Apr 2 10:23:06 2012Thank you. So the culprit is this code: r = fputs (origline, outfh); if (r <= 0) return OATH_PRINTF_ERROR;The POSIX standard says fputs should return a "non-negative number",or EOF. Admittedly, 0 can be considered a non-negative number, and if itreturns 0 on success the code above would fail with OATH_PRINTF_ERRORanyway. So the code may be buggy. Can you make the code look like this: r = fputs (origline, outfh); printf ("fputs rc %d\n", r); if (r <= 0) return OATH_PRINTF_ERROR; and try again and show me what it prints?Looks like you're on the right track: fputs rc 0Great. Please try to revert all your changes and try with a fresh 1.12.1 and change this line: r = fputs (origline, outfh); into r = fprintf (outfh, "%s\n", origline); Does it then pass self-checks, and more importantly, does it work for you? If so I'll have a new release out ASAP.
Test still fails: ========================================== liboath 1.12.1: tests/test-suite.log ========================================== 1 of 8 tests failed. .. contents:: :depth: 2 FAIL: tst_usersfile.sh (exit: 1) ================================ ./tst_usersfile.sh: datefudge: not found Could not fake timestamps with datefudge. oath_authenticate_usersfile[12]: -6 ...but auth works![pam_oath.c:pam_sm_authenticate(301)] authenticate rc 0 (OATH_OK: Successful return) last otp Wed Apr 4 10:13:26 2012
Great job, both with this and with oath-toolkit! Thanks!
[Prev in Thread] | Current Thread | [Next in Thread] |