summaryrefslogtreecommitdiffstats
path: root/source4/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-02-18 09:49:13 +0100
committerVolker Lendecke <vl@samba.org>2014-02-18 10:28:41 +0100
commit279ee162541cdba725eeffa7fce72a5db48805ec (patch)
tree2f2dd8039da880855fd9bc39e641bc7cede1d47e /source4/libcli
parent699f86cc27d6eb26ce93a4701c0ee6c788c80a5c (diff)
downloadsamba-279ee162541cdba725eeffa7fce72a5db48805ec.tar.gz
samba-279ee162541cdba725eeffa7fce72a5db48805ec.tar.xz
samba-279ee162541cdba725eeffa7fce72a5db48805ec.zip
Revert "auth4: Remove unused wbc_context"
This reverts commit 6b04558c5e0547a807ac0fcb5eeb1085cfe602ac. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/wbclient/wbclient.c29
-rw-r--r--source4/libcli/wbclient/wbclient.h13
2 files changed, 41 insertions, 1 deletions
diff --git a/source4/libcli/wbclient/wbclient.c b/source4/libcli/wbclient/wbclient.c
index 165333a6b58..3f8003bbbaf 100644
--- a/source4/libcli/wbclient/wbclient.c
+++ b/source4/libcli/wbclient/wbclient.c
@@ -28,6 +28,35 @@
#include "libcli/util/error.h"
#include "libcli/security/dom_sid.h"
+/**
+ * Initialize the wbclient context, talloc_free() when done.
+ *
+ * \param mem_ctx talloc context to allocate memory from
+ * \param msg_ctx message context to use
+ * \param
+ */
+struct wbc_context *wbc_init(TALLOC_CTX *mem_ctx,
+ struct imessaging_context *msg_ctx,
+ struct tevent_context *event_ctx)
+{
+ struct wbc_context *ctx;
+
+ ctx = talloc(mem_ctx, struct wbc_context);
+ if (ctx == NULL) return NULL;
+
+ ctx->event_ctx = event_ctx;
+
+ ctx->irpc_handle = irpc_binding_handle_by_name(ctx, msg_ctx,
+ "winbind_server",
+ &ndr_table_winbind);
+ if (ctx->irpc_handle == NULL) {
+ talloc_free(ctx);
+ return NULL;
+ }
+
+ return ctx;
+}
+
static int wb_simple_trans(struct tevent_context *ev, int fd,
struct winbindd_request *wb_req,
TALLOC_CTX *mem_ctx,
diff --git a/source4/libcli/wbclient/wbclient.h b/source4/libcli/wbclient/wbclient.h
index fc096cc7c76..ba15a7c06df 100644
--- a/source4/libcli/wbclient/wbclient.h
+++ b/source4/libcli/wbclient/wbclient.h
@@ -18,7 +18,18 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "librpc/gen_ndr/idmap.h"
+#include "lib/messaging/irpc.h"
+#include "libcli/composite/composite.h"
+#include "librpc/gen_ndr/ndr_winbind_c.h"
+
+struct wbc_context {
+ struct tevent_context *event_ctx;
+ struct dcerpc_binding_handle *irpc_handle;
+};
+
+struct wbc_context *wbc_init(TALLOC_CTX *mem_ctx,
+ struct imessaging_context *msg_ctx,
+ struct tevent_context *event_ctx);
NTSTATUS wbc_sids_to_xids(struct tevent_context *ev, struct id_map *ids,
uint32_t count);