projects
/
moonshot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ecf2095
)
merge static credentials file locator from windows branch
author
Luke Howard
<lukeh@padl.com>
Tue, 13 Sep 2011 05:14:27 +0000
(15:14 +1000)
committer
Luke Howard
<lukeh@padl.com>
Tue, 13 Sep 2011 05:14:27 +0000
(15:14 +1000)
moonshot/mech_eap/util_cred.c
patch
|
blob
|
history
diff --git
a/moonshot/mech_eap/util_cred.c
b/moonshot/mech_eap/util_cred.c
index
4c8c8c7
..
0cb8a76
100644
(file)
--- a/
moonshot/mech_eap/util_cred.c
+++ b/
moonshot/mech_eap/util_cred.c
@@
-36,7
+36,9
@@
#include "gssapiP_eap.h"
#include "gssapiP_eap.h"
+#ifndef WIN32
#include <pwd.h>
#include <pwd.h>
+#endif
OM_uint32
gssEapAllocCred(OM_uint32 *minor, gss_cred_id_t *pCred)
OM_uint32
gssEapAllocCred(OM_uint32 *minor, gss_cred_id_t *pCred)
@@
-142,6
+144,21
@@
readStaticIdentityFile(OM_uint32 *minor,
ccacheName = getenv("GSSEAP_IDENTITY");
if (ccacheName == NULL) {
ccacheName = getenv("GSSEAP_IDENTITY");
if (ccacheName == NULL) {
+#ifdef WIN32
+ TCHAR szPath[MAX_PATH];
+
+ if (!SUCCEEDED(SHGetFolderPath(NULL,
+ CSIDL_APPDATA, /* |CSIDL_FLAG_CREATE */
+ NULL, /* User access token */
+ 0,
+ szPath))) {
+ major = GSS_S_CRED_UNAVAIL;
+ *minor = GetLastError();
+ goto cleanup;
+ }
+
+ snprintf(buf, sizeof(buf), "%s/.gss_eap_id", szPath);
+#else
if (getpwuid_r(getuid(), &pwd, pwbuf, sizeof(pwbuf), &pw) != 0 ||
pw == NULL || pw->pw_dir == NULL) {
major = GSS_S_CRED_UNAVAIL;
if (getpwuid_r(getuid(), &pwd, pwbuf, sizeof(pwbuf), &pw) != 0 ||
pw == NULL || pw->pw_dir == NULL) {
major = GSS_S_CRED_UNAVAIL;
@@
-150,6
+167,7
@@
readStaticIdentityFile(OM_uint32 *minor,
}
snprintf(buf, sizeof(buf), "%s/.gss_eap_id", pw->pw_dir);
}
snprintf(buf, sizeof(buf), "%s/.gss_eap_id", pw->pw_dir);
+#endif /* WIN32 */
ccacheName = buf;
}
ccacheName = buf;
}