From 84014d7297096f93bf6dde81cb0f250aa7d402aa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 Jan 2010 15:50:02 -0800 Subject: [PATCH] Fix bug #7036 - net rpc getsid fails in hardened windows environments. Fix suggested by Dave.Daugherty@Centrify.com. --- source/utils/net_rpc.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c index 826b6d9..b73f98f 100644 --- a/source/utils/net_rpc.c +++ b/source/utils/net_rpc.c @@ -587,6 +587,12 @@ static NTSTATUS rpc_getsid_internals(struct net_context *c, int net_rpc_getsid(struct net_context *c, int argc, const char **argv) { + int conn_flags = NET_FLAGS_PDC; + + if (!c->opt_user_specified) { + conn_flags |= NET_FLAGS_ANONYMOUS; + } + if (c->display_usage) { d_printf("Usage:\n" "net rpc getsid\n" @@ -595,7 +601,7 @@ int net_rpc_getsid(struct net_context *c, int argc, const char **argv) } return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, - NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC, + conn_flags, rpc_getsid_internals, argc, argv); } -- 1.5.4.3