From: Steve Dickson <SteveD@redhat.com>
To: Jurjen Bokma <j.bokma@rug.nl>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] AD principal configurable
Date: Mon, 18 Aug 2014 12:48:40 -0400 [thread overview]
Message-ID: <53F22E68.5030906@RedHat.com> (raw)
In-Reply-To: <1407421140-16566-1-git-send-email-j.bokma@rug.nl>
On 08/07/2014 10:19 AM, Jurjen Bokma wrote:
> Signed-off-by: Jurjen Bokma <j.bokma@rug.nl>
Committed... Thanks for taking the time to
redo the patch...
steved.
> ---
> utils/gssd/krb5_util.c | 22 ++++++++++++++++------
> 1 file changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
> index 4b57141..8f492a6 100644
> --- a/utils/gssd/krb5_util.c
> +++ b/utils/gssd/krb5_util.c
> @@ -801,6 +801,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
> char *k5err = NULL;
> int tried_all = 0, tried_default = 0;
> krb5_principal princ;
> + const char *notsetstr = "not set";
> + char *adhostoverride;
>
>
> /* Get full target hostname */
> @@ -818,13 +820,21 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
> }
>
> /* Compute the active directory machine name HOST$ */
> - strcpy(myhostad, myhostname);
> - for (i = 0; myhostad[i] != 0; ++i) {
> - if (myhostad[i] == '.') break;
> - myhostad[i] = toupper(myhostad[i]);
> + krb5_appdefault_string(context, "nfs", NULL, "ad_principal_name", notsetstr, &adhostoverride);
> + if (strcmp(adhostoverride, notsetstr) != 0) {
> + printerr (0, "AD host string overridden with \"%s\" from appdefaults\n", adhostoverride);
> + /* No overflow: Windows cannot handle strings longer than 19 chars */
> + strcpy(myhostad, adhostoverride);
> + free(adhostoverride);
> + } else {
> + strcpy(myhostad, myhostname);
> + for (i = 0; myhostad[i] != 0; ++i) {
> + if (myhostad[i] == '.') break;
> + myhostad[i] = toupper(myhostad[i]);
> + }
> + myhostad[i] = '$';
> + myhostad[i+1] = 0;
> }
> - myhostad[i] = '$';
> - myhostad[i+1] = 0;
>
> retval = get_full_hostname(myhostname, myhostname, sizeof(myhostname));
> if (retval) {
>
prev parent reply other threads:[~2014-08-18 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 14:19 [PATCH] AD principal configurable Jurjen Bokma
2014-08-18 16:48 ` Steve Dickson [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=53F22E68.5030906@RedHat.com \
--to=steved@redhat.com \
--cc=j.bokma@rug.nl \
--cc=linux-nfs@vger.kernel.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.