1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
Commit Graph

1351 Commits

Author SHA1 Message Date
Andrew Tridgell
a959597637 s4: bring nsupdate-gss into the s4 tree
This is a perl script that does TSIG-GSS DNS updates against a AD
DC. The bind 9.5 nsupdate still doesn't seem to work with TSIG-GSS,
and we need a way to do DNS updates when we vampire a domain, so I
revived this ancient perl script and added a wrapper script that can
update DNS entries using our machine account credentials
2009-09-07 10:55:32 +10:00
Andrew Tridgell
ffd48a79ee s4:python fixed subunit tests of dcerpc
The version of the unitest python module in Ubuntu Jaunty doesn't seem
to support this many level of subdirectories. Moving the tests up one
level solves the problem.
2009-09-04 18:07:04 +10:00
Andrew Tridgell
617bbd913d allow setting of the debug level in python from C 2009-09-03 18:36:09 +10:00
Andrew Tridgell
b5f63160d4 repl_meta_data should only be included when we are a DC 2009-09-02 18:19:56 +10:00
Andrew Tridgell
199be936d8 move the repl_meta_data module up the ldb module stack
The repl_meta_data module needs to be above the linked_attributes
module, to allow linked_attributes to do its magic
2009-09-02 18:19:56 +10:00
Matthieu Patou
72fb26e9a4 s4: Create helpers functions related to provision
One for getting attributes with DN syntax, one for getting forward
linked attributes and one for getting the list of partition
2009-08-28 22:41:49 +10:00
Andrew Bartlett
160c197b84 s4:python Add helper to get at the domain SID 2009-08-27 19:40:21 +10:00
Andrew Bartlett
1a97bd915d s4:provision Ensure that @OPTIONS is mirrored into each partition
The previous patches to the provision system cut down on the number of
reconnects, and disabled the partition handling for part of the
process.  This means we lost the setting of @OPTIONS as a replicated
attribute into the partitions.

Andrew Bartlett
2009-08-26 17:37:01 +10:00
Andrew Bartlett
a1da91174b s4:provison Add prefixes to ldb using same code a later modify will use
This allows us to test out the code that will do the modify of the
prefixMap, and to provide the bindings that may assist a future
upgrade script.

Andrew Bartlett
2009-08-26 13:49:10 +10:00
Andrew Bartlett
b9ec6bb1eb s4:provision Only create references to our server DN after the self join
This will ensure that the GUID can be filled in correctly, and assist
us to validate DN targets in the future.

Andrew Bartlett
2009-08-26 13:48:35 +10:00
Andrew Bartlett
436d8b6e06 s4:python Fix the reprovision test by deleting 'deleted' objects too.
We were failing because CN=Deleted Objects, which is marked as
'deleted' itself, could not be re-added in a reprovision.

Andrew Bartlett
2009-08-25 16:28:44 +10:00
Andrew Tridgell
3dee92fcb9 fixed the build
the changes from Matthias didn't take account of url and lp being None
in some ldb python instances in 'make test'
2009-08-17 21:40:19 +10:00
Matthias Dieter Wallnöfer
7a79d16183 s4: Major rework of the LDB/SAMDB/IDMAP python bindings
- Centralise the lookups for the default domain (root) in the call "domain_dn"
- Reduce the LDB connections attempts ("connect" calls) from three to one
  - tools should load faster
- Make the LDB connection init more like the "ldb_wrap_connection" call
- Load the right UTF8 casefolder which fixes up problems with special characters
  (discovered by me: e.g. small "Umlaute" (ä, ö, ü, ...) in the DN weren't upcased
  - so records "seemed" lost in TDB)
2009-08-17 11:58:40 +02:00
Matthias Dieter Wallnöfer
0a46fd630e s4:pyglue Add a wrapper for loading the correct UTF8 casefolder
Needed for special characters (e.g. in German "Umlaute")
2009-08-17 11:58:39 +02:00
Matthias Dieter Wallnöfer
36f828bafb Revert "s4:samdb python bindings - we don't need the attributes here"
This reverts commit 53ef426e6f.

As abartlet pointed out this causes to load all attributes and therefore gives
us more here than we need (only the check for the DN)!
2009-08-17 11:06:39 +02:00
Andrew Tridgell
87921bf694 sigh - still not right 2009-08-17 17:50:26 +10:00
Andrew Tridgell
52108a19a4 fixed up add_foreign again
my last patch was not even close ...

I'll leave abartlet to work out how to fix the test case
2009-08-17 17:48:27 +10:00
Andrew Tridgell
905db32885 more fixups from provision changes
Andrew, can you please check this? The idmap.setup_name_mapping tests
look totally out of place here. I'm also not sure I captured your
intention with the other changes
2009-08-17 17:35:36 +10:00
Andrew Tridgell
f3e473ee72 fixed up some provision errors from the recent changes 2009-08-17 13:28:57 +10:00
Andrew Bartlett
e349316550 s4:provision Add comments to the provision script
Hopefully this will explain a bit more whey things are done the way
that they are done.

