summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2021-03-18 10:05:26 +0100
committerGünther Deschner <gd@samba.org>2021-03-24 00:55:32 +0000
commitbcc3945e5384e6f39dc03eaeeee2382a6a7d52be (patch)
tree5f50164e74c9e882bb3632f1877332ca2e65a499 /source3/lib/netapi
parent44ef7f96e16f26780272a5638c009fcd79c21ed2 (diff)
downloadsamba-bcc3945e5384e6f39dc03eaeeee2382a6a7d52be.tar.gz
s3:netapi: Use public getters in getjoinableous example
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/examples/join/getjoinableous.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source3/lib/netapi/examples/join/getjoinableous.c b/source3/lib/netapi/examples/join/getjoinableous.c
index 732f73dd572..c0fba576eae 100644
--- a/source3/lib/netapi/examples/join/getjoinableous.c
+++ b/source3/lib/netapi/examples/join/getjoinableous.c
@@ -35,6 +35,8 @@ int main(int argc, const char **argv)
uint32_t num_ous = 0;
struct libnetapi_ctx *ctx = NULL;
int i;
+ const char *username = NULL;
+ const char *password = NULL;
poptContext pc;
int opt;
@@ -70,10 +72,23 @@ int main(int argc, const char **argv)
/* NetGetJoinableOUs */
+ status = libnetapi_get_username(ctx, &username);
+ if (status != 0) {
+ printf("failed with: %s\n",
+ libnetapi_get_error_string(ctx, status));
+ goto out;
+ }
+ status = libnetapi_get_password(ctx, &password);
+ if (status != 0) {
+ printf("failed with: %s\n",
+ libnetapi_get_error_string(ctx, status));
+ goto out;
+ }
+
status = NetGetJoinableOUs(host_name,
domain_name,
- ctx->username,
- ctx->password,
+ username,
+ password,
&num_ous,
&ous);
if (status != 0) {