1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

77 Commits

Author SHA1 Message Date
Andrew Bartlett
b96b1e88f7 pydsdb: Fix returning of ldb.MessageElement.
This object is not based on pytalloc_Object and so this causes
a segfault (later a failure) when the struct definitions diverge.
We must also not reuse the incoming ldb_message_element as a talloc
context and overwrite the values, instead we should create a new
object and return that.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:25 +01:00
Andrew Bartlett
0e58705a5b python: Remove Python 2.4 support macros
We require Python 2.6

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2016-01-07 23:33:10 +01:00
Andrew Bartlett
b48776d78b pydsdb: Also accept ldb.MessageElement values to dsdb routines
This shows the correct way to accept a value that may be a list of strings
or a proper ldb.MessageElement.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
35f267304e dsdb: Add functional levels for 2012 and 2012R2
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-20 20:22:22 +02:00
Andrew Bartlett
bed29f3c92 pydsdb: Allow the full range of uint32_t values for attributeID
The high bit may be set in these integers, so we need an unsigned int to store it in

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11429

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Stefan Metzmacher
3098a43266 s4:pydsdb: add DSDB_CONTROL_PERMIT_INTERDOMAIN_TRUST_UAC_OID
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-12 17:13:42 +01:00
Andrew Bartlett
db004e079a CVE-2014-8143:pydsdb: Pull in UF_USE_AES_KEYS flag
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10993

Change-Id: I36ad5ebc5d8a4811c41b59af90a3add4ae5fd857
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-01-15 12:33:08 +01:00
Andrew Bartlett
d787f7af49 pydsdb: Raise a more useful exception when dsdb_wellknown_dn fails.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-24 07:44:29 +02:00
Andrew Bartlett
51101b310a pydsdb: Give KeyError when we fail a schema lookup in python
This allows sensible exception handling.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-24 07:44:29 +02:00
Andrew Bartlett
a623359fb8 python/drs: Ensure to pass in the local invocationID during the domain join
This ensures (and asserts) that we never write an all-zero GUID as an invocationID
to the database in replPropertyMetaData.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-09-19 12:25:41 -07:00
Matthias Dieter Wallnöfer
5f8006cb64 s4:dsdb_sort_objectClass_attr - simplify memory context handling
Do only require the out memory context and build the temporary one in
the body of the function. This greatly simplifies the callers.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Andrew Bartlett
fdd07e87c6 s4-dsdb: Explain better what records are written during schema set
This is controlled by setting write_indices_and_attributes.

Andrew Bartlett
2012-08-10 10:18:28 +10:00
Andrew Bartlett
ef87b4e4f1 s4-pydsdb: Provide control of if we should write index attributes when reloading a schema
This allows us to carefully control the loading of the schema.

Andrew Bartlett
2012-08-09 06:39:20 +02:00
Stefan Metzmacher
a370792cbc s4:libcli/pyerrors: s/PyErr_WERROR_IS_ERR_RAISE/PyErr_WERROR_NOT_OK_RAISE/
metze
2012-08-06 15:50:16 +02:00
Andrew Bartlett
e4001a78c1 dsdb: Allocate new OID to allow updates of a read-only replica
Normally this would be a very bad idea, but the specific case of fixing the instanceType
is the only case where this makes sense.

Andrew Bartlett
2012-07-18 09:32:53 +02:00
Andrew Bartlett
7782e334b9 s4-dsdb: Remove unused variables in py_dsdb_get_partitions_dn 2012-07-06 22:55:50 +10:00
Andrew Bartlett
023508ed17 pydsdb: Add bindings for dsdb_wellknown_dn() 2012-07-06 22:55:50 +10:00
Andrew Bartlett
e4077a8ca5 s4-pydsdb: Add bindings for dsdb_find_nc_root() 2012-07-06 22:45:34 +10:00
Andrew Bartlett
507e6fdce5 s4-pydsdb: Improve PyErr_LDB_{DN,}_OR_RAISE to use py_check_dcerpc_type
This checks the type rather than just dereferencing the pointer.

Andrew Bartlett
2012-07-06 22:45:34 +10:00
Matthias Dieter Wallnöfer
a2a9c334c1 s4:dsdb/pydsdb.c - call the "objectClass" normalisation code from Python
This allows the dbchecker to fix ordering/inconsistency problems with
the mentioned attribute.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-04-18 07:48:05 +02:00
Matthias Dieter Wallnöfer
0c2c5f24a9 s4:dsdb/pydsdb.c - fix indentation 2012-04-11 12:50:16 +10:00
Dave Craft
aff8dad076 Intersite KCC flags for python
Add NTDSSITELINK options to dsdb class for use
in python samba_kcc

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-01-14 06:13:08 +01:00
Stefan Metzmacher
fbcdaa6a45 s4:pydsdb: remove unused variable from py_dsdb_am_pdc()
metze
2011-12-13 12:36:34 +01:00
Andrew Bartlett
d8f98933fd pydsdb: provide a am_pdc hook like am_rodc to python scripts 2011-12-07 03:09:08 +01:00
Stefan Metzmacher
75ae19422b s4:dsdb/schema: pass and remember the schema_dn in dsdb_set_schema_from_ldif()
metze
2011-11-15 09:46:27 +01:00
Stefan Metzmacher
e6a9e1dda9 s4:dsdb/pydsdb: pass down schema_dn to _dsdb_set_schema_from_ldif()
metze
2011-11-15 09:46:26 +01:00
Dave Craft
a5d6e427c5 python dsdb flag addtions (NTDSSETTINGS, NTDSCONN)
Add missing flags present in C code base to python
code base dsdb/pydsdb.c
   INSTANCE_TYPE...
   DS_NTDSSETTINGS_OPT...
   NTDSCONN_OPT...
