s3-samr: Fix SetUserInfo level 7 when there has been no name change.
authorGünther Deschner <gd@samba.org>
Fri, 8 May 2009 22:02:00 +0000 (00:02 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 8 May 2009 22:02:00 +0000 (00:02 +0200)
Found by torture test.

Guenther

source3/rpc_server/srv_samr_nt.c

index 0d87ad84ae71ca6cfc49f587dabdabf4d455b768..17e111d4eac88391980b46feebbc988f1e66e6ac 100644 (file)
@@ -4013,6 +4013,12 @@ static NTSTATUS set_user_info_7(TALLOC_CTX *mem_ctx,
           code (like UNSUCCESSFUL instead of ALREADY_EXISTS). */
 
        rc = can_create(mem_ctx, id7->account_name.string);
           code (like UNSUCCESSFUL instead of ALREADY_EXISTS). */
 
        rc = can_create(mem_ctx, id7->account_name.string);
+
+       /* when there is nothing to change, we're done here */
+       if (NT_STATUS_EQUAL(rc, NT_STATUS_USER_EXISTS) &&
+           strequal(id7->account_name.string, pdb_get_username(pwd))) {
+               return NT_STATUS_OK;
+       }
        if (!NT_STATUS_IS_OK(rc)) {
                return rc;
        }
        if (!NT_STATUS_IS_OK(rc)) {
                return rc;
        }