Correctly unbecome_root() on error
authorVolker Lendecke <vl@samba.org>
Mon, 10 Dec 2007 10:47:17 +0000 (11:47 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 10 Dec 2007 11:37:37 +0000 (12:37 +0100)
(This used to be commit aec5f1512660953168a2c55b2890cd6c076b8a92)

source3/auth/token_util.c

index bc6bea5d29cfb5162cbb1126c3b232d82bbec3b0..63672bcf743fffae5fe622fcaca263bc40bf86fe 100644 (file)
@@ -395,6 +395,7 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
                status = add_aliases(get_global_sam_sid(), result);
 
                if (!NT_STATUS_IS_OK(status)) {
+                       unbecome_root();
                        TALLOC_FREE(result);
                        return NULL;
                }
@@ -404,6 +405,7 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
                status = add_aliases(&global_sid_Builtin, result);
 
                if (!NT_STATUS_IS_OK(status)) {
+                       unbecome_root();
                        TALLOC_FREE(result);
                        return NULL;
                }