From 0d8985f2da43d35d8f940af112ad74a199778dd8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Feb 2008 12:30:18 +0100 Subject: Let dsgetdcname() return a struct netr_DsRGetDCNameInfo. Guenther (This used to be commit b1a4b21f8c35dc23e5c986ebe44d3806055eb39b) --- source3/lib/netapi/joindomain.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 55f334b5e1..405f96a87e 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -48,7 +48,7 @@ static WERROR NetJoinDomainLocal(struct libnetapi_ctx *mem_ctx, if (join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) { NTSTATUS status; - struct DS_DOMAIN_CONTROLLER_INFO *info = NULL; + struct netr_DsRGetDCNameInfo *info = NULL; uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED | DS_WRITABLE_REQUIRED | DS_RETURN_DNS_NAME; @@ -60,7 +60,7 @@ static WERROR NetJoinDomainLocal(struct libnetapi_ctx *mem_ctx, return ntstatus_to_werror(status); } r->in.dc_name = talloc_strdup(mem_ctx, - info->domain_controller_name); + info->dc_unc); W_ERROR_HAVE_NO_MEMORY(r->in.dc_name); } @@ -252,7 +252,7 @@ static WERROR NetUnjoinDomainLocal(struct libnetapi_ctx *mem_ctx, } else { NTSTATUS status; const char *domain = NULL; - struct DS_DOMAIN_CONTROLLER_INFO *info = NULL; + struct netr_DsRGetDCNameInfo *info = NULL; uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED | DS_WRITABLE_REQUIRED | DS_RETURN_DNS_NAME; @@ -269,7 +269,7 @@ static WERROR NetUnjoinDomainLocal(struct libnetapi_ctx *mem_ctx, return ntstatus_to_werror(status); } r->in.dc_name = talloc_strdup(mem_ctx, - info->domain_controller_name); + info->dc_unc); W_ERROR_HAVE_NO_MEMORY(r->in.dc_name); } @@ -562,7 +562,7 @@ static WERROR NetGetJoinableOUsLocal(struct libnetapi_ctx *ctx, NTSTATUS status; ADS_STATUS ads_status; ADS_STRUCT *ads = NULL; - struct DS_DOMAIN_CONTROLLER_INFO *info = NULL; + struct netr_DsRGetDCNameInfo *info = NULL; uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED | DS_RETURN_DNS_NAME; @@ -574,7 +574,7 @@ static WERROR NetGetJoinableOUsLocal(struct libnetapi_ctx *ctx, return ntstatus_to_werror(status); } - ads = ads_init(domain, domain, info->domain_controller_name); + ads = ads_init(domain, domain, info->dc_unc); if (!ads) { return WERR_GENERAL_FAILURE; } -- cgit From 77a25318105d90ae34a05c8a1e71df84343bb28e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Feb 2008 17:09:47 +0100 Subject: Only set DEBUGLEVEL to 0 in libnetapi when not set already. Guenther (This used to be commit 3ace1601ac5b5d87d6bfd8aa0afe0c75858b6990) --- source3/lib/netapi/netapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index 47b3ba93cf..fb091f6e0b 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -50,7 +50,9 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context) return W_ERROR_V(WERR_NOMEM); } - DEBUGLEVEL = 0; + if (!DEBUGLEVEL) { + DEBUGLEVEL = 0; + } setup_logging("libnetapi", true); dbf = x_stderr; -- cgit From 808348a8ca1499f74343808b043983cb6fd5d06d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Feb 2008 02:49:27 +0100 Subject: Trying to fix libnetapi examples Makefile.in. Guenther (This used to be commit 405ef74d7e9ef614ea39b7cfd1d57307d9490545) --- source3/lib/netapi/examples/Makefile.in | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/examples/Makefile.in b/source3/lib/netapi/examples/Makefile.in index 86e1b1bc2f..6de3e65546 100644 --- a/source3/lib/netapi/examples/Makefile.in +++ b/source3/lib/netapi/examples/Makefile.in @@ -3,7 +3,7 @@ GTK_LIBS=`pkg-config gtk+-2.0 --libs` KRB5LIBS=@KRB5_LIBS@ LDAP_LIBS=@LDAP_LIBS@ -LIBS=@LIBS@ -lnetapi +LIBS=@LIBS@ -lnetapi -ltdb -ltalloc DEVELOPER_CFLAGS=@DEVELOPER_CFLAGS@ FLAGS=-I../ -L../../../bin @CFLAGS@ $(GTK_FLAGS) CC=@CC@ @@ -14,7 +14,12 @@ DYNEXP=@DYNEXP@ COMPILE_CC = $(CC) -I. $(FLAGS) $(PICFLAG) -c $< -o $@ COMPILE = $(COMPILE_CC) -BINARY_PREREQS = proto_exists bin/.dummy +PROGS = bin/getdc@EXEEXT@ \ + bin/netdomjoin@EXEEXT@ \ + bin/netdomjoin-gui@EXEEXT@ \ + bin/getjoinableous@EXEEXT@ + +all: $(PROGS) MAKEDIR = || exec false; \ if test -d "$$dir"; then :; else \ @@ -24,6 +29,13 @@ MAKEDIR = || exec false; \ mkdir "$$dir" || \ exec false; fi || exec false +BINARY_PREREQS = bin/.dummy + +bin/.dummy: + @if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \ + dir=bin $(MAKEDIR); fi + @: >> $@ || : > $@ # what a fancy emoticon! + .c.o: @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \ dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi @@ -38,30 +50,23 @@ NETDOMJOIN_OBJ = netdomjoin/netdomjoin.o NETDOMJOIN_GUI_OBJ = netdomjoin-gui/netdomjoin-gui.o GETJOINABLEOUS_OBJ = getjoinableous/getjoinableous.o -PROGS = bin/getdc@EXEEXT@ \ - bin/netdomjoin@EXEEXT@ \ - bin/netdomjoin-gui@EXEEXT@ \ - bin/getjoinableous@EXEEXT@ - -all: $(PROGS) - -bin/getdc@EXEEXT@: $(GETDC_OBJ) +bin/getdc@EXEEXT@: $(BINARY_PREREQS) $(GETDC_OBJ) @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(GETDC_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) -bin/getjoinableous@EXEEXT@: $(GETJOINABLEOUS_OBJ) +bin/getjoinableous@EXEEXT@: $(BINARY_PREREQS) $(GETJOINABLEOUS_OBJ) @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(GETJOINABLEOUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) -bin/netdomjoin@EXEEXT@: $(NETDOMJOIN_OBJ) +bin/netdomjoin@EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_OBJ) @echo Linking $@ @$(CC) $(FLAGS) -o $@ $(NETDOMJOIN_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) -bin/netdomjoin-gui@EXEEXT@: $(NETDOMJOIN_GUI_OBJ) +bin/netdomjoin-gui@EXEEXT@: $(BINARY_PREREQS) $(NETDOMJOIN_GUI_OBJ) @echo Linking $@ @$(CC) $(FLAGS) $(GTK_FLAGS) -o $@ $(NETDOMJOIN_GUI_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(GTK_LIBS) clean: -rm -f $(PROGS) -rm -f core */*~ *~ \ - */*.o */*/*.o */*/*/*.o \ + */*.o */*/*.o */*/*/*.o -- cgit From d1ef6699c0f9648dd76ac5230694e03a574cd48d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 5 Mar 2008 09:53:33 +0100 Subject: Fix rpccli_srvsvc_NetSrvSetInfo call in libnetapi. Guenther (This used to be commit 5911529205ca69c438e0782c07ee4fe5aa95de62) --- source3/lib/netapi/serverinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c index 7fa166e411..54512950bf 100644 --- a/source3/lib/netapi/serverinfo.c +++ b/source3/lib/netapi/serverinfo.c @@ -268,7 +268,7 @@ static WERROR NetServerSetInfoRemote(struct libnetapi_ctx *ctx, status = rpccli_srvsvc_NetSrvSetInfo(pipe_cli, ctx, server_name, level, - info, + &info, parm_error, &werr); if (!NT_STATUS_IS_OK(status)) { -- cgit From 2223292338111e0c97419cc643aa45e05d3c7aa8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 5 Mar 2008 13:20:32 +0100 Subject: Add PICFLAG to libnetapi Makefile. Guenther (This used to be commit 29fca3c0353f2be4577613d7e38fbc51d2a370fa) --- source3/lib/netapi/examples/Makefile.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/examples/Makefile.in b/source3/lib/netapi/examples/Makefile.in index 6de3e65546..000eef118b 100644 --- a/source3/lib/netapi/examples/Makefile.in +++ b/source3/lib/netapi/examples/Makefile.in @@ -7,6 +7,7 @@ LIBS=@LIBS@ -lnetapi -ltdb -ltalloc DEVELOPER_CFLAGS=@DEVELOPER_CFLAGS@ FLAGS=-I../ -L../../../bin @CFLAGS@ $(GTK_FLAGS) CC=@CC@ +PICFLAG=@PICFLAG@ LDFLAGS=@PIE_LDFLAGS@ @LDFLAGS@ DYNEXP=@DYNEXP@ -- cgit From 65b0235ee394f90e7a4938cfa5bc5d2d951e9d82 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 5 Mar 2008 15:21:43 +0100 Subject: Give a better error message why NetServerSetInfo() may fail in the gui. Guenther (This used to be commit 1bbbebb7767b8a25532e8be3dbd274c211e34bbd) --- source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c | 2 +- source3/lib/netapi/serverinfo.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c index 73b14d4d87..a3719c7442 100644 --- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c +++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c @@ -154,7 +154,7 @@ static void callback_apply_description_change(GtkWidget *widget, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "Failed to change computer description: %s.", - libnetapi_errstr(status)); + libnetapi_get_error_string(state->ctx, status)); g_signal_connect_swapped(dialog, "response", G_CALLBACK(gtk_widget_destroy), dialog); diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c index 54512950bf..d30e7d97f7 100644 --- a/source3/lib/netapi/serverinfo.c +++ b/source3/lib/netapi/serverinfo.c @@ -185,6 +185,9 @@ static WERROR NetServerSetInfoLocal_1005(struct libnetapi_ctx *ctx, } if (!lp_config_backend_is_registry()) { + libnetapi_set_error_string(ctx, + "Configuration manipulation requested but not " + "supported by backend"); return WERR_NOT_SUPPORTED; } -- cgit