cmd_lsa_lookup_sids: Check return code from string_to_sid; skip SIDs
authorMartin Pool <mbp@samba.org>
Tue, 18 Feb 2003 01:35:19 +0000 (01:35 +0000)
committerMartin Pool <mbp@samba.org>
Tue, 18 Feb 2003 01:35:19 +0000 (01:35 +0000)
which are not valid.
(This used to be commit bfb6104521bd75da71a09a6c56bd44560416116e)

source3/rpcclient/cmd_lsarpc.c

index 91107a7c6d1fbca4a677517fe9cc92daf201632a..03df170c096cf24c65069ddccf45bba06ed86e1c 100644 (file)
@@ -210,8 +210,11 @@ static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       for (i = 0; i < argc - 1; i++)
-               string_to_sid(&sids[i], argv[i + 1]);
+       for (i = 0; i < argc - 1; i++) 
+               if (!string_to_sid(&sids[i], argv[i + 1])) {
+                       result = NT_STATUS_INVALID_SID;
+                       goto done;
+               }
 
        /* Lookup the SIDs */