s3-auth Use the common gensec_ntlmssp_update in gensec_ntlmssp3_server
[ira/wip.git] / source3 / utils / net_ads_gpo.c
index fbb3dd94bf9baf75b5f7bf642686972e1dddb88e..56451ab11e1c2332680149f5db5e919c36b1e5fe 100644 (file)
 
 #include "includes.h"
 #include "utils/net.h"
+#include "ads.h"
 #include "../libgpo/gpo.h"
 #include "libgpo/gpo_proto.h"
+#include "../libds/common/flags.h"
 
 #ifdef HAVE_ADS
 
@@ -36,7 +38,7 @@ static int net_ads_gpo_refresh(struct net_context *c, int argc, const char **arg
        uint32 flags = 0;
        struct GROUP_POLICY_OBJECT *gpo;
        NTSTATUS result;
-       struct nt_user_token *token = NULL;
+       struct security_token *token = NULL;
 
        if (argc < 1 || c->display_usage) {
                d_printf("%s\n%s\n%s",
@@ -155,7 +157,7 @@ static int net_ads_gpo_refresh(struct net_context *c, int argc, const char **arg
 
        {
                WERROR werr = gp_reg_state_read(mem_ctx, flags,
-                                               &token->user_sids[0],
+                                               &token->sids[0],
                                                &read_list);
                if (!W_ERROR_IS_OK(werr)) {
                        d_printf(_("failed: %s\n"), win_errstr(werr));
@@ -248,7 +250,7 @@ static int net_ads_gpo_list_all(struct net_context *c, int argc, const char **ar
                                            LDAP_SCOPE_SUBTREE,
                                            "(objectclass=groupPolicyContainer)",
                                            attrs,
-                                           DACL_SECURITY_INFORMATION,
+                                           SECINFO_DACL,
                                            &res);
 
        if (!ADS_ERR_OK(status)) {
@@ -291,7 +293,7 @@ out:
 
 static int net_ads_gpo_list(struct net_context *c, int argc, const char **argv)
 {
-       ADS_STRUCT *ads;
+       ADS_STRUCT *ads = NULL;
        ADS_STATUS status;
        LDAPMessage *res = NULL;
        TALLOC_CTX *mem_ctx;
@@ -299,7 +301,7 @@ static int net_ads_gpo_list(struct net_context *c, int argc, const char **argv)
        uint32 uac = 0;
        uint32 flags = 0;
        struct GROUP_POLICY_OBJECT *gpo_list;
-       struct nt_user_token *token = NULL;
+       struct security_token *token = NULL;
 
        if (argc < 1 || c->display_usage) {
                d_printf("%s\n%s\n%s",
@@ -369,7 +371,7 @@ static int net_ads_gpo_apply(struct net_context *c, int argc, const char **argv)
        struct GROUP_POLICY_OBJECT *gpo_list;
        uint32 uac = 0;
        uint32 flags = 0;
-       struct nt_user_token *token = NULL;
+       struct security_token *token = NULL;
        const char *filter = NULL;
 
        if (argc < 1 || c->display_usage) {
@@ -391,6 +393,8 @@ static int net_ads_gpo_apply(struct net_context *c, int argc, const char **argv)
        }
 
        status = ads_startup(c, false, &ads);
+       /* filter = cse_gpo_name_to_guid_string("Security"); */
+
        if (!ADS_ERR_OK(status)) {
                d_printf("got: %s\n", ads_errstr(status));
                goto out;