RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1087350 - [gssd] code defects in gssd_search_krb5_keytab() can not return right return code.
Summary: [gssd] code defects in gssd_search_krb5_keytab() can not return right return ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On:
Blocks: 1249046
TreeView+ depends on / blocked
 
Reported: 2014-04-14 09:07 UTC by JianHong Yin
Modified: 2015-11-19 04:28 UTC (History)
3 users (show)

Fixed In Version: nfs-utils-1.3.0-0.17.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1249046 (view as bug list)
Environment:
Last Closed: 2015-11-19 04:28:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2196 0 normal SHIPPED_LIVE nfs-utils bug fix update 2015-11-19 08:05:04 UTC

Description JianHong Yin 2014-04-14 09:07:53 UTC
Description of problem:
code defects in gssd_search_krb5_keytab(),
when get_ple_by_princ return NULL, can not return the right return code.
                if (status) {
                        printerr(4, "We WILL use this entry (%s)\n", pname);
                        ple = get_ple_by_princ(context, kte->principal);
                        /*
                         * Return, don't free, keytab entry if
                         * we were successful!
                         */
                        if (ple == NULL) {
                                retval = ENOMEM;
                                k5_free_kt_entry(context, kte);
                        } else {
                                retval = 0;
                                *found = 1;
                        }
                        k5_free_unparsed_name(context, pname);
                        break;
                }
                else {
                        printerr(4, "We will NOT use this entry (%s)\n",
                                pname);
                }
                k5_free_unparsed_name(context, pname);
                k5_free_kt_entry(context, kte);
        }

        if ((code = krb5_kt_end_seq_get(context, kt, &cursor))) {
                k5err = gssd_k5_err_msg(context, code);
                printerr(0, "WARNING: %s while ending keytab scan for "
                            "keytab '%s'\n", k5err, kt_name);
        }

        retval = 0;
        ^^^ cover the  'if (ple == NULL) { retval = ENOMEM;'
  out:
        free(k5err);
        return retval;

Version-Release number of selected component (if applicable):
nfs-utils-1.3.0

How reproducible:
1

Steps to Reproduce:
1. code review.
2.
3.

Actual results:
when ENOMEM fail happen, the function can not return right code to caller.

Expected results:
fix this.

Additional info:

Comment 4 Steve Dickson 2015-07-30 21:16:54 UTC
The upstream commit:

commit e38711f02f5d51eb051937f06373f018d3def386
Author: Steve Dickson <steved>
Date:   Thu Jul 30 17:06:39 2015 -0400

    rpc.gssd: Only clear the retval if it has not been set

Comment 7 Yongcheng Yang 2015-08-03 01:00:39 UTC
Verified with nfs-utils-1.3.0-0.17.el7.src.rpm

[yyc@dhcp-12-138 nfs-utils-1.3.0]$ cat utils/gssd/krb5_util.c | grep -A3 -B2 "Only clear the retval if has not been set"
	}

	/* Only clear the retval if has not been set */
	if (retval < 0)
		retval = 0;
  out:
[yyc@dhcp-12-138 nfs-utils-1.3.0]$ 

Move to VERIFIED

Comment 8 errata-xmlrpc 2015-11-19 04:28:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2196.html


Note You need to log in before you can comment on or make changes to this bug.