Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 157113

Summary: [PATCH] pam_krb5 does not work properly when your AFS cell has more than 1 file server
Product: Red Hat Enterprise Linux 4 Reporter: wingc
Component: pam_krb5Assignee: Nalin Dahyabhai <nalin>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: mattdm
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-12 18:42:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
pam_krb5: try the entire list of file server IP addresses when looking up the realm name none

Description wingc 2005-05-06 21:57:35 UTC
Description of problem:

pam_krb5 determines the name of the Kerberos realm to use when getting AFS
tokens by looking up the IP addresses of the file servers for '/afs/'.
However, it only passes a buffer large enough to hold a single IP address.

If the AFS cell's root.cell volume is replicated (stored on more than 1 server), 
minikafs_realm_of_cell() will fail.

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

Tested on RHEL4, pam_krb5-2.1.2-1

How reproducible:


Steps to Reproduce:
1. Use an AFS cell that has more than 1 fileserver for /afs/
2. Try to log in using pam_krb5
Actual results:

Errors are returned when trying to get AFS tokens for the default cell. pam_krb5
falls back to using the default Kerberos realm, instead of the actual Kerberos
realm for the particular cell. (It also refuses to use the instance-less
principal afs@REALM.NAME, so if you don't have a principal named
afs/, then it will fail to get any tokens at all)

Expected results:

pam_krb5 should properly determine the name of the Kerberos realm containing the
file servers for '/afs/', even if you have more than 1 file server.

Additional info:

A patch to fix this problem, by passing a buffer large enough to contain the
maximum number of file server IP addresses supported by OpenAFS (13), and trying
to use krb5_get_host_realm() on each of them, is available here:

Comment 1 wingc 2005-05-06 21:57:35 UTC
Created attachment 114105 [details]
pam_krb5: try the entire list of file server IP addresses when looking up the realm name

Comment 2 Nalin Dahyabhai 2010-02-12 18:42:46 UTC
This should be fixed in 2.1.6, though the patch was different.