Move some libgpo files to root.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 1 Mar 2009 01:13:21 +0000 (02:13 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 20 Apr 2009 21:15:43 +0000 (23:15 +0200)
Signed-off-by: Günther Deschner <gd@samba.org>
libgpo/config.mk [new file with mode: 0644]
libgpo/gpext/gpext.c [moved from source3/libgpo/gpext/gpext.c with 97% similarity]
libgpo/gpext/gpext.h [moved from source3/libgpo/gpext/gpext.h with 95% similarity]
libgpo/gpo.h [moved from source3/include/gpo.h with 97% similarity]
libgpo/gpo_util.c [moved from source3/libgpo/gpo_util.c with 99% similarity]
source3/Makefile.in
source3/include/includes.h

diff --git a/libgpo/config.mk b/libgpo/config.mk
new file mode 100644 (file)
index 0000000..ebfcafd
--- /dev/null
@@ -0,0 +1,3 @@
+[SUBSYSTEM::LIBGPO]
+
+LIBGPO_OBJ_FILES = ../libgpo/gpo_util.o
similarity index 97%
rename from source3/libgpo/gpext/gpext.c
rename to libgpo/gpext/gpext.c
index ee4ce87c4ec03ecdec8716a775869cfe0a6601c3..82c0459e453dfcc6ee381dc2ebe098d53caebaa0 100644 (file)
@@ -18,6 +18,9 @@
  */
 
 #include "includes.h"
+#include "../libgpo/gpext/gpext.h"
+#include "librpc/gen_ndr/ndr_misc.h"
+#include "lib/util/dlinklist.h"
 
 static struct gp_extension *extensions = NULL;
 
@@ -103,7 +106,7 @@ NTSTATUS unregister_gp_extension(const char *name)
        }
 
        DLIST_REMOVE(extensions, ext);
-       TALLOC_FREE(ext);
+       talloc_free(ext);
 
        DEBUG(2,("Successfully removed GP extension '%s'\n", name));
 
@@ -150,13 +153,13 @@ NTSTATUS register_gp_extension(TALLOC_CTX *gpext_ctx,
                return NT_STATUS_OBJECT_NAME_COLLISION;
        }
 
-       entry = TALLOC_ZERO_P(gpext_ctx, struct gp_extension);
+       entry = talloc_zero(gpext_ctx, struct gp_extension);
        NT_STATUS_HAVE_NO_MEMORY(entry);
 
        entry->name = talloc_strdup(gpext_ctx, name);
        NT_STATUS_HAVE_NO_MEMORY(entry->name);
 
-       entry->guid = TALLOC_ZERO_P(gpext_ctx, struct GUID);
+       entry->guid = talloc_zero(gpext_ctx, struct GUID);
        NT_STATUS_HAVE_NO_MEMORY(entry->guid);
        status = GUID_from_string(guid, entry->guid);
        NT_STATUS_NOT_OK_RETURN(status);
