Kerberos PAC verification fails (patch included)

Matthieu Patou mat at samba.org
Sat Jun 18 06:11:21 MDT 2011


On 18/06/2011 13:13, Marcel Ritter wrote:
> Hi,
>
> I'm trying to use Samba 4 as KDC for NFS authentication.
>
> After solving some general problems concerning nfs-utils, I
> was able to mount the filesystem (using nfs4 and sec=krb5),
> however file access was denied for users (with valid ticket).
>
> When attempting to access files Samba4 reported:
>
> [2011/06/18 10:06:54,  3] ../source4/auth/kerberos/krb5_init_context.c:69(smb_krb5_debug_wrapper)
>    Kerberos: Verify PAC failed for nfs/test2.mydomain.de at MYDOMAIN.DE (user1 at MYDOMAIN.DE) from ipv4:192.168.1.199:57245 with<unknown error: 22>
>
> Digging the source code showed:
>
> Function check_PAC (source4/heimdal/kdc/krb5tgs.c) returns EINVAL:
>    _kdc_pac_verify() = 22 (EINVAL)
>
> Looks like checking an unneeded PAC results in an error instead
> of just being skipped:
>
> _kdc_pac_verify (source4/heimdal/kdc/windc.c) calls samba_wdc_reget_pac (source4/kdc/wdc-samba4.c):
>
>          <...>
>          /* The user account may be set not to want the PAC */
>          if (!samba_princ_needs_pac(server)) {
>                  talloc_free(mem_ctx);
>                  return EINVAL;
>          }
>          <...>
Well this part of the code isn't wrong it's more the handling of 
_kdc_pac_verify that is a problem

Can you extract the userAccountControl field for this particular user (I 
guess it"s the account associated with your NFS server) ? for instance 
like this:

  ./bin/ldbsearch -H <path_to_samba_provision>/private/sam.ldb 
'(cn=<myuser>)' userAccountControl

You should get something like:
# record 1
dn: CN=Administrator,CN=Users,DC=home,DC=matws,DC=net
userAccountControl: 640

Also I suggest to try to remove the bit that says that this account 
didn't need AUTH_DATA, this flag has the value  0x2000000 (33554432).

Matthieu

>
>
> My trivial patch just returns "0" instead of "EINVAL" - and suddenly
> file access is granted as expected.
>
> There may be better places to fix this, however I hope the patch
> helps to diagnose and fix the issue.
>
> Bye,
>     Marcel


-- 
Matthieu Patou
Samba Team        http://samba.org
Private repo      http://git.samba.org/?p=mat/samba.git;a=summary




More information about the samba-technical mailing list