[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix krb5_get_renewed_creds



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Love,

thanks for heimdal 1.0! A great job, indeed.

The new MIT-like krb5_get_renewed_creds() seems to return a corrupt
pointer and cause samba3's smb_krb5_renew_ticket() to crash. Can you
have a look at the attached patch?

Thanks,
Guenther

- --
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner@redhat.com
Samba Team                              gd@samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGn02wSOk3aI7hFogRAlGkAKCHehIQeM2KaRwQCsXSOyjrB7hr8wCgkpp4
IMMw+rDhgOZoatj45T/4wVk=
=+ASD
-----END PGP SIGNATURE-----
Index: lib/krb5/get_cred.c
===================================================================
--- lib/krb5/get_cred.c	(revision 21653)
+++ lib/krb5/get_cred.c	(working copy)
@@ -1224,7 +1224,7 @@ krb5_get_renewed_creds(krb5_context cont
 {
     krb5_error_code ret;
     krb5_kdc_flags flags;
-    krb5_creds in, *template;
+    krb5_creds in, *template, *out = NULL;
 
     memset(&in, 0, sizeof(in));
 
@@ -1263,9 +1263,14 @@ krb5_get_renewed_creds(krb5_context cont
 	krb5_free_creds (context, template);
     }
 
-    ret = krb5_get_kdc_cred(context, ccache, flags, NULL, NULL, &in, &creds);
+    ret = krb5_get_kdc_cred(context, ccache, flags, NULL, NULL, &in, &out);
     krb5_free_principal(context, in.client);
     krb5_free_principal(context, in.server);
+    if (ret) {
+        return ret;
+    }
+    ret = krb5_copy_creds_contents(context, out, creds);
+    krb5_free_creds(context, out);
 
     return ret;
 }