Andrew Bartlett
2009-08-17 11:47:14 +10:00
Andrew Bartlett
5f917d5f17 s4:provision Avoid one more call to ltdb_reindex
The Samba4 schema code (called via
samdb.set_schema_from_ldb(schema.ldb)) manages the @ATTRIBUTES and
@INDEXLIST records, so don't wipe them early.  The chances are that we
will not change them anyway.

Andrew Bartlett
2009-08-17 11:47:14 +10:00
Andrew Bartlett
df3ef12cf8 s4:provision Fix existing ldapi:// backend detection exception
Found by Oliver Liebel <oliver@itc.li>

Andrew Bartlett
2009-08-17 09:52:09 +10:00
Andrew Bartlett
2af06385ed s4:provision Make sure that we don't use Kerberos to our LDAP backend
This makes no sense, and just causes trouble - we are aiming for
DIGEST-MD5 or NTLM.

Andrew Bartlett
2009-08-17 09:51:01 +10:00
Andrew Bartlett
84ee0af244 s4:provison Print the LDAP backend admin username/password 2009-08-17 09:51:00 +10:00
Andrew Bartlett
e7bae2eb0a s4: Re-add --ldapadminpass as an option to provision
This should make setting up LDAP servers more predictable.

When not specified, it is random

Andrew Bartlett
2009-08-17 09:51:00 +10:00
Andrew Bartlett
052da4e4d7 s4:python Allow 'no such object' on the delete of the DN
This fixes the recursive delete in erase_partitions()

For reasons I cannot understand, it is possible to get 'no such
object' trying to delete a DN I just search for without error.  Oh
well...

Andrew Bartlett
2009-08-17 09:50:59 +10:00
Andrew Bartlett
410114e41c s4:provision Keep a single transaction for the erase and rebuild
Using a single transaction to both erase the bulk of the data and the
rebuild of that data means that the in-memory index list is
maintained, and not written out to disk until it is all compleated.
All the writes then occour at the end.

Andrew Bartlett
2009-08-17 09:50:59 +10:00
Andrew Bartlett
f87811f6b3 s4:provision Rework provision-backend into provision
This removes a *lot* of duplicated code and the cause of much
administrator frustration.  We now handle starting and stopping the
slapd (at least for the provision), and ensure that there is only one
'right' way to configure the OpenLDAP and Fedora DS backend

We now run OpenLDAP in 'cn=config' mode for online configuration.

To test what was the provision-backend code, a new --ldap-dryrun-mode
option has been added to provision.  It quits the provision just
before it would start the LDAP binaries

Andrew Bartlett
2009-08-17 09:50:58 +10:00
Andrew Bartlett
7a9030b7ce s4:provision Move helper functions back to provision
(These will be added back in a future commit)
2009-08-17 09:50:57 +10:00
Andrew Bartlett
14aff84adc s4:python Push some helper functions from SamDB into samba.Ldb
This makes it possible to do a bit more of the provision with Samba
helpers, but without some of the otherwise useful things (such as
loading in the global schema) that SamDB does.

Rewrite provision_erase to use a recursive search, rather than a
looping subtree search.  This is much more efficient, particularly now
we have one-level indexes enabled.

Delete the @INDEX and similar records *after* deleting all other
visible records, this hopefully also assists performance.

Andrew Bartlett
2009-08-17 09:50:57 +10:00
Andrew Bartlett
51d2d3df6d s4:schema Allow a schema load on an unconnected database
This helps ensure we don't load the schema too often in the provision
(allowing a reference in of the schema before the modules load).

Andrew Bartlett
2009-08-17 09:50:56 +10:00
Andrew Bartlett
346aa6e093 s4:schema Provide a way to reference a loaded schema between ldbs
This allows us to load the schema against one ldb context, but apply
it to another.  This will be useful in the provision script, as we
need the schema before we start the LDAP server backend.

Adnrew Bartlett
2009-08-17 09:50:56 +10:00
Matthias Dieter Wallnöfer
53ef426e6f s4:samdb python bindings - we don't need the attributes here 2009-08-14 01:56:34 +02:00
Matthias Dieter Wallnöfer
44dfb2902e s4: Better way to call "dom_sid_to_rid" from ldap.py 2009-08-14 00:14:15 +02:00
Matthias Dieter Wallnöfer
159a33a7d4 s4:test for "primaryGroupToken"
Tests for the right behaviour of this introduced constructed attribute.
Since we don't support the read-only-ness of those attributes yet, I commented
some lines out.
Also I had to add a function for python which converts domain SIDs in RIDs.
And a small fix for the "groupType" test.
2009-08-11 12:59:17 +02:00
Andrew Bartlett
7bc566a882 s4:provision Allow provision-backend to not run slapd for 'make test'
As the version of OpenLDAP required for Samba4 is fairly new, we don't
want to make it a requirement before this python code is run in 'make
test'.

