[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-323-g5a01071
Andrew Bartlett
abartlet at samba.org
Tue Sep 15 11:41:30 MDT 2009
The branch, master has been updated
via 5a01071692db91a4ea7131e31c41b6426d184758 (commit)
via 9a209ac252508bc9a5b1eaaaf256610aceb37736 (commit)
from 231b2fa26139a38bb67b3777c80b72e2f9d6d904 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5a01071692db91a4ea7131e31c41b6426d184758
Author: Andrew Bartlett <abartlet at samba.org>
Date: Tue Sep 15 10:11:45 2009 -0700
libcli:nbt put util_net.c protos in new header file
This fixed a very odd build problem due to util.h importing
system/network.h being imported before the uid_wapper code.
Andrew Bartlett
commit 9a209ac252508bc9a5b1eaaaf256610aceb37736
Author: Andrew Bartlett <abartlet at samba.org>
Date: Tue Sep 15 08:14:54 2009 -0700
s4:schema Add code to provide an index into the subClass tree
In time, this should avoid the astounding (order) complexity of the
objectclass sorting in objectclass.c eventually.
Andrew Bartlett
-----------------------------------------------------------------------
Summary of changes:
lib/util/util.h | 21 -------
source4/libcli/raw/rawlpq.c => lib/util/util_net.h | 62 ++++++++++----------
libcli/nbt/lmhosts.c | 1 +
source3/include/includes.h | 1 +
source4/dsdb/schema/schema.h | 7 ++
source4/dsdb/schema/schema_inferiors.c | 21 ++++++-
6 files changed, 59 insertions(+), 54 deletions(-)
copy source4/libcli/raw/rawlpq.c => lib/util/util_net.h (50%)
Changeset truncated at 500 lines:
diff --git a/lib/util/util.h b/lib/util/util.h
index 8438602..385a3ae 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -21,8 +21,6 @@
#ifndef _SAMBA_UTIL_H_
#define _SAMBA_UTIL_H_
-#include "system/network.h"
-
#if _SAMBA_BUILD_ == 4
#include "../lib/util/charset/charset.h"
#endif
@@ -842,24 +840,5 @@ bool add_uid_to_array_unique(TALLOC_CTX *mem_ctx, uid_t uid,
bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
gid_t **gids, size_t *num_gids);
-/* The following definitions come from lib/util/util_net.c */
-
-void zero_sockaddr(struct sockaddr_storage *pss);
-
-bool interpret_string_addr_internal(struct addrinfo **ppres,
- const char *str, int flags);
-
-bool interpret_string_addr(struct sockaddr_storage *pss,
- const char *str,
- int flags);
-
-/*******************************************************************
- Map a text hostname or IP address (IPv4 or IPv6) into a
- struct sockaddr_storage. Version that prefers IPv4.
-******************************************************************/
-
-bool interpret_string_addr_prefer_ipv4(struct sockaddr_storage *pss,
- const char *str,
- int flags);
#endif /* _SAMBA_UTIL_H_ */
diff --git a/source4/libcli/raw/rawlpq.c b/lib/util/util_net.h
similarity index 50%
copy from source4/libcli/raw/rawlpq.c
copy to lib/util/util_net.h
index 5c44772..6eacfc3 100644
--- a/source4/libcli/raw/rawlpq.c
+++ b/lib/util/util_net.h
@@ -1,8 +1,9 @@
/*
Unix SMB/CIFS implementation.
- client lpq operations
- Copyright (C) Tim Potter 2005
-
+ Utility functions for Samba
+ Copyright (C) Andrew Tridgell 1992-1999
+ Copyright (C) Jelmer Vernooij 2005
+
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
@@ -17,32 +18,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
-#include "libcli/raw/libcliraw.h"
-#include "libcli/raw/raw_proto.h"
-
-/****************************************************************************
- lpq - async send
-****************************************************************************/
-struct smbcli_request *smb_raw_lpq_send(struct smbcli_tree *tree,
- union smb_lpq *parms)
-{
- return NULL;
-}
-
-/****************************************************************************
- lpq - async receive
-****************************************************************************/
-NTSTATUS smb_raw_lpq_recv(struct smbcli_request *req, union smb_lpq *parms)
-{
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/*
- lpq - sync interface
-*/
-NTSTATUS smb_raw_lpq(struct smbcli_tree *tree, union smb_lpq *parms)
-{
- struct smbcli_request *req = smb_raw_lpq_send(tree, parms);
- return smb_raw_lpq_recv(req, parms);
-}
+#ifndef _SAMBA_UTIL_NET_H_
+#define _SAMBA_UTIL_NET_H_
+
+#include "system/network.h"
+
+/* The following definitions come from lib/util/util_net.c */
+
+void zero_sockaddr(struct sockaddr_storage *pss);
+
+bool interpret_string_addr_internal(struct addrinfo **ppres,
+ const char *str, int flags);
+
+bool interpret_string_addr(struct sockaddr_storage *pss,
+ const char *str,
+ int flags);
+
+/*******************************************************************
+ Map a text hostname or IP address (IPv4 or IPv6) into a
+ struct sockaddr_storage. Version that prefers IPv4.
+******************************************************************/
+
+bool interpret_string_addr_prefer_ipv4(struct sockaddr_storage *pss,
+ const char *str,
+ int flags);
+
+#endif /* _SAMBA_UTIL_NET_H_ */
diff --git a/libcli/nbt/lmhosts.c b/libcli/nbt/lmhosts.c
index db81d31..11703a2 100644
--- a/libcli/nbt/lmhosts.c
+++ b/libcli/nbt/lmhosts.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "lib/util/xfile.h"
+#include "lib/util/util_net.h"
#include "system/filesys.h"
#include "system/network.h"
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 31dfc00..d1be3b0 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -612,6 +612,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
/* Lists, trees, caching, database... */
#include "../lib/util/util.h"
+#include "../lib/util/util_net.h"
#include "../lib/util/xfile.h"
#include "../lib/util/memory.h"
#include "../lib/util/attr.h"
diff --git a/source4/dsdb/schema/schema.h b/source4/dsdb/schema/schema.h
index a605e2f..4e7e503 100644
--- a/source4/dsdb/schema/schema.h
+++ b/source4/dsdb/schema/schema.h
@@ -146,6 +146,13 @@ struct dsdb_class {
uint32_t *mustContain_ids;
uint32_t *mayContain_ids;
uint32_t *systemPossSuperiors_ids;
+
+ /* An ordered index showing how this subClass fits into the
+ * subClass tree. that is, an objectclass that is not
+ * subClassOf anything is 0 (just in case), and top is 1, and
+ * subClasses of top are 2, subclasses of those classes are
+ * 3 */
+ uint32_t subClass_order;
};
struct dsdb_schema_oid_prefix {
diff --git a/source4/dsdb/schema/schema_inferiors.c b/source4/dsdb/schema/schema_inferiors.c
index b0ecc08..493b425 100644
--- a/source4/dsdb/schema/schema_inferiors.c
+++ b/source4/dsdb/schema/schema_inferiors.c
@@ -127,6 +127,20 @@ static char **schema_subclasses_recurse(struct dsdb_schema *schema, struct dsdb_
return list;
}
+/* Walk down the subClass tree, setting a higher index as we go down
+ * each level. top is 1, subclasses of top are 2, etc */
+void schema_subclasses_order_recurse(struct dsdb_schema *schema, struct dsdb_class *schema_class, int order)
+{
+ const char **list = schema_class->subclasses_direct;
+ int i;
+ schema_class->subClass_order = order;
+ for (i=0;list && list[i]; i++) {
+ struct dsdb_class *schema_class2 = dsdb_class_by_lDAPDisplayName(schema, list[i]);
+ schema_subclasses_order_recurse(schema, schema_class2, order+1);
+ }
+ return;
+}
+
static void schema_create_subclasses(struct dsdb_schema *schema)
{
struct dsdb_class *schema_class;
@@ -148,7 +162,12 @@ static void schema_create_subclasses(struct dsdb_schema *schema)
for (schema_class=schema->classes; schema_class; schema_class=schema_class->next) {
schema_class->subclasses = str_list_unique(schema_subclasses_recurse(schema, schema_class));
- }
+
+ /* Initilise the subClass order, to ensure we can't have uninitilised sort on the subClass hirarchy */
+ schema_class->subClass_order = 0;
+ }
+
+ schema_subclasses_order_recurse(schema, dsdb_class_by_lDAPDisplayName(schema, "top"), 1);
}
static void schema_fill_possible_inferiors(struct dsdb_schema *schema, struct dsdb_class *schema_class)
--
Samba Shared Repository
More information about the samba-cvs
mailing list