These are consumed by the python KCC scripts

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-07 10:02:45 +11:00
Andrew Tridgell
c2d70af1a7 s4-dsdb: added DSDB_CONTROL_DBCHECK
this will be used for overrides by the dbcheck validator

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:22 +11:00
Jelmer Vernooij
fdff105854 pyldb: Consistently use pyldb_ prefix. 2011-08-07 17:08:56 +02:00
Andrew Tridgell
94b820af56 pydsdb: added get_backlink_from_lDAPDisplayName()
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
02562a0ca9 dsdb: added get_lDAPDisplayName_by_attid
this allows conversion from a DRS attribute ID to a LDAP display name

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-11 14:32:45 +10:00
Matthieu Patou
bbd4e27745 s4-python: Add functions to get linkid and systemflags of an attribute
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:44 +10:00
Andrew Tridgell
202f0a4b57 pydsdb: added get_syntax_oid_from_lDAPDisplayName()
this gives you access to the syntax oid of an attribute

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 14:47:08 +10:00
Andrew Tridgell
665ef94d3c s4-pydsdb: added dsdb_normalise_attributes() call
this call converts a set of attributes to DRSUAPI format and back to
ldb format. This has the effect of normalising the attributes using
the schema syntax rules
2011-06-17 12:32:55 +10:00
Jelmer Vernooij
8bf5356958 s4-python: Add missing prototypes. 2011-01-03 01:48:04 +01:00
Kamen Mazdrashki
33a57db3a5 s4-pydsdb: Use local memory context in py_dsdb_get_oid_from_attid()
This version reverts changes from commit b974966cc2
and is what Matthieu Patou had commited in d784ecec55
with added reference to the schema cache.

I think referencing schema here is the right thing to be done
as thus we garantee that schema cache will stay in memory
for the time our function is executed

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Mon Dec 20 12:01:53 CET 2010 on sn-devel-104
2010-12-20 12:01:53 +01:00
Matthias Dieter Wallnöfer
a910d0cc64 s4:dsdb/pydsdb.c - don't throw another exception on "PyObject_AsDn"
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Dec 12 23:40:17 CET 2010 on sn-devel-104
2010-12-12 23:40:17 +01:00
Matthias Dieter Wallnöfer
e4b22702b6 ldb:pyldb.h - revert to the previous header behaviour
"ldb_private.h" is private and therefore might not always be available.
2010-12-12 22:55:14 +01:00
Matthias Dieter Wallnöfer
c8d888772a s4:dsdb/pydsdb.c and web_server/wsgi.c - remove accidentally introduced Py_RETURN_NONE
This was only thought for Python 2.3 which we generally no longer support (only
pyldb in the LDB library is an exception).
2010-12-12 20:06:24 +01:00
Matthias Dieter Wallnöfer
b974966cc2 s4:dsdb/pydsdb.c - clean up memory handling
- Remove memory contexts when not really useful (if only one allocation)
- Try to find out OOM conditions and return correct error codes
- Move the parameter parsing always to the beginning (to prevent
  unneeded allocations in case of errors)
2010-12-12 20:06:24 +01:00
Andrew Tridgell
74d373d0f7 s4-pydsdb: two more GPO related flags 2010-11-29 18:04:41 +11:00
Andrew Tridgell
e54c8bef8a s4-pydsdb: added GPO policy flags 2010-11-29 18:04:41 +11:00
Andrew Tridgell
a589b9a033 s4-pydsdb: use cpp macro to simplify flags definitions
also added some more from flags.h
2010-11-28 00:16:37 +11:00
Kamen Mazdrashki
38585a7490 s4-pydsdb: py_dsdb_am_rodc() may call samdb_rodc() only once to get the job done :) 2010-11-10 10:20:02 +02:00
Kamen Mazdrashki
d073c5f23a s4-pydsdb: py_dsdb_load_partition_usn() - simplify error handling in
and print on which partition error has occured
2010-11-10 10:20:01 +02:00
Kamen Mazdrashki
89440dd617 s4-pydsdb-py_samdb_ntds_objectGUID(): Avoid potential memory leak
in case py_ldb is not a valid LDB
2010-11-10 10:20:01 +02:00
Kamen Mazdrashki
06b0596537 s4-pydsdb-py_dsdb_get_oid_from_attid(): Avoid potential memory leak
in case py_ldb is not a valid LDB
2010-11-10 10:20:00 +02:00
Kamen Mazdrashki
ad5a399d54 s4-pydsdb.c: Fix small memory leak in py_samdb_set_domain_sid() 2010-11-10 10:20:00 +02:00
Matthias Dieter Wallnöfer
af84b6d325 s4:pydsdb.c - use "Py_ssize_t" for Python list counters
Seems to be the most appropriate type
2010-11-08 10:39:05 +00:00
Matthias Dieter Wallnöfer
9f2d21561b s4:pydsdb.c - introduce Python 2.4 compatibility defines 2010-11-08 10:39:05 +00:00