As such, skip over the actual starting of slapd, but check the rest
runs alright (which still validates syntax and other modules).

Andrew Bartlett
2009-08-12 11:09:50 +10:00
Andrew Bartlett
6dc41bf27c s4:provision Make the --ol-slapd paramter take the full path to slapd 2009-08-12 10:01:48 +10:00
Oliver Liebel
28bcdf5266 s4:provision Rework and further automate setup of OpenLDAP backend
heres the summary of all changes/extensions:

- Andrew Bartlett's patch to generate indext
- Howard Chu's idea to use nosync on the DB included, but made optional

- slaptest-path is not needed any more (slapd -Ttest is used instead)
and is therefore removed. slapd-path is now recommended when
openldap-backend is chosen.
its also used for olc-conversion

- slapd-detection is now always done by ldapsearch (ldb module),
looking anonymous for objectClass: OpenLDAProotDSE via our ldapi_uri.

- if ldapsearch was not successfull, (no slapd listening on our socket)
slapd is
started via special generated slapdcommand_prov  (ldapi_uri only)

- slapd-"provision-process" startup is done via pythons subprocess.

- the slapd-provision-pid is stored under paths.ldapdir/slapd_provision_pid.

- after provision-backend is finished:
--- slapd.pid is compared with our stored slapd_provision_pid.
if the are unique, slapd.pid will be read out, and the
slapd "provison"-process will be shut down.
--- proper slapd-shutdown is verified again with ldb-search -> ldapi_uri
-> rootDSE.
--- if the pids are different or one of the pid-files is missing, slapd
will not be shut down,
instead an error message is displayed to locate slapd manually
--- extended help-messages (relevant to slapd) are always displayed,
e.g. the commandline with which slapd has to be started when everythings
finished
(slapd-commandline is stored under paths.ldapdir/slapd_command_file.txt))

- upgraded the content of the mini-howto (howto-ol-backend-s4.txt)
2009-08-12 10:01:48 +10:00
Matthias Dieter Wallnöfer
915b789c87 s4: Simplify two lines in the "samdb.py" file (cosmetic) 2009-08-06 12:35:47 +02:00
Jelmer Vernooij
8eff9f9a31 python: Cope with the dom_sid2 alias in pidl's python generating code.
This fixes some problems in the samr Python bindings that pidl was
(correctly) warning about.
2009-07-30 20:28:29 +02:00
Jelmer Vernooij
6768cfe624 DCE/RPC(Python): Rename py_talloc_import to py_talloc_steal.
Use py_talloc_reference in DCE/RPC code, fixes
					access to SAMR pipe.
2009-07-30 20:04:42 +02:00
Andrew Bartlett
113621d96d s4:provision We no longer add krbtgt or kpasswd account into secrets.ldb 2009-07-29 09:07:49 +10:00
Andrew Bartlett
1887ad0a26 s4:provision Fix provision on FreeBSD
We were missing the 'cn' attribute, which we then prepare a sorted
list based on.  On Linux, strcmp(NULL, NULL) does not segfault, where
it does on FreeBSD.

Reported by Timur I. Bakeyev <timur@com.bat.ru>

Andrew Bartlett
2009-07-22 18:04:58 +10:00
Jelmer Vernooij
c80783eafd Re-add accidently removed shares test. 2009-07-20 13:34:50 +02:00
Jelmer Vernooij
478446f96d Remove unnecessary imports. 2009-07-19 18:51:15 +02:00
Jelmer Vernooij
7883897b8d python: Set right ldb modules directory when using system ldb. 2009-07-18 18:39:20 +02:00
Jelmer Vernooij
d356669492 Remove pyldb_util and simply duplicate the 5-line function it contains,
rather than creating a separate shared library for it.
2009-07-18 16:11:21 +02:00
Andrew Bartlett
271b5af92e s4:dsdb Handle dc/domain/forest functional levels properly
Rather than have the functional levels scattered in 4 different,
unconnected locations, the provision script now sets it, and the
rootdse module maintains it's copy only as a cached view onto the
original values.

We also use the functional level to determine if we should store AES
Kerberos keys.

Andrew Bartlett
2009-07-16 09:23:35 +10:00
Andrew Bartlett
ba58edd0bc Add a way to set an opaque integer onto a samdb
This will allow us to set some more flags into ldb during the provision.
2009-07-16 09:23:35 +10:00
Jelmer Vernooij
4d9a929f8d s4: Remove stub endpoint mapper script. 2009-07-03 00:59:30 +02:00