diff options
Diffstat (limited to 'source/lsarpcd/srv_lsa_samdb.c')
-rw-r--r-- | source/lsarpcd/srv_lsa_samdb.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/source/lsarpcd/srv_lsa_samdb.c b/source/lsarpcd/srv_lsa_samdb.c index 99e569dc7da..738f66cbfab 100644 --- a/source/lsarpcd/srv_lsa_samdb.c +++ b/source/lsarpcd/srv_lsa_samdb.c @@ -81,7 +81,7 @@ static void secnamefree(void*inf) /**************************************************************************** set tdb secret name ****************************************************************************/ -BOOL set_tdbsecname(struct policy_cache *cache, POLICY_HND *hnd, +static BOOL set_tdbsecname(struct policy_cache *cache, POLICY_HND *hnd, TDB_CONTEXT *tdb, const UNISTR2 *name) { @@ -111,7 +111,7 @@ BOOL set_tdbsecname(struct policy_cache *cache, POLICY_HND *hnd, /**************************************************************************** get tdb secret name ****************************************************************************/ -BOOL get_tdbsecname(struct policy_cache *cache, const POLICY_HND *hnd, +static BOOL get_tdbsecname(struct policy_cache *cache, const POLICY_HND *hnd, TDB_CONTEXT **tdb, UNISTR2 *name) { @@ -152,6 +152,9 @@ uint32 _lsa_open_policy2(const UNISTR2 *server_name, POLICY_HND *hnd, return NT_STATUS_ACCESS_DENIED; } + policy_hnd_set_name(get_global_hnd_cache(), + hnd, "open_policy2"); + return NT_STATUS_NOPROBLEMO; } @@ -159,8 +162,8 @@ uint32 _lsa_open_policy2(const UNISTR2 *server_name, POLICY_HND *hnd, lsa_reply_open_policy ***************************************************************************/ uint32 _lsa_open_policy(const UNISTR2 *server_name, POLICY_HND *hnd, - const LSA_OBJ_ATTR *attr, - uint32 des_access) + const LSA_OBJ_ATTR *attr, + uint32 des_access) { if (hnd == NULL) { @@ -174,6 +177,9 @@ uint32 _lsa_open_policy(const UNISTR2 *server_name, POLICY_HND *hnd, return NT_STATUS_ACCESS_DENIED; } + policy_hnd_set_name(get_global_hnd_cache(), + hnd, "open_policy"); + return NT_STATUS_NOPROBLEMO; } @@ -663,6 +669,7 @@ uint32 _lsa_create_secret(const POLICY_HND *hnd, if (tdb_lookup_secret(tdb, secret_name, NULL)) { DEBUG(10,("_lsa_create_secret: secret exists\n")); + /* XXX - shouldn't tdb be closed here? (Elrond) */ return NT_STATUS_ACCESS_DENIED; } @@ -674,6 +681,9 @@ uint32 _lsa_create_secret(const POLICY_HND *hnd, return NT_STATUS_ACCESS_DENIED; } + policy_hnd_set_name(get_global_hnd_cache(), + hnd_secret, "secret (create)"); + if (!set_tdbsecname(get_global_hnd_cache(), hnd_secret, tdb, secret_name)) { close_policy_hnd(get_global_hnd_cache(), hnd_secret); @@ -714,6 +724,7 @@ uint32 _lsa_open_secret(const POLICY_HND *hnd, if (!tdb_lookup_secret(tdb, secret_name, NULL)) { + /* XXX - shouldn't tdb be closed here? (Elrond) */ return NT_STATUS_OBJECT_NAME_NOT_FOUND; } @@ -725,6 +736,9 @@ uint32 _lsa_open_secret(const POLICY_HND *hnd, return NT_STATUS_ACCESS_DENIED; } + policy_hnd_set_name(get_global_hnd_cache(), + hnd_secret, "secret (open)"); + if (!set_tdbsecname(get_global_hnd_cache(), hnd_secret, tdb, secret_name)) { close_policy_hnd(get_global_hnd_cache(), hnd_secret); |