* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#define TALLOC_DEPRECATED 1
+
#include "includes.h"
#include "system/filesys.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "../librpc/gen_ndr/ndr_security.h"
#include "../libgpo/gpo.h"
#include "../libcli/security/security.h"
-#undef strdup
+#include "registry.h"
+#include "libgpo/gpo_proto.h"
#if 0
#define DEFAULT_DOMAIN_POLICY "Default Domain Policy"
/****************************************************************
****************************************************************/
-ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
- TALLOC_CTX *mem_ctx,
+ADS_STATUS gpo_process_a_gpo(TALLOC_CTX *mem_ctx,
const struct security_token *token,
struct registry_key *root_key,
struct GROUP_POLICY_OBJECT *gpo,
continue;
}
- ntstatus = gpext_process_extension(ads, mem_ctx,
+ ntstatus = gpext_process_extension(mem_ctx,
flags, token, root_key, gpo,
gp_ext->extensions_guid[i],
gp_ext->snapins_guid[i]);
/****************************************************************
****************************************************************/
-static ADS_STATUS gpo_process_gpo_list_by_ext(ADS_STRUCT *ads,
- TALLOC_CTX *mem_ctx,
+static ADS_STATUS gpo_process_gpo_list_by_ext(TALLOC_CTX *mem_ctx,
const struct security_token *token,
struct registry_key *root_key,
struct GROUP_POLICY_OBJECT *gpo_list,
* extension, otherwise we cannot store the e.g. the *list* of
* logon-scripts correctly (for more then one GPO) */
- status = gpo_process_a_gpo(ads, mem_ctx, token, root_key,
+ status = gpo_process_a_gpo(mem_ctx, token, root_key,
gpo, extensions_guid, flags);
if (!ADS_ERR_OK(status)) {
/****************************************************************
****************************************************************/
-ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
- TALLOC_CTX *mem_ctx,
+ADS_STATUS gpo_process_gpo_list(TALLOC_CTX *mem_ctx,
const struct security_token *token,
struct GROUP_POLICY_OBJECT *gpo_list,
const char *extensions_guid_filter,
struct gp_extension *gp_ext = NULL;
struct registry_key *root_key = NULL;
struct gp_registry_context *reg_ctx = NULL;
-#if 0
WERROR werr;
-#endif
+
status = ADS_ERROR_NT(init_gp_extensions(mem_ctx));
if (!ADS_ERR_OK(status)) {
return status;
if (!gp_ext_list) {
return ADS_ERROR_NT(NT_STATUS_DLL_INIT_FAILED);
}
-/* FIXME Needs to be replaced with new patchfile_preg calls */
-#if 0
+
/* get the key here */
if (flags & GPO_LIST_FLAG_MACHINE) {
werr = gp_init_reg_ctx(mem_ctx, KEY_HKLM, REG_KEY_WRITE,
talloc_free(reg_ctx);
return ADS_ERROR_NT(werror_to_ntstatus(werr));
}
-#endif
root_key = reg_ctx->curr_key;
gp_ext->name, guid_str));
- status = gpo_process_gpo_list_by_ext(ads, mem_ctx, token,
+ status = gpo_process_gpo_list_by_ext(mem_ctx, token,
root_key, gpo_list,
guid_str, flags);
if (!ADS_ERR_OK(status)) {
NTSTATUS check_refresh_gpo(ADS_STRUCT *ads,
TALLOC_CTX *mem_ctx,
const char *cache_dir,
- struct loadparm_context *lp_ctx,
uint32_t flags,
struct GROUP_POLICY_OBJECT *gpo)
{
DEBUG(1,("check_refresh_gpo: need to refresh GPO\n"));
- result = gpo_fetch_files(mem_ctx, ads, lp_ctx, cache_dir, gpo);
+ result = gpo_fetch_files(mem_ctx, ads, cache_dir, gpo);
if (!NT_STATUS_IS_OK(result)) {
goto out;
}
NTSTATUS check_refresh_gpo_list(ADS_STRUCT *ads,
TALLOC_CTX *mem_ctx,
const char *cache_dir,
- struct loadparm_context *lp_ctx,
uint32_t flags,
struct GROUP_POLICY_OBJECT *gpo_list)
{
for (gpo = gpo_list; gpo; gpo = gpo->next) {
- result = check_refresh_gpo(ads, mem_ctx, cache_dir, lp_ctx, flags, gpo);
+ result = check_refresh_gpo(ads, mem_ctx, cache_dir, flags, gpo);
if (!NT_STATUS_IS_OK(result)) {
goto out;
}
return NULL;
}
+ str = talloc_strdup(ctx, "");
+ if (!str) {
+ return NULL;
+ }
+
if (flags & GPO_INFO_FLAG_SLOWLINK)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_SLOWLINK ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_SLOWLINK ");
if (flags & GPO_INFO_FLAG_VERBOSE)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_VERBOSE ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_VERBOSE ");
if (flags & GPO_INFO_FLAG_SAFEMODE_BOOT)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_SAFEMODE_BOOT ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_SAFEMODE_BOOT ");
if (flags & GPO_INFO_FLAG_NOCHANGES)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_NOCHANGES ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_NOCHANGES ");
if (flags & GPO_INFO_FLAG_MACHINE)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_MACHINE ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_MACHINE ");
if (flags & GPO_INFO_FLAG_LOGRSOP_TRANSITION)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_LOGRSOP_TRANSITION ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_LOGRSOP_TRANSITION ");
if (flags & GPO_INFO_FLAG_LINKTRANSITION)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_LINKTRANSITION ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_LINKTRANSITION ");
if (flags & GPO_INFO_FLAG_FORCED_REFRESH)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_FORCED_REFRESH ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_FORCED_REFRESH ");
if (flags & GPO_INFO_FLAG_BACKGROUND)
- str = talloc_append_string(ctx, str, "GPO_INFO_FLAG_BACKGROUND ");
+ str = talloc_strdup_append(str, "GPO_INFO_FLAG_BACKGROUND ");
return str;
}
ADS_STATUS gp_get_machine_token(ADS_STRUCT *ads,
TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx,
const char *dn,
struct security_token **token)
{