Fix NULL pointer dereference in libgpo when listing Local Policy which has no securit...
[kai/samba.git] / libgpo / gpo_ldap.c
index 16c551ebabc4182fddc0f359ff0d5d43f65fc154..a884198ed5b7b9f6b974d21d1709474ab310aa09 100644 (file)
@@ -20,6 +20,7 @@
 #include "includes.h"
 #if _SAMBA_BUILD_ == 4
 #include "libgpo/gpo.h"
+#include "libgpo/gpo_s4.h"
 #include "source4/libgpo/ads_convenience.h"
 #endif
 
@@ -551,7 +552,7 @@ static ADS_STATUS add_gplink_to_gpo_list(ADS_STRUCT *ads,
                                         struct GP_LINK *gp_link,
                                         enum GPO_LINK_TYPE link_type,
                                         bool only_add_forced_gpos,
-                                        const struct nt_user_token *token)
+                                        const NT_USER_TOKEN *token)
 {
        ADS_STATUS status;
        int i;
@@ -618,7 +619,7 @@ static ADS_STATUS add_gplink_to_gpo_list(ADS_STRUCT *ads,
 ADS_STATUS ads_get_sid_token(ADS_STRUCT *ads,
                             TALLOC_CTX *mem_ctx,
                             const char *dn,
-                            struct nt_user_token **token)
+                            NT_USER_TOKEN **token)
 {
        ADS_STATUS status;
        DOM_SID object_sid;
@@ -627,7 +628,7 @@ ADS_STATUS ads_get_sid_token(ADS_STRUCT *ads,
        size_t num_ad_token_sids = 0;
        DOM_SID *token_sids;
        size_t num_token_sids = 0;
-       struct nt_user_token *new_token = NULL;
+       NT_USER_TOKEN *new_token = NULL;
        int i;
 
        status = ads_get_tokensids(ads, mem_ctx, dn,
@@ -709,7 +710,7 @@ ADS_STATUS ads_get_gpo_list(ADS_STRUCT *ads,
                            TALLOC_CTX *mem_ctx,
                            const char *dn,
                            uint32_t flags,
-                           const struct nt_user_token *token,
+                           const NT_USER_TOKEN *token,
                            struct GROUP_POLICY_OBJECT **gpo_list)
 {
        /* (L)ocal (S)ite (D)omain (O)rganizational(U)nit */