From 317e19aeb3fbdb21573b6ef1bc8c2af646a7e61e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:43:35 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN This means we use just one constant for this file attribute. Andrew Bartlett --- source3/libgpo/gpo_filesync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c index be964a201e..b4a976840e 100644 --- a/source3/libgpo/gpo_filesync.c +++ b/source3/libgpo/gpo_filesync.c @@ -228,7 +228,7 @@ NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx, ctx.cli = cli; ctx.remote_path = CONST_DISCARD(char *, nt_path); ctx.local_path = CONST_DISCARD(char *, local_path); - ctx.attribute = (aSYSTEM | aHIDDEN | aDIR); + ctx.attribute = (aSYSTEM | FILE_ATTRIBUTE_HIDDEN | aDIR); ctx.mask = talloc_asprintf(mem_ctx, "%s\\*", -- cgit From 0a3c84b554f3862b3e558f62e67ceb8311b248ce Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 13:23:14 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM This means we use just one constant for this file attribute. Andrew Bartlett --- source3/libgpo/gpo_filesync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c index b4a976840e..c88b12c20e 100644 --- a/source3/libgpo/gpo_filesync.c +++ b/source3/libgpo/gpo_filesync.c @@ -228,7 +228,7 @@ NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx, ctx.cli = cli; ctx.remote_path = CONST_DISCARD(char *, nt_path); ctx.local_path = CONST_DISCARD(char *, local_path); - ctx.attribute = (aSYSTEM | FILE_ATTRIBUTE_HIDDEN | aDIR); + ctx.attribute = (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | aDIR); ctx.mask = talloc_asprintf(mem_ctx, "%s\\*", -- cgit From 0eca33bbf620678759bbe39efaa74f33f96efb74 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:57:02 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR This means we use just one constant for this file attribute. Andrew Bartlett --- source3/libgpo/gpo_filesync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c index c88b12c20e..e3d3ae6c04 100644 --- a/source3/libgpo/gpo_filesync.c +++ b/source3/libgpo/gpo_filesync.c @@ -150,7 +150,7 @@ static NTSTATUS gpo_sync_func(const char *mnt, DEBUG(5,("gpo_sync_func: got mask: [%s], name: [%s]\n", mask, info->name)); - if (info->mode & aDIR) { + if (info->mode & FILE_ATTRIBUTE_DIRECTORY) { DEBUG(3,("got dir: [%s]\n", info->name)); @@ -228,7 +228,7 @@ NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx, ctx.cli = cli; ctx.remote_path = CONST_DISCARD(char *, nt_path); ctx.local_path = CONST_DISCARD(char *, local_path); - ctx.attribute = (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | aDIR); + ctx.attribute = (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY); ctx.mask = talloc_asprintf(mem_ctx, "%s\\*", -- cgit From e131c94ac1b06cc49b1c25717d3496dba8b0b3df Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 13:42:05 -0700 Subject: More const fixes for compiler warnings from the waf build. --- source3/libgpo/gpo_filesync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c index e3d3ae6c04..be656eea7e 100644 --- a/source3/libgpo/gpo_filesync.c +++ b/source3/libgpo/gpo_filesync.c @@ -226,8 +226,8 @@ NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx, ctx.mem_ctx = mem_ctx; ctx.cli = cli; - ctx.remote_path = CONST_DISCARD(char *, nt_path); - ctx.local_path = CONST_DISCARD(char *, local_path); + ctx.remote_path = discard_const_p(char, nt_path); + ctx.local_path = discard_const_p(char, local_path); ctx.attribute = (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY); ctx.mask = talloc_asprintf(mem_ctx, -- cgit From 27022587e31769718ab53f4d114e03ac2f205f27 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 11:47:43 +0200 Subject: s3-libsmb: move protos to libsmb/proto.h Guenther --- source3/libgpo/gpo_filesync.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c index be656eea7e..91e1c2725a 100644 --- a/source3/libgpo/gpo_filesync.c +++ b/source3/libgpo/gpo_filesync.c @@ -19,6 +19,7 @@ #include "includes.h" #include "system/filesys.h" +#include "libsmb/libsmb.h" #include "../libgpo/gpo.h" #include "libgpo/gpo_proto.h" -- cgit From 0f8018676a6cb33238d506338d4fbb8b683550d3 Mon Sep 17 00:00:00 2001 From: Sean Finney Date: Fri, 20 May 2011 08:12:08 +0000 Subject: Fix numerous missing dependencies in WAF build scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the recent consolidation of code between s3 and s4, a number of new dependencies have been implicitly introduced. For example, previous s3 code gained an implicit dependency on talloc after the charset related consolidation (lib/util/charset/charset.h now includes talloc.h). When building against the embedded version of talloc this isn't a problem since the paths are automatically added to the search path, but when building against the external libraries build failures will occur for all components that don't directly or indirectly include talloc as a dependency. Since charset.h is included from util.h, which in turn is included from includes.h, this means most of the codebase (s3 and s4) has such an undeclared dependency. Therefore, samba-util-common and samba-util have been added as dependencies to the s3 and s4 code respectively, for all cases where the source would otherwise fail to build. Additionally, a few other dependencies are added in specific wscript_build files to address similar dependency-related problems. https://bugzilla.samba.org/show_bug.cgi?id=8128 Signed-off-by: Sean Finney Signed-off-by: Matthias Dieter Wallnöfer Signed-off-by: Andrew Bartlett Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Wed May 25 19:22:13 CEST 2011 on sn-devel-104 --- source3/libgpo/gpext/wscript_build | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpext/wscript_build b/source3/libgpo/gpext/wscript_build index bfdb4d0bf6..67f15188d8 100644 --- a/source3/libgpo/gpext/wscript_build +++ b/source3/libgpo/gpext/wscript_build @@ -8,6 +8,7 @@ GPEXT_SRC = '''../../../libgpo/gpext/gpext.c''' bld.SAMBA3_SUBSYSTEM('gpext', source=GPEXT_SRC, + deps='samba-util-common', vars=locals()) bld.SAMBA3_MODULE('gpext_registry', -- cgit From 59950faddc898ea97171d2eac5759314cc1cbeb9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 31 May 2011 00:45:06 +0200 Subject: s3:libgpo/gpo_proto.h: add GPL/Copyright header --- source3/libgpo/gpo_proto.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_proto.h b/source3/libgpo/gpo_proto.h index 8bc5874c9d..504704ec1f 100644 --- a/source3/libgpo/gpo_proto.h +++ b/source3/libgpo/gpo_proto.h @@ -1,3 +1,22 @@ +/* + * Unix SMB/CIFS implementation. + * Group Policy Object Support + * + * Copyright (C) Guenther Deschner 2006-2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ /* The following definitions come from libgpo/gpo_filesync.c */ -- cgit From 6ef8122cba3566d4ed177612066cbbe1b8684677 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 31 May 2011 00:45:57 +0200 Subject: s3:libgpo/gpo_proto.h: add _LIBGPO_GPO_PROTO_H_ guard --- source3/libgpo/gpo_proto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_proto.h b/source3/libgpo/gpo_proto.h index 504704ec1f..fa2f87338d 100644 --- a/source3/libgpo/gpo_proto.h +++ b/source3/libgpo/gpo_proto.h @@ -18,6 +18,9 @@ * along with this program; if not, see . */ +#ifndef _LIBGPO_GPO_PROTO_H_ +#define _LIBGPO_GPO_PROTO_H_ + /* The following definitions come from libgpo/gpo_filesync.c */ NTSTATUS gpo_copy_file(TALLOC_CTX *mem_ctx, @@ -94,3 +97,5 @@ WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx, struct gp_registry_entry *entry, const struct security_token *token, uint32_t flags); + +#endif /* _LIBGPO_GPO_PROTO_H_ */ -- cgit From 73b377432c5efb8451f09f6d25d8aa1b28c239c9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:10:15 +1000 Subject: s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc() Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett --- source3/libgpo/gpo_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpo_reg.c b/source3/libgpo/gpo_reg.c index d9fcd43caf..29b31aec8e 100644 --- a/source3/libgpo/gpo_reg.c +++ b/source3/libgpo/gpo_reg.c @@ -901,7 +901,7 @@ bool add_gp_registry_entry_to_array(TALLOC_CTX *mem_ctx, struct gp_registry_entry **entries, size_t *num) { - *entries = TALLOC_REALLOC_ARRAY(mem_ctx, *entries, + *entries = talloc_realloc(mem_ctx, *entries, struct gp_registry_entry, (*num)+1); -- cgit From ad0a07c531fadd1639c5298951cfaf5cfe0cb10e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:44:43 +1000 Subject: s3-talloc Change TALLOC_ZERO_P() to talloc_zero() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc. --- source3/libgpo/gpext/registry.c | 6 +++--- source3/libgpo/gpext/scripts.c | 6 +++--- source3/libgpo/gpext/security.c | 2 +- source3/libgpo/gpo_reg.c | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpext/registry.c b/source3/libgpo/gpext/registry.c index eb49b19b20..b0ec7b88d9 100644 --- a/source3/libgpo/gpext/registry.c +++ b/source3/libgpo/gpext/registry.c @@ -111,14 +111,14 @@ static bool gp_reg_entry_from_file_entry(TALLOC_CTX *mem_ctx, ZERO_STRUCTP(*reg_entry); - data = TALLOC_ZERO_P(mem_ctx, struct registry_value); + data = talloc_zero(mem_ctx, struct registry_value); if (!data) return false; data->type = r->type; data->data = data_blob_talloc(data, r->data, r->size); - entry = TALLOC_ZERO_P(mem_ctx, struct gp_registry_entry); + entry = talloc_zero(mem_ctx, struct gp_registry_entry); if (!entry) return false; @@ -327,7 +327,7 @@ static NTSTATUS registry_get_reg_config(TALLOC_CTX *mem_ctx, { NULL, REG_NONE, NULL } }; - info = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info); + info = talloc_zero(mem_ctx, struct gp_extension_reg_info); NT_STATUS_HAVE_NO_MEMORY(info); status = gp_ext_info_add_entry(mem_ctx, GP_EXT_NAME, diff --git a/source3/libgpo/gpext/scripts.c b/source3/libgpo/gpext/scripts.c index 3e977378ee..0b6748507a 100644 --- a/source3/libgpo/gpext/scripts.c +++ b/source3/libgpo/gpext/scripts.c @@ -62,7 +62,7 @@ static NTSTATUS scripts_get_reg_config(TALLOC_CTX *mem_ctx, { NULL, REG_NONE, NULL }, }; - info = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info); + info = talloc_zero(mem_ctx, struct gp_extension_reg_info); NT_STATUS_HAVE_NO_MEMORY(info); status = gp_ext_info_add_entry(mem_ctx, GP_EXT_NAME, @@ -89,10 +89,10 @@ static NTSTATUS generate_gp_registry_entry(TALLOC_CTX *mem_ctx, struct gp_registry_entry *entry = NULL; struct registry_value *data = NULL; - entry = TALLOC_ZERO_P(mem_ctx, struct gp_registry_entry); + entry = talloc_zero(mem_ctx, struct gp_registry_entry); NT_STATUS_HAVE_NO_MEMORY(entry); - data = TALLOC_ZERO_P(mem_ctx, struct registry_value); + data = talloc_zero(mem_ctx, struct registry_value); NT_STATUS_HAVE_NO_MEMORY(data); data->type = data_type; diff --git a/source3/libgpo/gpext/security.c b/source3/libgpo/gpext/security.c index dea0de33f9..b68840d2f6 100644 --- a/source3/libgpo/gpext/security.c +++ b/source3/libgpo/gpext/security.c @@ -202,7 +202,7 @@ static NTSTATUS security_get_reg_config(TALLOC_CTX *mem_ctx, { NULL, REG_NONE, NULL } }; - info = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_info); + info = talloc_zero(mem_ctx, struct gp_extension_reg_info); NT_STATUS_HAVE_NO_MEMORY(info); status = gp_ext_info_add_entry(mem_ctx, GP_EXT_NAME, diff --git a/source3/libgpo/gpo_reg.c b/source3/libgpo/gpo_reg.c index 29b31aec8e..5142e919cc 100644 --- a/source3/libgpo/gpo_reg.c +++ b/source3/libgpo/gpo_reg.c @@ -36,7 +36,7 @@ struct security_token *registry_create_system_token(TALLOC_CTX *mem_ctx) { struct security_token *token = NULL; - token = TALLOC_ZERO_P(mem_ctx, struct security_token); + token = talloc_zero(mem_ctx, struct security_token); if (!token) { DEBUG(1,("talloc failed\n")); return NULL; @@ -74,7 +74,7 @@ WERROR gp_init_reg_ctx(TALLOC_CTX *mem_ctx, return werr; } - tmp_ctx = TALLOC_ZERO_P(mem_ctx, struct gp_registry_context); + tmp_ctx = talloc_zero(mem_ctx, struct gp_registry_context); W_ERROR_HAVE_NO_MEMORY(tmp_ctx); if (token) { @@ -395,7 +395,7 @@ static WERROR gp_reg_read_groupmembership(TALLOC_CTX *mem_ctx, int num_token_sids = 0; struct security_token *tmp_token = NULL; - tmp_token = TALLOC_ZERO_P(mem_ctx, struct security_token); + tmp_token = talloc_zero(mem_ctx, struct security_token); W_ERROR_HAVE_NO_MEMORY(tmp_token); path = gp_reg_groupmembership_path(mem_ctx, object_sid, flags); @@ -602,7 +602,7 @@ static WERROR gp_read_reg_gpo(TALLOC_CTX *mem_ctx, return WERR_INVALID_PARAM; } - gpo = TALLOC_ZERO_P(mem_ctx, struct GROUP_POLICY_OBJECT); + gpo = talloc_zero(mem_ctx, struct GROUP_POLICY_OBJECT); W_ERROR_HAVE_NO_MEMORY(gpo); werr = gp_read_reg_gpovals(mem_ctx, key, gpo); -- cgit From 5db74b9607f4a5fc5ecaa8be0d744222cd55153c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 20 Jun 2011 20:36:46 +1000 Subject: lib/util Remove samba-util-common! All of this code is now in common, so we don't need the second '-common' library any more! Andrew Bartlett --- source3/libgpo/gpext/wscript_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libgpo') diff --git a/source3/libgpo/gpext/wscript_build b/source3/libgpo/gpext/wscript_build index 67f15188d8..3c835dd8cd 100644 --- a/source3/libgpo/gpext/wscript_build +++ b/source3/libgpo/gpext/wscript_build @@ -8,7 +8,7 @@ GPEXT_SRC = '''../../../libgpo/gpext/gpext.c''' bld.SAMBA3_SUBSYSTEM('gpext', source=GPEXT_SRC, - deps='samba-util-common', + deps='samba-util', vars=locals()) bld.SAMBA3_MODULE('gpext_registry', -- cgit