s3/net: Display error message if user does not exist.
authorKarolin Seeger <kseeger@samba.org>
Fri, 9 Jan 2009 15:52:12 +0000 (16:52 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 9 Jan 2009 16:00:22 +0000 (17:00 +0100)
net rpc rights grant: Verify if the username can be resolved to a SID and
display a proper error message if it does not. Otherwise users might think
setting privileges worked fine, but in fact it does not.

Karolin

source3/utils/net_rpc_rights.c

index 2bc5efe3cf6066a53c9d2d7c3a92ce092db4e319..ddcfff3685f517f586b06f19c44be919de86c2df 100644 (file)
@@ -449,8 +449,11 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c,
        }
 
        result = name_to_sid(pipe_hnd, mem_ctx, &sid, argv[0]);
+       if (NT_STATUS_EQUAL(result, NT_STATUS_NONE_MAPPED))
+               result = NT_STATUS_NO_SUCH_USER;
+
        if (!NT_STATUS_IS_OK(result))
-               return result;
+               goto done;
 
        result = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, true,
                                     SEC_RIGHTS_MAXIMUM_ALLOWED,