From 444fd1e8481ae4ec971c4cac5996e47a751b8a17 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 14 Aug 2007 14:47:08 +0000 Subject: r24413: Minor edits for libgpo. Guenther (This used to be commit 5dc791f4cfdee2bc350c1e65aeed5705c1745356) --- source3/utils/net_ads_gpo.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_ads_gpo.c b/source3/utils/net_ads_gpo.c index 180e2d509e..5f53982da9 100644 --- a/source3/utils/net_ads_gpo.c +++ b/source3/utils/net_ads_gpo.c @@ -52,7 +52,8 @@ static int net_ads_gpo_refresh(int argc, const char **argv) uint32 flags = 0; struct GROUP_POLICY_OBJECT *gpo; NTSTATUS result; - + struct nt_user_token *token = NULL; + if (argc < 1) { printf("usage: net ads gpo refresh \n"); return -1; @@ -82,12 +83,17 @@ static int net_ads_gpo_refresh(int argc, const char **argv) (uac & UF_WORKSTATION_TRUST_ACCOUNT) ? "machine" : "user", argv[0], dn); - status = ads_get_gpo_list(ads, mem_ctx, dn, flags, &gpo_list); + status = ads_get_sid_token(ads, mem_ctx, dn, &token); + if (!ADS_ERR_OK(status)) { + goto out; + } + + status = ads_get_gpo_list(ads, mem_ctx, dn, flags, token, &gpo_list); if (!ADS_ERR_OK(status)) { goto out; } - if (!NT_STATUS_IS_OK(result = check_refresh_gpo_list(ads, mem_ctx, gpo_list))) { + if (!NT_STATUS_IS_OK(result = check_refresh_gpo_list(ads, mem_ctx, flags, gpo_list))) { printf("failed to refresh GPOs: %s\n", nt_errstr(result)); goto out; } @@ -206,6 +212,7 @@ static int net_ads_gpo_list(int argc, const char **argv) uint32 uac = 0; uint32 flags = 0; struct GROUP_POLICY_OBJECT *gpo_list; + struct nt_user_token *token = NULL; if (argc < 1) { printf("usage: net ads gpo list \n"); @@ -235,7 +242,12 @@ static int net_ads_gpo_list(int argc, const char **argv) (uac & UF_WORKSTATION_TRUST_ACCOUNT) ? "machine" : "user", argv[0], dn); - status = ads_get_gpo_list(ads, mem_ctx, dn, flags, &gpo_list); + status = ads_get_sid_token(ads, mem_ctx, dn, &token); + if (!ADS_ERR_OK(status)) { + goto out; + } + + status = ads_get_gpo_list(ads, mem_ctx, dn, flags, token, &gpo_list); if (!ADS_ERR_OK(status)) { goto out; } -- cgit