[PATCH] Small code cleanup in credentials code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Small code cleanup in credentials code

Samba - samba-technical mailing list
Hi,

attached is a code cleanup for the credentials code.

Please review and push if OK.


Thanks,


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

credentials-simplify-cli_credentials_get_server_code.patch1.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Small code cleanup in credentials code

Samba - samba-technical mailing list
On ke, 03 tammi 2018, Andreas Schneider via samba-technical wrote:

> Hi,
>
> attached is a code cleanup for the credentials code.
>
> Please review and push if OK.
>
>
> Thanks,
>
>
> Andreas
>
> --
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             [hidden email]
> www.samba.org

> From 1a7411a12a482fc3dc6cd99739b131056014f855 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <[hidden email]>
> Date: Tue, 13 Dec 2016 11:38:13 +0100
> Subject: [PATCH] credentials: Simplify cli_credentials_get_server_gss_creds()
>
> Signed-off-by: Andreas Schneider <[hidden email]>
> ---
>  auth/credentials/credentials_krb5.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c
> index b88497dcace..95bb77d8490 100644
> --- a/auth/credentials/credentials_krb5.c
> +++ b/auth/credentials/credentials_krb5.c
> @@ -1151,16 +1151,14 @@ _PUBLIC_ int cli_credentials_get_server_gss_creds(struct cli_credentials *cred,
>   }
>  
>   if (ktc->password_based || obtained < CRED_SPECIFIED) {
> - /* This creates a GSSAPI cred_id_t for match-by-key with only the keytab set */
> - maj_stat = smb_gss_krb5_import_cred(&min_stat, smb_krb5_context->krb5_context,
> -    NULL, NULL, ktc->keytab,
> -    &gcc->creds);
> - } else {
> - /* This creates a GSSAPI cred_id_t with the principal and keytab set, matching by name */
> - maj_stat = smb_gss_krb5_import_cred(&min_stat, smb_krb5_context->krb5_context,
> -    NULL, princ, ktc->keytab,
> -    &gcc->creds);
> + /*
> + * This creates a GSSAPI cred_id_t for match-by-key with only
> + * the keytab set
> + */
> + princ = NULL;
>   }
> + maj_stat = gss_krb5_import_cred(&min_stat, NULL, princ, ktc->keytab,
We prefer smb_gss_krb5_import_cred() because it would be using
internally gss_acquire_cred_from() on newer MIT versions which is
supporting GSSPROXY.

--
/ Alexander Bokovoy

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Small code cleanup in credentials code

Samba - samba-technical mailing list
On Wednesday, 3 January 2018 09:27:28 CET Alexander Bokovoy wrote:
> > + maj_stat = gss_krb5_import_cred(&min_stat, NULL, princ, ktc->keytab,
>
> We prefer smb_gss_krb5_import_cred() because it would be using
> internally gss_acquire_cred_from() on newer MIT versions which is
> supporting GSSPROXY.

Ups, missed that. Thanks!

Updated patch attached.

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

credentials-simplify-cli_credentials_get_server_code.patch2.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Small code cleanup in credentials code

Samba - samba-technical mailing list
On Wed, Jan 03, 2018 at 09:37:16AM +0100, Andreas Schneider via samba-technical wrote:

> On Wednesday, 3 January 2018 09:27:28 CET Alexander Bokovoy wrote:
> > > + maj_stat = gss_krb5_import_cred(&min_stat, NULL, princ, ktc->keytab,
> >
> > We prefer smb_gss_krb5_import_cred() because it would be using
> > internally gss_acquire_cred_from() on newer MIT versions which is
> > supporting GSSPROXY.
>
> Ups, missed that. Thanks!
>
> Updated patch attached.

Pushed, thanks.

Volker

--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:[hidden email]