From: Lukas Hejtmanek <xhejtman@ics.muni.cz>
To: Kevin Coffman <kwc@citi.umich.edu>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
Linux NFSv4 mailing list <nfsv4@linux-nfs.org>
Subject: Re: [Patch] enable preferred realms for ccache searching
Date: Wed, 2 Jul 2008 19:24:09 +0200 [thread overview]
Message-ID: <20080702172409.GU5111@ics.muni.cz> (raw)
In-Reply-To: <4d569c330807021018ka2c6ad6t573caae886fb5307@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
On Wed, Jul 02, 2008 at 01:18:46PM -0400, Kevin Coffman wrote:
> Thanks, but I'm already cleaning it up. I'll re-post for you look at
> before sending up to Steve.
OK, thanks
> > Also, if interested, I have a patch to set the default preferred realm
> > from the kerberos configuration.
>
> I think that would be a nice thing to add to this.
attached.
--
Lukáš Hejtmánek
[-- Attachment #2: gssd-4.patch --]
[-- Type: text/x-diff, Size: 1470 bytes --]
Set default kerberos realm as preferred realm by default.
Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz>
diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
index c7f9bdd..3c8c24b 100644
--- a/utils/gssd/gssd.c
+++ b/utils/gssd/gssd.c
@@ -148,6 +148,9 @@ main(int argc, char *argv[])
}
}
+ if(!preferred_realm)
+ preferred_realm = gssd_k5_get_default_realm();
+
i = 0;
ccachesearch[i++] = strtok(ccachedir, ":");
do {
diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index 4915293..16d155a 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -1234,3 +1234,26 @@ gssd_k5_err_msg(krb5_context context, krb5_error_code code)
return error_message(code);
#endif
}
+
+/*
+ * Routine that returns default kerberos realm
+ */
+
+const char*
+gssd_k5_get_default_realm()
+{
+ krb5_context context;
+ char *realm;
+
+ if(krb5_init_context(&context)) {
+ return NULL;
+ }
+
+ if(krb5_get_default_realm(context, &realm)) {
+ krb5_free_context(context);
+ return NULL;
+ }
+
+ krb5_free_context(context);
+ return realm;
+}
diff --git a/utils/gssd/krb5_util.h b/utils/gssd/krb5_util.h
index addae1c..a4cccac 100644
--- a/utils/gssd/krb5_util.h
+++ b/utils/gssd/krb5_util.h
@@ -17,6 +17,7 @@ struct gssd_k5_kt_princ {
};
+const char* gssd_k5_get_default_realm(void);
int gssd_setup_krb5_user_gss_ccache(uid_t uid, char *servername,
char *dirname);
int gssd_get_krb5_machine_cred_list(char ***list);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
NFSv4 mailing list
NFSv4@linux-nfs.org
http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4
prev parent reply other threads:[~2008-07-02 17:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 15:35 [Patch] enable preferred realms for ccache searching Lukas Hejtmanek
2008-07-02 15:53 ` Kevin Coffman
[not found] ` <4d569c330807020853m37a834ex5ba191faf85b0f97-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-02 16:09 ` Lukas Hejtmanek
2008-07-02 17:18 ` Kevin Coffman
2008-07-02 17:24 ` Lukas Hejtmanek [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=20080702172409.GU5111@ics.muni.cz \
--to=xhejtman@ics.muni.cz \
--cc=kwc@citi.umich.edu \
--cc=linux-nfs@vger.kernel.org \
--cc=nfsv4@linux-nfs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox