summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)AuthorFilesLines
2015-09-29samba-tool: add command to dump dosinfo xattr from a fileRalph Boehme2-1/+31
Add a new command "getdosinfo" to samba-tool to dump dosinfo xattr from a file. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Sep 29 06:00:49 CEST 2015 on sn-devel-104
2015-09-01python/tests: Add more assertions that we get back the value we expectAndrew Bartlett1-0/+6
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> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 1 17:00:53 CEST 2015 on sn-devel-104
2015-09-01python/tests: Add tests for 64 bit signed integersAndrew Bartlett1-1/+27
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-29python: Remove uuid modulePetr Viktorin2-66/+0
The uuid module was only built for Python 2.4 and lower, which Samba no longer supports. Python 2.5+ includes uuid in its standard library. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Aug 29 04:03:49 CEST 2015 on sn-devel-104
2015-08-24ldb: create a cache of known wellknown objects instead of continously ↵Matthieu Patou1-1/+14
searching in the db Profiling on dbcheck have shown that we spend 10% of the time looking for wellknown objects. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973 Change-Id: I13ed58e8062d1b7b6179d17b0e7e56f943572c6c Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24dbcheck: Use set() operations to make dbcheck more efficientAndrew Bartlett1-18/+18
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24dbcheck: Try to avoid duplicate searchesAndrew Bartlett1-2/+4
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24dbcheck: Add additional tests for the attributeID listAndrew Bartlett1-0/+14
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24dbcheck: Add explict tests for unknown and unsorted attributeID valuesAndrew Bartlett2-4/+84
Unknown attributeID values would cause an exception previously, and unsorted attributes cause a failure to replicate with Samba 4.2. In commit 61b978872fe86906611f64430b2608f5e7ea7ad8 we started to sort these values correctly, but previous versions of Samba did not sort them correctly (we sorted high-bit-set values as negative), and then after 9c9df40220234cba973e84b4985d90da1334a1d1 we stoped accepting these. To ensure we are allowed to make this unusual change to the replPropertyMetaData, a new OID is allocated and checked for in repl_meta_data.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24python/tests: Add tests for integer overflow handlingAndrew Bartlett1-0/+203
This also documents an issue with our python bindings and lists, as changes to integers in a list of integers are not preserved 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-24python: Use an unsigned integer for buf_size, not -1Andrew Bartlett1-1/+1
This will fail once our python bindings correctly check value ranges 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-14python:samba/upgrade.py Fix format string syntax in error conditionAndrew Bartlett1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11436 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Aug 14 10:52:39 CEST 2015 on sn-devel-104
2015-08-06dns: always add authority recordsKai Blin1-17/+17
Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Thu Aug 6 14:06:52 CEST 2015 on sn-devel-104
2015-07-31tests:docs: don't load or test the static param_table.Michael Adam1-49/+0
It is going to be removed for the generated table. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: remove testing the diff between the static and generated tableMichael Adam1-19/+0
This reverts commit 380e0769ad3563dc762fb0c9ebe57d8131846519. This is in preparation of the removal of the committed param_table_static.c Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: test the diff between the static and generated tableMichael Adam1-0/+19
This proves that the committed and the generated parameter tables are identical (modulo order). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: load the full data from the generated param_tableMichael Adam1-0/+6
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: load the full data from the existing param_table.Michael Adam1-0/+6
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: add a function to load the full data structures from the tableMichael Adam1-0/+58
instead of just loading the list of parameter names. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: print more complicated structures than strings in the message.Michael Adam1-0/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: common initialization in docs test.Michael Adam1-43/+35
Just load the structures once at startup. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31param: move the actual table out into param_table_static.cMichael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests:docs: teach the test the types cmdlist, bytes, octal, and ustringMichael Adam1-0/+8
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31tests: teach the docs test about boolean-revMichael Adam1-0/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-08samba-tool: add 'domain trust *' commandsStefan Metzmacher1-0/+2206
Available subcommands: create - Create a domain or forest trust. delete - Delete a domain trust. list - List domain trusts. namespaces - Manage forest trust namespaces. show - Show trusted domain details. validate - Validate a domain trust. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08python/samba: add on optional 'special_name' argument to CredentialsOptions()Stefan Metzmacher1-10/+27
This way we have have two sets or credentials on the command line, while at least one uses some prefix (special_name) for the arguments. The default options without special_name are: Credentials Options: --simple-bind-dn=DN DN to use for a simple bind --password=PASSWORD Password -U USERNAME, --username=USERNAME Username -W WORKGROUP, --workgroup=WORKGROUP Workgroup -N, --no-pass Don't ask for a password -k KERBEROS, --kerberos=KERBEROS Use Kerberos --ipaddress=IPADDRESS IP address of server -P, --machine-pass Use stored machine account password With special_name='local-dc' it's: Credentials Options (local-dc): --local-dc-simple-bind-dn=DN DN to use for a simple bind --local-dc-password=PASSWORD Password --local-dc-username=USERNAME Username --local-dc-workgroup=WORKGROUP Workgroup --local-dc-no-pass Don't ask for a password --local-dc-kerberos=KERBEROS Use Kerberos --local-dc-ipaddress=IPADDRESS IP address of server --local-dc-machine-pass Use stored machine account password Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08python/samba: add current_unix_time()Stefan Metzmacher1-0/+4
This is needed to get the time from modules in python/samba/netcmd/ where a time.py exist. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-03python:samba/tests: don't use the x.alter_context() method in dcerpc/bare.pyStefan Metzmacher1-11/+2
Establishing a new context on a given connection using alter_context is supposed to be done by using y = ClientConnection(..., basis_connection=x) The current x.alter_context() can work as it's not allowed to change the abstract or transfer syntax of an existing presentation context. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03python/samba/tests: add fallbacks for assert{Less,Greater}[Equal]()Stefan Metzmacher1-0/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03python/samba/tests: let the output of hexdump() match our C code in ↵Stefan Metzmacher1-6/+10
dump_data_cb() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03python/samba/tests: move hexdump() from DNSTest to TestCaseStefan Metzmacher2-14/+12
This is useful in a lot of test cases. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2015-06-18samba-tool: make 'samba-tool fsmo *' aware of all 7 fsmo rolesRowland Penny1-78/+268
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10734 Signed-off-by: Rowland Penny <repenny241155@gmail.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Jose A. Rivera <jarrpa@samba.org> Autobuild-User(master): José A. Rivera <jarrpa@samba.org> Autobuild-Date(master): Thu Jun 18 10:24:48 CEST 2015 on sn-devel-104
2015-06-16Group creation: Add msSFU30Name only when --nis-domain was givenMarc Muehlfeld1-2/+1
This fixes a bug, that all new created groups automatically get an msSFU30Name attribute added. This should only be the case, when we also have a nis-domain (samba-tool --nis-domain=...). Bugreport: https://bugzilla.samba.org/show_bug.cgi?id=11315 Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue Jun 16 11:58:02 CEST 2015 on sn-devel-104
2015-06-12KCC: use python 2.6 compatible dictonary comprehensionsDouglas Bagnall2-9/+9
The `{k: v for k, v in whatever}` syntax is "new" in Python 2.7. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jun 12 09:46:13 CEST 2015 on sn-devel-104
2015-06-12KCC: intrasite double_directed_ring test shouldn't include RODCsDouglas Bagnall1-2/+36
RODCs don't belong in the ring. In practice, they don't really belong in the same site as a ring, but that is another matter. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: use logger.critical rather than print >> sys.stderrDouglas Bagnall1-3/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: draw a site-edges graph for each partitionDouglas Bagnall1-1/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: use KccError, simplify logic in NTDSConn.commit_modifiedDouglas Bagnall1-10/+7
silence a pep8 thing. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: remove unused create_edge_set() functionDouglas Bagnall1-5/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: ignore the bridges_required optionDouglas Bagnall2-14/+8
At least until we have SiteLinkBridges to test against. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: fix the polarity of bridges_required optionDouglas Bagnall1-1/+1
If one of the *_BRIDGES_REQUIRED flags is set, bridges_required is True. We ignore this option anyway. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: remove a TODO with seemingly no basis in specificationDouglas Bagnall1-2/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: clarify setup-vertices docstring, remove TODODouglas Bagnall1-1/+10
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: note about the meaning of None in schedule typesDouglas Bagnall1-0/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: combine_repl_info() returns the combined replinfoDouglas Bagnall1-45/+23
Previously it returned False if there was no intersections (i.e, the new repl_info duration was 0). Now the same check can be performed by checking the duration directly. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Conflicts: python/samba/kcc/graph.py
2015-06-12KCC: remove unnecessary commentDouglas Bagnall1-1/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: reword comment, removing unwarranted XXXDouglas Bagnall1-5/+5
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: remove an unwarranted XXX commentDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: let kcc.graph.ReplInfo know its durationDouglas Bagnall1-8/+17
This is going to lead to a few simplifications. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12KCC: docstring for kcc.graph.InternalEdgeDouglas Bagnall1-0/+6
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>