Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Aug 2023 16:08:53 GMT
From:      =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: acc7cf8641dc - main - pam_krb5: Clarify a loop condition.
Message-ID:  <202308041608.374G8rfc093961@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=acc7cf8641dcedad295ff0e569c3f3a28939ada0

commit acc7cf8641dcedad295ff0e569c3f3a28939ada0
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-08-04 16:08:21 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-08-04 16:08:37 +0000

    pam_krb5: Clarify a loop condition.
    
    The closing parenthesis was in the wrong location, so instead of assigning the return value to krbret and then comparing it to zero, we were assigning the result of the comparison to krbret and then comparing that to zero.  This has no practical significance since the value is not used after the loop terminates.
    
    PR:             229719
    Reviewed by:    cy
    Differential Revision:  https://reviews.freebsd.org/D41299
---
 lib/libpam/modules/pam_krb5/pam_krb5.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/libpam/modules/pam_krb5/pam_krb5.c b/lib/libpam/modules/pam_krb5/pam_krb5.c
index 3c7976297ed2..378de46d769f 100644
--- a/lib/libpam/modules/pam_krb5/pam_krb5.c
+++ b/lib/libpam/modules/pam_krb5/pam_krb5.c
@@ -576,8 +576,7 @@ pam_sm_setcred(pam_handle_t *pamh, int flags,
 	PAM_LOG("Prepared for iteration");
 
 	/* Copy the creds (should be two of them) */
-	while ((krbret = krb5_cc_next_cred(pam_context, ccache_temp,
-				&cursor, &creds) == 0)) {
+	while (krb5_cc_next_cred(pam_context, ccache_temp, &cursor, &creds) == 0) {
 		krbret = krb5_cc_store_cred(pam_context, ccache_perm, &creds);
 		if (krbret != 0) {
 			PAM_LOG_KRB5_ERR(pam_context, krbret,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308041608.374G8rfc093961>