Bug 91065 - refresh_creds not respected if cache file does not exist
refresh_creds not respected if cache file does not exist
Status: CLOSED CANTFIX
Product: Red Hat Linux
Classification: Retired
Component: pam_krb5 (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-16 20:56 EDT by Jason Wold
Modified: 2007-04-18 12:53 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-02 13:36:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jason Wold 2003-05-16 20:56:43 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030321

Description of problem:
in the file pam_krb5afs.c, safe_create function, I believe the following code is
incorrect.  It conflicts with what the comment directly above it states.

        /* Try to read characteristics of the file. */
        rc = lstat(filename, &ost);
        preexisting = (rc == 0);

        /* If the file exists and is normal, or doesn't exist, then we should
         * try to open it. */
        if (((rc == 0) && S_ISREG(ost.st_mode)) ||
            ((rc == -1) && (errno != ENOENT))) {
                errno = 0;
                fd = open(filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
        } else {
                return -1;
        }

If the file does not exist rc will be -1 and the error will be ENOENT so the
second half of the || will always fail.  I think it should read

 ((rc == -1) && (errno == ENOENT))) {

"if rc = -1 and error is file_does_not_exist"


Version-Release number of selected component (if applicable):
pam_krb5-1.60-1

How reproducible:
Always

Steps to Reproduce:
1. make sure KRB5CCNAME is set
2. set refresh_creds on pam_krb5 line in /etc/pam.d/system-auth
3. kdestroy
4. restart xscreensaver and then lock screen with xscreensaver
5. unlock screen with xscreensaver 
6. klist will still show no valid ticket

Actual Results:  the ticket cache specified by KRB5CCNAME is not refreshed

Expected Results:  the ticket cache should be refreshed

Additional info:

This is a little difficult to document since I have actually ported over some of
the code from Balza's pam_krb5 code but regardless I think the code quoted is
incorrect, in both branches of the code.
Comment 1 Bill Nottingham 2006-08-04 23:41:20 EDT
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.
Comment 3 Bill Nottingham 2007-01-02 13:36:30 EST
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.

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