@@ -180,7 +183,7 @@ static NTSTATUS gp_extension_init_module(TALLOC_CTX *mem_ctx,
        NTSTATUS status;
        struct gp_extension *ext = NULL;
 
-       ext = TALLOC_ZERO_P(mem_ctx, struct gp_extension);
+       ext = talloc_zero(mem_ctx, struct gp_extension);
        NT_STATUS_HAVE_NO_MEMORY(gpext);
 
        ext->methods = get_methods_by_name(extensions, name);
@@ -211,7 +214,7 @@ static bool add_gp_extension_reg_entry_to_array(TALLOC_CTX *mem_ctx,
                                                struct gp_extension_reg_entry **entries,
                                                size_t *num)
 {
-       *entries = TALLOC_REALLOC_ARRAY(mem_ctx, *entries,
+       *entries = talloc_realloc(mem_ctx, *entries,
                                        struct gp_extension_reg_entry,
                                        (*num)+1);
        if (*entries == NULL) {
@@ -234,7 +237,7 @@ static bool add_gp_extension_reg_info_entry_to_array(TALLOC_CTX *mem_ctx,
                                                     struct gp_extension_reg_info_entry **entries,
                                                     size_t *num)
 {
-       *entries = TALLOC_REALLOC_ARRAY(mem_ctx, *entries,
+       *entries = talloc_realloc(mem_ctx, *entries,
                                        struct gp_extension_reg_info_entry,
                                        (*num)+1);
        if (*entries == NULL) {
@@ -262,10 +265,10 @@ static NTSTATUS gp_ext_info_add_reg(TALLOC_CTX *mem_ctx,
        struct gp_extension_reg_entry *reg_entry = NULL;
        struct registry_value *data = NULL;
 
-       reg_entry = TALLOC_ZERO_P(mem_ctx, struct gp_extension_reg_entry);
+       reg_entry = talloc_zero(mem_ctx, struct gp_extension_reg_entry);
        NT_STATUS_HAVE_NO_MEMORY(reg_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 = type;
similarity index 95%
rename from source3/libgpo/gpext/gpext.h
rename to libgpo/gpext/gpext.h
index 0f0445701d94a9ab0d54dd2762589bdad3d75ab3..a3f9368f6943efcced913d4c1aeb3935640060ed 100644 (file)
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef __GPEXT_H__
+#define __GPEXT_H__
+
+#include "librpc/gen_ndr/winreg.h"
+
 #define KEY_WINLOGON_GPEXT_PATH "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\GPExtensions"
 
 #define SAMBA_SUBSYSTEM_GPEXT "gpext"
@@ -77,3 +82,5 @@ struct gp_extension_methods {
 
        NTSTATUS (*shutdown)(void);
 };
+
+#endif /* __GPEXT_H__ */
similarity index 97%
rename from source3/include/gpo.h
rename to libgpo/gpo.h
index bf5ff6a598aaaa88bc859929f377bbe29597f843..9abf526e14d226143657432e41cc253229dbe2da 100644 (file)
@@ -17,6 +17,9 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef __GPO_H__
+#define __GPO_H__
+
 enum GPO_LINK_TYPE {
        GP_LINK_UNKOWN  = 0,
        GP_LINK_MACHINE = 1,
@@ -59,7 +62,7 @@ struct GROUP_POLICY_OBJECT {
        enum GPO_LINK_TYPE link_type;
        const char *user_extensions;
        const char *machine_extensions;
-       SEC_DESC *security_descriptor;
+       struct security_descriptor *security_descriptor;
        struct GROUP_POLICY_OBJECT *next, *prev;
 };
 
@@ -155,4 +158,6 @@ struct gp_registry_context {
 #define GP_EXT_GUID_REGISTRY "35378EAC-683F-11D2-A89A-00C04FBBCFA2"
 #define GP_EXT_GUID_SCRIPTS  "42B5FAAE-6536-11D2-AE5A-0000F87571E3"
 
-#include "libgpo/gpext/gpext.h"
+#include "../libgpo/gpext/gpext.h"
+
+#endif
similarity index 99%
rename from source3/libgpo/gpo_util.c
rename to libgpo/gpo_util.c
index 04597b3b577c37cca5bf9beb169ab32cdfde34b2..505400be8c998a5ca9f638586b4aa6302921b2fb 100644 (file)
@@ -18,6 +18,8 @@
  */
 
 #include "includes.h"
+#include "../libgpo/gpo.h"
+#undef strdup
 
 #define DEFAULT_DOMAIN_POLICY "Default Domain Policy"
 #define DEFAULT_DOMAIN_CONTROLLERS_POLICY "Default Domain Controllers Policy"
@@ -471,7 +473,7 @@ ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
 
                if (extension_guid_filter &&
                    !strequal(extension_guid_filter,
-                             gp_ext->extensions_guid[i])) {
+                             gp_ext->extensions_guid[i])) {
                        continue;
                }
 
@@ -794,7 +796,7 @@ char *gpo_flag_str(uint32_t flags)
        if (flags & GPO_INFO_FLAG_BACKGROUND)
                fstrcat(str, "GPO_INFO_FLAG_BACKGROUND ");
 
-       return SMB_STRDUP(str);
+       return strdup(str);
 }
 
 /****************************************************************
@@ -807,7 +809,7 @@ NTSTATUS gp_find_file(TALLOC_CTX *mem_ctx,
                      const char **filename_out)
 {
        const char *tmp = NULL;
-       SMB_STRUCT_STAT sbuf;
+       struct stat sbuf;
        const char *path = NULL;
 
        if (flags & GPO_LIST_FLAG_MACHINE) {
@@ -820,7 +822,7 @@ NTSTATUS gp_find_file(TALLOC_CTX *mem_ctx,
                              path, suffix);
        NT_STATUS_HAVE_NO_MEMORY(tmp);
 
-       if (sys_stat(tmp, &sbuf) == 0) {
+       if (stat(tmp, &sbuf) == 0) {
                *filename_out = tmp;
                return NT_STATUS_OK;
        }
index b47c6e91b2def3e0ea029f81bc1c9629479810fb..425d5f1c3beb4a5b444357b9924937df182db54f 100644 (file)
@@ -409,9 +409,9 @@ LIBADDNS_OBJ0 = libaddns/dnsrecord.o libaddns/dnsutils.o  libaddns/dnssock.o \
               libaddns/dnsgss.o libaddns/dnsmarshall.o
 LIBADDNS_OBJ = $(LIBADDNS_OBJ0) $(SOCKET_WRAPPER_OBJ)
 
-GPEXT_OBJ = libgpo/gpext/gpext.o @GPEXT_STATIC@
+GPEXT_OBJ = ../libgpo/gpext/gpext.o @GPEXT_STATIC@
 
-LIBGPO_OBJ0 = libgpo/gpo_ldap.o libgpo/gpo_ini.o libgpo/gpo_util.o \
+LIBGPO_OBJ0 = libgpo/gpo_ldap.o libgpo/gpo_ini.o ../libgpo/gpo_util.o \
              libgpo/gpo_fetch.o libgpo/gpo_filesync.o libgpo/gpo_sec.o \
              libgpo/gpo_reg.o \
              $(GPEXT_OBJ)
index 10319b7429eea69e305ff7770e7f97aeb5bade61..943de8db7b88379abef3e2be533d8bd18aeca6a9 100644 (file)
@@ -609,7 +609,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "mapping.h"
 #include "passdb.h"
 #include "rpc_secdes.h"
-#include "gpo.h"
+#include "../libgpo/gpo.h"
 #include "authdata.h"
 #include "msdfs.h"
 #include "rap.h"