mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
rpcclient: domain_sid is only needed for SAMR
This allows using rpcclient commands with servers that don't implement LSA QueryInfoPolicy. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
4162ba78f8
commit
2cb978b649
@ -36,6 +36,7 @@
|
|||||||
#include "../libcli/smb/smbXcli_base.h"
|
#include "../libcli/smb/smbXcli_base.h"
|
||||||
#include "messages.h"
|
#include "messages.h"
|
||||||
#include "cmdline_contexts.h"
|
#include "cmdline_contexts.h"
|
||||||
|
#include "../librpc/gen_ndr/ndr_samr.h"
|
||||||
|
|
||||||
enum pipe_auth_type_spnego {
|
enum pipe_auth_type_spnego {
|
||||||
PIPE_AUTH_TYPE_SPNEGO_NONE = 0,
|
PIPE_AUTH_TYPE_SPNEGO_NONE = 0,
|
||||||
@ -219,11 +220,7 @@ static void fetch_machine_sid(struct cli_state *cli)
|
|||||||
|
|
||||||
fprintf(stderr, "could not obtain sid from server\n");
|
fprintf(stderr, "could not obtain sid from server\n");
|
||||||
|
|
||||||
if (!NT_STATUS_IS_OK(result)) {
|
return;
|
||||||
fprintf(stderr, "error: %s\n", nt_errstr(result));
|
|
||||||
}
|
|
||||||
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List the available commands on a given pipe */
|
/* List the available commands on a given pipe */
|
||||||
@ -859,6 +856,12 @@ static NTSTATUS do_cmd(struct cli_state *cli,
|
|||||||
|
|
||||||
TALLOC_CTX *mem_ctx;
|
TALLOC_CTX *mem_ctx;
|
||||||
|
|
||||||
|
if (cmd_entry->table == &ndr_table_samr &&
|
||||||
|
!dom_sid_is_valid_account_domain(&domain_sid))
|
||||||
|
{
|
||||||
|
return NT_STATUS_INVALID_DOMAIN_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create mem_ctx */
|
/* Create mem_ctx */
|
||||||
|
|
||||||
if (!(mem_ctx = talloc_stackframe())) {
|
if (!(mem_ctx = talloc_stackframe())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user