Use ntlm_name.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22378 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-12-28 18:48:02 +00:00
parent 25cd521c04
commit 2504ac11ca

View File

@@ -73,13 +73,13 @@ from_file(const char *fn, const char *domain,
} }
static int static int
get_user_file(const char *domain, char **username, struct ntlm_buf *key) get_user_file(const ntlm_name *name, char **username, struct ntlm_buf *key)
{ {
const char *fn = NULL; const char *fn = NULL;
if (!issuid()) { if (!issuid()) {
fn = getenv("NTLM_USER_FILE"); fn = getenv("NTLM_USER_FILE");
if (fn != NULL && from_file(fn, domain, username, key) == 0) if (fn != NULL && from_file(fn, name->domain, username, key) == 0)
return 0; return 0;
} }
return ENOENT; return ENOENT;
@@ -90,7 +90,7 @@ get_user_file(const char *domain, char **username, struct ntlm_buf *key)
*/ */
static int static int
get_user_ccache(const char *domain, char **username, struct ntlm_buf *key) get_user_ccache(const ntlm_name *name, char **username, struct ntlm_buf *key)
{ {
krb5_principal client; krb5_principal client;
krb5_context context = NULL; krb5_context context = NULL;
@@ -125,7 +125,7 @@ get_user_ccache(const char *domain, char **username, struct ntlm_buf *key)
ret = krb5_make_principal(context, &mcreds.server, ret = krb5_make_principal(context, &mcreds.server,
krb5_principal_get_realm(context, client), krb5_principal_get_realm(context, client),
"@ntlm-key", domain, NULL); "@ntlm-key", name->domain, NULL);
krb5_free_principal(context, client); krb5_free_principal(context, client);
if (ret) if (ret)
goto out; goto out;
@@ -166,7 +166,7 @@ out:
} }
int int
_gss_ntlm_get_user_cred(const char *domain, _gss_ntlm_get_user_cred(const ntlm_name *name,
ntlm_cred *rcred) ntlm_cred *rcred)
{ {
ntlm_cred cred; ntlm_cred cred;
@@ -176,9 +176,9 @@ _gss_ntlm_get_user_cred(const char *domain,
if (cred == NULL) if (cred == NULL)
return ENOMEM; return ENOMEM;
ret = get_user_file(domain, &cred->username, &cred->key); ret = get_user_file(name, &cred->username, &cred->key);
if (ret) if (ret)
ret = get_user_ccache(domain, &cred->username, &cred->key); ret = get_user_ccache(name, &cred->username, &cred->key);
if (ret) { if (ret) {
free(cred); free(cred);
return ret; return ret;