From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
klepikho-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [cifs-utils PATCH] cifs: use krb5_kt_default() to determine default keytab location
Date: Mon, 7 Apr 2014 14:37:51 -0400 [thread overview]
Message-ID: <20140407143751.51c7fc8a@tlielax.poochiereds.net> (raw)
In-Reply-To: <1396488119-7796-1-git-send-email-jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
On Wed, 2 Apr 2014 21:21:59 -0400
Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote:
> ...don't assume that it's in /etc/krb5.keytab.
>
> Reported-by: Konstantin Lepikhov <klepikho-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
> ---
> cifs.upcall.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/cifs.upcall.c b/cifs.upcall.c
> index cc65824d3689..e8544c2b68ad 100644
> --- a/cifs.upcall.c
> +++ b/cifs.upcall.c
> @@ -55,7 +55,6 @@
> #define CIFS_DEFAULT_KRB5_DIR "/tmp"
> #define CIFS_DEFAULT_KRB5_USER_DIR "/run/user/%U"
> #define CIFS_DEFAULT_KRB5_PREFIX "krb5cc"
> -#define CIFS_DEFAULT_KRB5_KEYTAB "/etc/krb5.keytab"
>
> #define MAX_CCNAME_LEN PATH_MAX + 5
>
> @@ -205,9 +204,15 @@ init_cc_from_keytab(const char *keytab_name, const char *user)
> goto icfk_cleanup;
> }
>
> - ret = krb5_kt_resolve(context, keytab_name, &keytab);
> + if (keytab_name)
> + ret = krb5_kt_resolve(context, keytab_name, &keytab);
> + else
> + ret = krb5_kt_default(context, &keytab);
> +
> if (ret) {
> - syslog(LOG_DEBUG, "krb5_kt_resolve: %d", (int)ret);
> + syslog(LOG_DEBUG, "%s: %d",
> + keytab_name ? "krb5_kt_resolve" : "krb5_kt_default",
> + (int)ret);
> goto icfk_cleanup;
> }
>
> @@ -841,7 +846,7 @@ int main(const int argc, char *const argv[])
> struct decoded_args arg;
> const char *oid;
> uid_t uid;
> - char *keytab_name = CIFS_DEFAULT_KRB5_KEYTAB;
> + char *keytab_name = NULL;
> time_t best_time = 0;
>
> hostbuf[0] = '\0';
Merged...
--
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
prev parent reply other threads:[~2014-04-07 18:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-03 1:21 [cifs-utils PATCH] cifs: use krb5_kt_default() to determine default keytab location Jeff Layton
[not found] ` <1396488119-7796-1-git-send-email-jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2014-04-07 18:37 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140407143751.51c7fc8a@tlielax.poochiereds.net \
--to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
--cc=klepikho-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.