NetIdMgr Version 1.2.0.1
netidmgr.exe:
- add functionality to implement previously defined "DefaultSticky"
registry based configuration parameter. This value is can be added to
an installer by a transform or pushed by Group Policy. When set, it
controls the default setting of the "sticky" flag for new identities.
nidmgr32.dll:
- fix the version resources: FileVersion, ProductName, and ProductVersion
krb5cred.dll:
- when importing an identity from the MSLSA, if there has never been a
default identity, configure the MSLSA identity to be the default.
ticket: new
component: windows
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19407
dc483132-0cff-0310-8789-
dd5450dbe970
NETIDMGR_VERSION_MAJOR=1\r
NETIDMGR_VERSION_MINOR=2\r
NETIDMGR_VERSION_PATCH=0\r
-NETIDMGR_VERSION_AUX=0\r
+NETIDMGR_VERSION_AUX=1\r
NETIDMGR_RELEASEDESC=\r
\r
# The API version. This number must be incremented each time the API\r
NETIDMGR_VERSION_MAJOR=1\r
NETIDMGR_VERSION_MINOR=2\r
NETIDMGR_VERSION_PATCH=0\r
-NETIDMGR_VERSION_AUX=0\r
+NETIDMGR_VERSION_AUX=1\r
NETIDMGR_RELEASEDESC=\r
\r
# The API version. This number must be incremented each time the API\r
BEGIN\r
VALUE "CompanyName", KH_VERSTR_COMPANY_1033\r
VALUE "FileDescription", "Network Identity Manager API"\r
- VALUE "FileVersion", KH_VERSION_STRING\r
+ VALUE "FileVersion", KH_VERSTR_VERSION_1033\r
VALUE "InternalName", "nidmgr32"\r
VALUE "LegalCopyright", KH_VERSTR_COPYRIGHT_1033\r
VALUE "OriginalFilename", "nidmgr32.dll"\r
- VALUE "ProductName", KH_VERSTR_PRODUCT_1033\r
- VALUE "ProductVersion", KH_VERSTR_VERSION_1033\r
+ VALUE "ProductName", "Network Identity Manager"\r
+ VALUE "ProductVersion", KH_VERSTR_PRODUCT_1033\r
#ifdef KH_VERSTR_COMMENT_1033\r
VALUE "Comments", KH_VERSTR_COMMENT_1033\r
#endif\r
\r
UnicodeStrToAnsi(cidname, sizeof(cidname), idname);\r
\r
- imported = khm_krb5_ms2mit(cidname, FALSE, TRUE);\r
+ imported = khm_krb5_ms2mit(cidname, FALSE, TRUE, NULL);\r
\r
if (imported)\r
goto cleanup;\r
\r
\r
BOOL\r
-khm_krb5_ms2mit(char * match_princ, BOOL match_realm, BOOL save_creds)\r
+khm_krb5_ms2mit(char * match_princ, BOOL match_realm, BOOL save_creds,\r
+ khm_handle * ret_ident)\r
{\r
#ifdef NO_KRB5\r
return(FALSE);\r
/* and mark the identity as having been imported */\r
if (ident) {\r
khm_krb5_set_identity_flags(ident, K5IDFLAG_IMPORTED, K5IDFLAG_IMPORTED);\r
+\r
+ if (ret_ident) {\r
+ *ret_ident = ident;\r
+ kcdb_identity_hold(*ret_ident);\r
+ }\r
}\r
\r
rc = TRUE;\r
+\r
} else {\r
/* Enumerate tickets from cache looking for an initial ticket */\r
if ((code = pkrb5_cc_start_seq_get(kcontext, mslsa_ccache, &cursor))) \r
pkrb5_cc_close(kcontext, mslsa_ccache);\r
if (kcontext)\r
pkrb5_free_context(kcontext);\r
+ if (ident)\r
+ kcdb_identity_release(ident);\r
+\r
return(rc);\r
#endif /* NO_KRB5 */\r
}\r
char * def = 0;\r
\r
pkrb5_init_context(&ctx);\r
+\r
+ if (ctx == 0)\r
+ return NULL;\r
+\r
pkrb5_get_default_realm(ctx,&def);\r
\r
if (def) {\r
BOOL \r
khm_krb5_ms2mit(char * match_princ,\r
BOOL match_realm,\r
- BOOL save_creds);\r
+ BOOL save_creds,\r
+ khm_handle * ret_ident);\r
\r
int\r
khm_krb5_kinit(krb5_context alt_ctx,\r
\r
if (t != K5_LSAIMPORT_NEVER) {\r
krb5_context ctx = NULL;\r
+ khm_handle id_default = NULL;\r
+ khm_handle id_imported = NULL;\r
BOOL imported;\r
\r
- imported = khm_krb5_ms2mit(NULL, (t == K5_LSAIMPORT_MATCH), TRUE);\r
+ imported = khm_krb5_ms2mit(NULL, (t == K5_LSAIMPORT_MATCH), TRUE,\r
+ &id_imported);\r
if (imported) {\r
khm_krb5_list_tickets(&ctx);\r
+\r
if (ctx)\r
pkrb5_free_context(ctx);\r
+\r
+ kcdb_identity_refresh(id_imported);\r
+\r
+ if (KHM_SUCCEEDED(kcdb_identity_get_default(&id_default))) {\r
+ kcdb_identity_release(id_default);\r
+ id_default = NULL;\r
+ } else {\r
+ _reportf(L"There was no default identity. Setting default");\r
+ kcdb_identity_set_default(id_imported);\r
+ }\r
+\r
+ /* and update the LRU */\r
+ k5_update_LRU(id_imported);\r
}\r
+\r
+ if (id_imported)\r
+ kcdb_identity_release(id_imported);\r
}\r
}\r
break;\r
cfg_idents.applied = TRUE;\r
}\r
if (cfg_idents.work.sticky != cfg_idents.saved.sticky) {\r
- khc_write_int32(csp_cw, L"DefaultMonitor",\r
+ khc_write_int32(csp_cw, L"DefaultSticky",\r
!!cfg_idents.work.sticky);\r
cfg_idents.work.sticky = cfg_idents.saved.sticky;\r
cfg_idents.applied = TRUE;\r
khm_size n_idents = 0;\r
khm_size t;\r
khm_int32 rv = KHM_ERROR_SUCCESS;\r
+ khm_handle csp_cw = NULL;\r
+ khm_int32 idflags;\r
+ khm_int32 def_sticky = 0;\r
+ khm_boolean sticky_done = FALSE;\r
+\r
+ if (KHM_SUCCEEDED(khc_open_space(NULL, L"CredWindow", 0, &csp_cw))) {\r
+ khc_read_int32(csp_cw, L"DefaultSticky", &def_sticky);\r
+ khc_close_space(csp_cw);\r
+ csp_cw = NULL;\r
+ }\r
\r
kcdb_identity_refresh_all();\r
\r
khui_menu_insert_action(dest_def, 1000,\r
khm_get_identity_destroy_action(identity),\r
0);\r
+\r
+ idflags = 0;\r
+ kcdb_identity_get_flags(identity, &idflags);\r
+\r
+ if (!(idflags & KCDB_IDENT_FLAG_STICKY) && def_sticky) {\r
+ kcdb_identity_set_flags(identity,\r
+ KCDB_IDENT_FLAG_STICKY,\r
+ KCDB_IDENT_FLAG_STICKY);\r
+ sticky_done = TRUE;\r
+ }\r
}\r
\r
if (idlist)\r
khui_action_unlock();\r
\r
khui_refresh_actions();\r
+\r
+ if (sticky_done) {\r
+ InvalidateRect(khm_hwnd_main_cred, NULL, TRUE);\r
+ }\r
}\r
\r
khm_boolean\r
kmq_subscribe_hwnd(KMSG_KMM, hwnd);\r
mw_restart_refresh_timer(hwnd);\r
\r
+ /* if the plug-ins finished loading before the window was\r
+ created, we would have missed the KMSG_KMM_I_DONE message.\r
+ So we check if the module load is complete and if so, fire\r
+ off KMSG_ACT_BEGIN_CMDLINE. */\r
if (!kmm_load_pending())\r
kmq_post_message(KMSG_ACT, KMSG_ACT_BEGIN_CMDLINE, 0, 0);\r
break;\r
extern ATOM khm_main_window_class;\r
extern HWND khm_hwnd_main;\r
extern HWND khm_hwnd_rebar;\r
+extern HWND khm_hwnd_main_cred;\r
\r
#define KHM_MAIN_WND_NORMAL 0\r
#define KHM_MAIN_WND_MINI 1\r