summaryrefslogtreecommitdiff
path: root/source3/utils/net_ads_gpo.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-09-29 17:15:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:14:55 -0500
commit88a98e35c780b1665bc21006b9c8c096e6b06f3f (patch)
treec77114ee5057bb91015c36855194cac1c056670d /source3/utils/net_ads_gpo.c
parent824966fb3c88958b851b9ac5c29d95f770d98429 (diff)
downloadsamba-88a98e35c780b1665bc21006b9c8c096e6b06f3f.tar.gz
samba-88a98e35c780b1665bc21006b9c8c096e6b06f3f.tar.bz2
samba-88a98e35c780b1665bc21006b9c8c096e6b06f3f.zip
r19003: Finally activate "net ads gpo".
For those who are interested, try net ads gpo refresh mybox$ to get your machine related GPOs downloaded to /var/lib/samba/gpo_cache. Detailed information about GPOs is currently only printed when setting a higher debuglevel then 0. Guenther (This used to be commit d086babf9d2592f041cc35db3d60b4452ea953f5)
Diffstat (limited to 'source3/utils/net_ads_gpo.c')
-rw-r--r--source3/utils/net_ads_gpo.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/source3/utils/net_ads_gpo.c b/source3/utils/net_ads_gpo.c
index 0a9e0fb62a..1865aee3d4 100644
--- a/source3/utils/net_ads_gpo.c
+++ b/source3/utils/net_ads_gpo.c
@@ -29,9 +29,9 @@ static int net_ads_gpo_usage(int argc, const char **argv)
"net ads gpo <COMMAND>\n"\
"<COMMAND> can be either:\n"\
" ADDLINK Link a container to a GPO\n"\
-" APPLY Apply all GPOs\n"\
-" DELETELINK Delete a gPLink from a container\n"\
-" EFFECTIVE Lists all GPOs assigned to a machine\n"\
+/* " APPLY Apply all GPOs\n"\ */
+/* " DELETELINK Delete a gPLink from a container\n"\ */
+" REFRESH Lists all GPOs assigned to an account and downloads them\n"\
" GETGPO Lists specified GPO\n"\
" GETLINK Lists gPLink of a containter\n"\
" HELP Prints this help message\n"\
@@ -41,7 +41,7 @@ static int net_ads_gpo_usage(int argc, const char **argv)
return -1;
}
-static int net_ads_gpo_effective(int argc, const char **argv)
+static int net_ads_gpo_refresh(int argc, const char **argv)
{
TALLOC_CTX *mem_ctx;
ADS_STRUCT *ads;
@@ -57,11 +57,11 @@ static int net_ads_gpo_effective(int argc, const char **argv)
NTSTATUS result;
if (argc < 1) {
- printf("usage: net ads gpo effective <username|machinename>\n");
+ printf("usage: net ads gpo refresh <username|machinename>\n");
return -1;
}
- mem_ctx = talloc_init("net_ads_gpo_effective");
+ mem_ctx = talloc_init("net_ads_gpo_refresh");
if (mem_ctx == NULL) {
return -1;
}
@@ -205,7 +205,7 @@ static int net_ads_gpo_list(int argc, const char **argv)
goto out;
}
- dump_gpo(mem_ctx, &gpo);
+ dump_gpo(mem_ctx, &gpo, 1);
ads_memfree(ads, dn);
}
@@ -218,6 +218,8 @@ out:
return 0;
}
+#if 0 /* not yet */
+
static int net_ads_gpo_apply(int argc, const char **argv)
{
TALLOC_CTX *mem_ctx;
@@ -301,6 +303,7 @@ out:
return 0;
}
+#endif
static int net_ads_gpo_get_link(int argc, const char **argv)
{
@@ -378,6 +381,8 @@ out:
return 0;
}
+#if 0 /* broken */
+
static int net_ads_gpo_delete_link(int argc, const char **argv)
{
ADS_STRUCT *ads;
@@ -411,16 +416,17 @@ out:
return 0;
}
+#endif
+
static int net_ads_gpo_get_gpo(int argc, const char **argv)
{
ADS_STRUCT *ads;
ADS_STATUS status;
TALLOC_CTX *mem_ctx;
struct GROUP_POLICY_OBJECT gpo;
- uint32 sysvol_gpt_version;
- char *display_name;
if (argc < 1) {
+ printf("usage: net ads gpo getgpo <gpo>\n");
return -1;
}
@@ -445,17 +451,7 @@ static int net_ads_gpo_get_gpo(int argc, const char **argv)
goto out;
}
- dump_gpo(mem_ctx, &gpo);
-
- status = ADS_ERROR_NT(ads_gpo_get_sysvol_gpt_version(ads, mem_ctx,
- gpo.file_sys_path,
- &sysvol_gpt_version,
- &display_name));
- if (!ADS_ERR_OK(status)) {
- goto out;
- }
-
- printf("sysvol GPT version: %d\n", sysvol_gpt_version);
+ dump_gpo(mem_ctx, &gpo, 1);
out:
talloc_destroy(mem_ctx);
@@ -468,13 +464,13 @@ int net_ads_gpo(int argc, const char **argv)
{
struct functable func[] = {
{"LIST", net_ads_gpo_list},
- {"EFFECTIVE", net_ads_gpo_effective},
+ {"REFRESH", net_ads_gpo_refresh},
{"ADDLINK", net_ads_gpo_add_link},
- {"DELETELINK", net_ads_gpo_delete_link},
+ /* {"DELETELINK", net_ads_gpo_delete_link}, */
{"GETLINK", net_ads_gpo_get_link},
{"GETGPO", net_ads_gpo_get_gpo},
{"HELP", net_ads_gpo_usage},
- {"APPLY", net_ads_gpo_apply},
+ /* {"APPLY", net_ads_gpo_apply}, */
{NULL, NULL}
};