Bug 161854 - [kerberos] [patch] _gsskrb5_pname_to_uid lname lookup fails, breaks nfs/kerberos
Summary: [kerberos] [patch] _gsskrb5_pname_to_uid lname lookup fails, breaks nfs/kerberos
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-10-21 05:00 UTC by hcoin
Modified: 2022-10-17 12:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hcoin 2011-10-21 05:00:19 UTC
Notice in

http://svnweb.freebsd.org/base/head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c?revision=181344&view=markup

..
OM_uint32
34 	_gsskrb5_pname_to_uid(OM_uint32 *minor_status, const gss_name_t pname,
35 	const gss_OID mech, uid_t *uidp)
36 	{
37 	krb5_context context;
38 	krb5_const_principal name = (krb5_const_principal) pname;
39 	krb5_error_code kret;
40 	char lname[MAXLOGNAME + 1], buf[128];
41 	struct passwd pwd, *pw;


52     getpwnam_r(lname, &pwd, buf, sizeof(buf), &pw);

128 is too small.  Any non-trivial use of kerberos via nfs fails to record the correct user names.

Fix: 

-40 	char lname[MAXLOGNAME + 1], buf[128];
+40 	char lname[MAXLOGNAME + 1], buf[1204];
How-To-Repeat: Put some debug writes in there, you'll notice when kerberos is being used
no user names authenticate.  kerberos on nfs is essentially broken if the
total length of the strings in the passwd structure exceed 128 bytes.
Given the password itself can be 128 characters, much less the gecos, dir,
shell, etc. etc....
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:08 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:34:01 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>