summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)AuthorFilesLines
2014-12-04samba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"Guenter Kukkukk1-5/+8
Avoid hardcoded IP-strings, use standard python IP functions to format IPv4 and IPv6 addresses correctly. I have removed the display of the port number. MS-DNSP 2.2.3.2.2.1 DNS_ADDR: (from May 15, 2014) Port Number (2bytes): Senders MUST set this to zero, and receivers MUST ignore it. Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit d5af53c5372866a33a0195cabbd64232ac53bad4)
2014-12-04samba-tool: Fix enum values in dns.pyGuenter Kukkukk1-1/+1
DNS_ZONE_UPDATE_SECURE was used twice, DNS_ZONE_UPDATE_UNSECURE was missing. Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 4bda589c8e68cd66ca3b0ea9496cb1b11febcae6)
2014-09-08provision: Correctly provision the SOA record minimum TTLKai Blin2-0/+2
This fixes bug #10466 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Guenter Kukkukk <kukks@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Wed May 21 10:55:00 CEST 2014 on sn-devel-104 (cherry picked from commit 634f116fbb89d723a627f4501b4cd89342cecb8e)
2014-09-08python/join: use lowercase for the dnshostname.Stefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 5533d9c3db31ac86769288527ec20ad4e57f703c)
2014-08-07tests: dnsserver: Add a update test with name set to '.'Amitay Isaacs1-1/+40
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jul 29 19:33:19 CEST 2014 on sn-devel-104 (cherry picked from commit 6d104182d9667e4f996439d24cfa052f34098ce4) Bug: https://bugzilla.samba.org/show_bug.cgi?id=10742 samba-tool dns add 172.31.9.161 s4xdom.base . NS mydns.org. => NO_MEMORY Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Thu Aug 7 18:54:28 CEST 2014 on sn-devel-104
2014-07-15dbcheck: Add check and test for various invalid userParameters valuesAndrew Bartlett1-0/+90
Bug: https://bugzilla.samba.org/show_bug.cgi?id=8077 Change-Id: I6f2f4169856ce78c62e3a7e74b48520cca9cb9ae Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 9bfbff65436a088fab5d564b6c0bb122a76492bc)
2014-07-15dbcheck: Ensure dbcheck can operate with --attrs setAndrew Bartlett1-1/+1
This also includes a test to ensure we do not regress on this point. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit f596dc94e1ab839f13e2a9edbcec774635b5c211)
2014-07-15dbcheck: Directly call dn.get_rdn_{val,name}() for clarity and consistencyAndrew Bartlett1-18/+13
When looking for incorrect name values, this improves the previous code by avoiding one more manual parse step, and uses less cryptic variable names. Andrew Bartlett Change-Id: Iff8e571a6359a67bf173f729dc12b8787292b3cb Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> (cherry picked from commit 393348d11ed781d9f42049d5f996b0bab8b15d58)
2014-07-15dbchecker: verify and fix broken dn valuesStefan Metzmacher1-0/+94
With older Samba versions (4.0.x) the following could happen: - On account was created on DC1 - It was replicated to DC2 - The connection between the dcs is offline - The account gets modified on DC2 - The account gets deleted on DC1 - The connection becomes online again - DC1 replicates the modification from DC2, this resets the dn to the original value. 'name' and 'cn' are correct (with '\nDEL${GUID}'), but 'dn' is wrong. - DC2 replicates the deletion from DC1. this doesn't include a changed dn as DC1 had a bug. 'name' is correct (with '\nDEL${GUID}'), but 'cn' and 'dn' are wrong. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10536 Change-Id: Ia70a6c12e0ff0d4c2c8100cb1d8f3c6422b65591 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 709ed040ec161e99b3c1f7076eac4a631149f64a)
2014-07-15dbchecker: make the deleted objects container detection more genericStefan Metzmacher1-2/+8
Change-Id: I282ad887c41412e25fdf73476e405f4e88e0b239 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 821d7dc7b33598f72c4518f8975073b058df5960)
2014-07-15samba-tool dbcheck: handle missing objectClassFelix Botner1-0/+31
In several cases we have seen objects without the objectClass attribute. Here the suggestion for a patch to find such objects in "samba-tool dbcheck" with the option to delete them. (patch improved by Andrew Bartlett to suggest DRS re-replication) Signed-off-by: Felix Botner <botner@univention.de> Change-Id: I8eb0d191a2089271a9af5884d6bfbf173a5c85c6 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 5b1d6e722e254522165ec512537a2efa2b979e6f)
2014-07-15s4-samldb: Do not allow deletion of objects with RID < 1000Nadezhda Ivanova1-6/+6
According to [MS-SAMR] 3.1.5.7 Delete Pattern we should not allow deletion of security objects with RID < 1000. This patch will prevent deletion of well-known accounts and groups. Signed-off-by: Nadezhda Ivanova <nivanova@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Nadezhda Ivanova <nivanova@samba.org> Autobuild-Date(master): Mon Oct 14 13:31:50 CEST 2013 on sn-devel-104 (cherry picked from commit 13a10d43141c29dad61868b451c0c1dca82360de)
2014-07-15provision: capture slightly less generic exceptions during the test for aclsGarming Sam1-2/+2
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> (cherry picked from commit f279a297a4a94c5cbc049c9b2cde14b02960a76f) The last 4 patches address bug #10703 - backport provision fixes from master.
2014-07-15provision: improve error message when connecting to samdb without the ↵Garming Sam1-1/+7
correct permissions Signed-off-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> (cherry picked from commit b27543aa729ca893270831d5c4fc74ea7ac6d407)
2014-07-15provision: Fix failures on re-provision incorrectly blamed on posix acl support.Garming Sam1-26/+25
By doing the test later, there is an actual sam.ldb file that can be connected to. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> (cherry picked from commit a89060a0217f8740798d1dac4466222301a4d81b)
2014-07-15samba-tool: add --site parameter to provision command (bug #10674)Björn Baumbach1-1/+4
This new parameter offers the option to specify a default initial site name. Otherwise it will be "Default-First-Site-Name". Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> (cherry picked from commit 4ca1d69d7daa8f4f92d44cd505aa0983f2ab56bf)
2014-07-15provision/sambadns: remove redundant site parameterBjörn Baumbach2-3/+4
The sitename is already included in "names" parameter. Part of fix for bug #10674 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> (cherry picked from commit 4ebd7250ef18811e58d812670e96e61836e4770b) Conflicts: python/samba/provision/__init__.py python/samba/provision/sambadns.py
2014-05-20bug #10609: CVE-2014-0239 Don't reply to repliesKai Blin1-0/+29
Due to insufficient input checking, the DNS server will reply to a packet that has the "reply" bit set. Over UDP, this allows to send a packet with a spoofed sender address and have two servers DOS each other with circular replies. This patch fixes bug #10609 and adds a test to make sure we don't regress. CVE-2014-2039 has been assigned to this issue. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10609 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Tue May 20 04:15:44 CEST 2014 on sn-devel-104 (cherry picked from commit 392ec4d241eb19c812cd49ff73bd32b2b09d8533) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Tue May 20 13:54:40 CEST 2014 on sn-devel-104
2014-04-29provision: Fix string replacement orderingBenjamin Franzke1-1/+1
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@symas.com> (cherry picked from commit ca8acb681a1ccaddf85376ff30c9b13b1a4c943d)
2014-04-01dns: Extend tests for records with another typeKai Blin1-0/+14
Add another check to the one added for bug #10471, for added paranoia Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Tue Mar 4 15:47:10 CET 2014 on sn-devel-104 (cherry picked from commit 5bd47bb563c3736b9de1a3a93bdf46a498928643)
2014-04-01bug #10471: Don't respond with NXDOMAIN to records that exist with another typeKai Blin1-0/+16
DNS queries for records with the wrong type need to trigger an empty response with RCODE_OK instead of returning NXDOMAIN. This adds a test and fixes bug #10471 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit d9829df13317b38677d92a499134727ab31fbb0e)
2013-11-14Fix bug 10196 - RW Deny for a specific user is not overriding RW Allow for a ↵Jeremy Allison1-44/+116
group. Fix posix_acl tests to match the change in writing ACLs with ID_TYPE_BOTH. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> (cherry picked from commit a1bc1c32e33508c45e614646d69a5f5d67ba22be) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Thu Nov 14 11:36:24 CET 2013 on sn-devel-104
2013-11-11Merge tag 'samba-4.1.1' into v4-1-testKarolin Seeger1-1/+1
samba: tag release samba-4.1.1
2013-11-08CVE-2013-4476: samba-tool provision: create ${private_dir}/tls with mode 0700Björn Baumbach1-1/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-11-06s4-dns: dlz_bind9: Create dns-HOSTNAME account disabledSamuel Cabrero1-4/+7
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Oct 25 00:39:21 CEST 2013 on sn-devel-104 (cherry picked from commit d3aee80928dc7ccde9441309bf946c2503f7714a) Part of a fix for bug # 9091 - When replicating DNS for bind9_dlz we need to create the server-DNS account remotely. Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Wed Nov 6 14:28:14 CET 2013 on sn-devel-104
2013-09-27dbcheck: Add back the elements that were wrongly removed from CN=Deleted ObjectsAndrew Bartlett1-0/+66
This is the final part of the fix for the issue in Samba 4.1 pre-release tree where we would wrongly delete the Deleted Objects container during a join. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Sep 24 09:31:37 CEST 2013 on sn-devel-104 (cherry picked from commit f4ff81f5797c5dd8f562aec2cfec789272e739fd) The last 19 patches address bug #10157 - Regression causes replication failure with Windows 2008R2 and deletes Deleted Objects.
2013-09-27dbcheck: Ensure to always increase the error_countAndrew Bartlett1-0/+1
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit bcd535e95c5e8f83f6b30264ab1f0de3c6ac2cda)
2013-09-27dbcheck: Look for and fix the all-zero invocationID in replPropertyMetaDataAndrew Bartlett1-0/+68
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 9e1dde15f9d3a374747d163e37016b54f008bd9f)
2013-09-27python/drs: Ensure to pass in the local invocationID during the domain joinAndrew Bartlett3-4/+10
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> (cherry picked from commit a623359fb8a54083b81436d14b7ba022c11efb18)
2013-09-25python-samba-tool fsmo: Do not give an error on a successful role transferAndrew Bartlett1-7/+7
Bug: https://bugzilla.samba.org/show_bug.cgi?id=9461 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): Mon Sep 23 12:00:24 CEST 2013 on sn-devel-104 (cherry picked from commit 8d8872ae0a19786452c3be044757b16814b82be8) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Wed Sep 25 10:47:35 CEST 2013 on sn-devel-104
2013-09-06scripting/join.py: Handle creating the dns-NAME account during a DC joinAndrew Bartlett2-7/+77
This will ensure that the DLZ plugin works out of the box when joining a second Samba DC to the domain. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit b106d9090e8f8f44f02059d2ced3d10066787060)
2013-09-02python/provision: remove unused linklocal=False argument from interface_ips_v6()Stefan Metzmacher1-3/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Bjoern Jacke <bj@sernet.de> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Fri Aug 30 17:33:58 CEST 2013 on sn-devel-104 (cherry picked from commit 3430448fc01ce3fbe0606a2c239d3c98a5b78361) The last 3 patches address bug #10030 - ::1 added to nameserver on join. Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Mon Sep 2 11:50:45 CEST 2013 on sn-devel-104
2013-09-02python/pyglue: filter out loopback and linklocal addresses unless ↵Stefan Metzmacher1-2/+43
all_interfaces is given Bug: https://bugzilla.samba.org/show_bug.cgi?id=10030 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Bjoern Jacke <bj@sernet.de> (cherry picked from commit 0e6aca40413fb3cfd4300f282204a69743be4a65)
2013-08-05samba-tool dbcheck: Correctly remove deleted DNs in dbcheckAndrew Bartlett1-1/+1
The previous pattern never matched, as it was a typo. Andrew Bartlett 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 Jul 30 12:55:00 CEST 2013 on sn-devel-104 (cherry picked from commit 7615b2549d9549683978cb3e85b926e2ba63e294) The last 4 patches address bug #9029 - Replication with --domain-crictical-only fails to fill in backlinks.
2013-06-12python samba-tool drs: Correctly print KCC references to deleted serversAndrew Bartlett1-3/+12
Tested against Windows 2008R2, presumably before the KCC ran. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-06-11Remove remaining references to "password level" in the treeAndrew Bartlett1-1/+0
Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Simo Sorce <idra@samba.org> Autobuild-Date(master): Tue Jun 11 16:25:54 CEST 2013 on sn-devel-104
2013-06-01dns: Delete dnsNode objects when they are emptyKai Blin1-0/+117
If an update leaves the dnsNode without any entries, the dnsNode object should be deleted. Thanks to Günter Kukkukk for his excellent debugging work on this one. This should fix bug #9559 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-30samba-tool/dns: Set secure zone update flag after creating new zoneAmitay Isaacs1-3/+9
Windows DC ignores the secure update flag while creating new zone. Windows performs another operation to set the secure update flag. Signed-off-by: Amitay Isaacs <amitay@gmail.com>
2013-05-30samba-tool/dns: Pass on additional flags when creating zonesAmitay Isaacs1-0/+6
Windows DCs require additional flags to be set when creating zones. This fixes bug #9599. Signed-off-by: Amitay Isaacs <amitay@gmail.com>
2013-05-30s4-dns: Support update of SOA recordsAmitay Isaacs1-2/+3
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
2013-05-28s4-dns: Print/Set minimumTTL value in SOA recordAmitay Isaacs1-1/+3
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue May 28 08:47:56 CEST 2013 on sn-devel-104
2013-05-16python-samba-tool domain classicupgrade: Use transactions when adding ↵Andrew Bartlett1-31/+69
users/groups/members This should make things a bit faster when importing very large numbers of users as we will not constantly rewrite the indicies on disk. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-16samba-tool dbcheck: Use dsdb.DS_GUID_DELETED_OBJECTS_CONTAINER rather than ↵Andrew Bartlett1-1/+1
the literal value This is better practice. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-16python-samba-tool domain classicupgrade: Correct message about re-promoting BDCsAndrew Bartlett1-1/+1
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-16python-samba-tool domain classicupgrade: Actually Skip domain trust accountsAndrew Bartlett1-0/+1
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-16python-samba-tool domain classicupgrade: Skip machine accounts that do not ↵Andrew Bartlett1-4/+11
end in $ These accounts will not work anyway, as all the domain member lookup code in netlogon expects the $. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-16dns: Fix allocation of txt_record in txt record testsKai Blin1-8/+12
Signed-off-by: Kai Blin <kai@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu May 16 15:39:15 CEST 2013 on sn-devel-104
2013-05-16dns: more debug debug options in the testsKai Blin1-4/+26
Signed-off-by: Kai Blin <kai@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com>
2013-05-16dns: Add support for MX queriesKai Blin1-0/+43
Due to an oversight, the internal DNS server supports MX record updates, but not MX record queries. Add support for MX queries and tests. This should fix bug #9485 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com>
2013-05-15samba_tool/base.py: Fix typo.Karolin Seeger1-1/+1
Signed-off-by: Karolin Seeger <kseeger@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>