1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-18 00:23:50 +03:00
Commit Graph

157 Commits

Author SHA1 Message Date
Jelmer Vernooij
9a188eb1f4 r13840: Mark some functions as public. 2007-10-10 13:52:14 -05:00
Simo Sorce
b4202cf030 r13823: make async_wait part of the modules ops 2007-10-10 13:52:13 -05:00
Andrew Tridgell
4257fd91ce r13803: fixed two errors found with 'make valgrindtest' 2007-10-10 13:52:12 -05:00
Jelmer Vernooij
52a2356505 r13786: [merge] Add registration functions for LDB modules
Applications that use LDB modules will now have to run ldb_global_init()
before they can use LDB.

The next step will be adding support for loading LDB modules from .so
files. This will also allow us to use one LDB without difference between the
standalone and the Samba-specific build
2007-10-10 13:52:11 -05:00
Andrew Tridgell
68c9ac38c7 r13700: added highestCommittedUSN, uSNChanged and uSNCreated support, using
the @BASEINFO sequenceNumber

(simo, I changed the function pointer to a structure element as you
preferred)
2007-10-10 13:52:06 -05:00
Andrew Bartlett
424df1bb36 r13616: Add new ldb functions: ldb_msg_add_steal_string() and
ldb_msg_add_steal_value().

These try to maintain the talloc heirachy, which must be correct
otherwise talloc_steal operations of entire attribute lists fails.

This fixes the currentTime value, found by using Microsoft's dcdiag
tool (before this commit, it pointed to invalid memory, due to the
changes in -r 13606)

Andrew Bartlett
2007-10-10 13:51:59 -05:00
Simo Sorce
d5b467b7c1 r13615: Make ldb_set_errstring get ldb instead of module as parameter.
The module was just used to get to the ldb so it was meningless.

Also add LDB_WAIT_ONCE e relative code in ldb_ildap.c
2007-10-10 13:51:59 -05:00
Andrew Bartlett
d0b8957f38 r13606: An attempt to fix #3525.
The problem was that the supportedControls were being stolen into the
result sent to the client, then talloc_free()ed.  This caused them to
be invalid on the next rootDSE query.

This also tries to avoid attaching the result to the long-term samdb
context, and avoids an extra loop in the result processing (pointed
out by tridge).

Andrew BARtlett
2007-10-10 13:51:59 -05:00
Stefan Metzmacher
a1bbf7f298 r13507: the 'data' element of LDAP controls is optional.
(prepare the next commit)

metze
2007-10-10 13:51:56 -05:00
Simo Sorce
bec99c5cb6 r13353: Fix a crash bug in rootdse when we do not pass in credentials
a plain ldbsearch would just crash

Fix kludge_acl, not passing on the second stage registration
phase to other modules

Simo
2007-10-10 13:51:48 -05:00
Andrew Bartlett
2aa9fefbb3 r13282: Indentation, and ensure we handle the talloc_free in the right place
all the time.

Andrew Bartlett
2007-10-10 13:51:42 -05:00
James Peach
6e55241a84 r13264: Move declaration before code. 2007-10-10 13:51:40 -05:00
Andrew Bartlett
53efb3e3e9 r13256: Free temporary memory on error cases, and try to clean up what's left
earlier.

Move gendb_search() to use talloc_vasprintf() and steal only the parts
actually being used for the results.

Andrew Bartlett
2007-10-10 13:51:39 -05:00
Andrew Bartlett
35517573ff r13253: More work to ensure that we don't keep data on long-term contexts.
Andrew Bartlett
2007-10-10 13:51:38 -05:00
Andrew Bartlett
c6eb74f429 r13252: Cleanup, both in code, comments and talloc use:
In particular, I've used the --leak-report-full option to smbd to
track down memory that shouldn't be on a long-term context.  This is
now talloc_free()ed much earlier.

Andrew Bartlett
2007-10-10 13:51:38 -05:00
Andrew Bartlett
b0b150d08a r13207: Use the new API for using/not using kerbeors in hdb-ldb.c
Update the rootdse module to use the new schema.

Andrew Bartlett
2007-10-10 13:51:34 -05:00
Andrew Bartlett
c34666abc1 r13150: Correct comment.
Andrew Bartlett
2007-10-10 13:51:29 -05:00
Andrew Bartlett
7a9c8eee4b r12998: A big update to samldb.c
This updates the module to handle both SID allocation and nextRid
updating while importing users.  (As imported users already have a
SID, so don't go via the allocation step).  We also ensure that SIDs
in the database are unquie at create time.

Furthermore, at allocation time, we double-check the SID isn't already
in use, and that we don't create a foriegnSecurityPrincipal for a
'local' sid.

Also create random samAccountName entries for users without one (we
were setting $000000-000000000000).

We may want to seperate the uniqueness code from the rest of samldb,
and into a module with the objectguid code, which needs similar
checks.  These checks also need to apply to modification, or those
modifications denied outright.

Also update part of the testsuite to validate this.

Andrew Bartlett
2007-10-10 13:51:15 -05:00
Andrew Bartlett
4d69eae382 r12996: Restrict this search to domain objects.
Andrew Bartlett
2007-10-10 13:51:15 -05:00
Andrew Bartlett
ffe9042e15 r12943: Generate a SID for the domain join account using the modules, rather
than a hardcoded SID.

Fix the samldb module to return the what *was* the nextrid, rather
than the new nextrid (that is for next time).

Andrew Bartlett
2007-10-10 13:51:11 -05:00
Andrew Bartlett
26946c90e8 r12895: Error strings save lives.
err, they save time at least.  The correct use of an error string in
this case quickly pinpoited an overzealous check, and saved me hours
of painful debugging.

Andrew Bartlett
2007-10-10 13:50:59 -05:00
Andrew Bartlett
daa4b76800 r12860: Remove unused function. (we handle this in the password_hash module).
Andrew Bartlett
2007-10-10 13:50:54 -05:00
Jelmer Vernooij
61ae77beec r12851: Fix some typos 2007-10-10 13:50:53 -05:00
Stefan Metzmacher
976052c656 r12842: don't include system headers directly
metze
2007-10-10 13:50:05 -05:00
Andrew Bartlett
36c1f67f12 r12818: When denying an operation, include what we think the username is in
the error message.

Andrew Bartlett
2007-10-10 13:50:01 -05:00
Stefan Metzmacher
1253784c92 r12773: - remove unused variable, fix the build with some old compilers
metze
2007-10-10 13:49:53 -05:00
Simo Sorce
2f0c7b8962 r12769: Make ldb_next_request() evident, I was much confused on first sight
Simo.
2007-10-10 13:49:52 -05:00
Andrew Bartlett
46628e86a2 r12763: Oops. If you call ldb_search from within an ldb module's search
request handler, you really have to watch the recursion issues...

Andrew Bartlett
2007-10-10 13:49:51 -05:00
Andrew Bartlett
1fbe09ce81 r12762: Simo correctly asked that the policy logic (which attributes contain
passwords) be moved into the database, and not be hard-coded in the
module source.

Andrew Bartlett
2007-10-10 13:49:51 -05:00
Andrew Bartlett
be9d0cae89 r12746: An initial version of the kludge_acls module.
This should be replaced with real ACLs, which tridge is working on.
In the meantime, the rules are very simple:

- SYSTEM and Administrators can read all.

- Users and anonymous cannot read passwords, can read everything else

- list of 'password' attributes is hard-coded

Most of the difficult work in this was fighting with the C/js
interface to add a system_session() all, as it still doesn't get on
with me :-)

Andrew Bartlett
2007-10-10 13:49:48 -05:00
Simo Sorce
5e8b365fa2 r12743: Remove the ugly way we had to make a second stage init and introduce
a second_stage_init private function for modules that need a second stage init.

Simo.
2007-10-10 13:49:48 -05:00
Simo Sorce
77125feaff r12733: Merge ldap/ldb controls into main tree
There's still lot of work to do but the patch is stable
enough to be pushed into the main samba4 tree.

Simo.
2007-10-10 13:49:47 -05:00
Andrew Bartlett
8e608dd4bf r12720: By metze's request, rename the ntPwdHistory attribute to
sambaNTPassword.  Likewise lmPwdHistory -> sambaLMPwdHistory.

The idea here is to avoid having conflicting formats when we get to
replication.  We know the base data matches, but we may need to use a
module to munge formats.

Andrew Bartlett
2007-10-10 13:49:45 -05:00
Andrew Bartlett
097d9d0b7f r12719: Rename unicodePwd -> sambaPassword.
Because we don't know the syntax of unicodePwd, we want to avoid using
that attribute name.  It may cause problems later when we get
replication form windows.

I'm doing this before the tech preview, so we don't get too many
supprises as folks upgrade databases into later versions.

Andrew Bartlett
2007-10-10 13:49:45 -05:00
Andrew Bartlett
356c8c5609 r12716: Tridge points out that the request argument to ldb_next_request must
be a valid talloc() pointer, as other modules may rely on this.

Andrew Bartlett
2007-10-10 13:49:44 -05:00
Andrew Bartlett
4b67b5d688 r12687: Push the real list of supported GENSEC mechanisms out on
supportedSASLMechanism in the rootdse.  (Second half of a patch
commited earlier today).

Andrew Bartlett
2007-10-10 13:49:38 -05:00
Jelmer Vernooij
f9eede3d40 r12670: Make a couple of dependencies stricter
Re-introduce and use the OUTPUT_TYPE property for MODULEs to force
specific modules to always be included
2007-10-10 13:49:35 -05:00
Jelmer Vernooij
c297c93faf r12658: Couple of fixes related to shared module builds. 2007-10-10 13:49:35 -05:00
Jelmer Vernooij
70e7449318 r12608: Remove some unused #include lines. 2007-10-10 13:49:03 -05:00
Andrew Bartlett
e902274321 r12599: This new LDB module (and associated changes) allows Samba4 to operate
using pre-calculated passwords for all kerberos key types.
(Previously we could only use these for the NT# type).

The module handles all of the hash/string2key tasks for all parts of
Samba, which was previously in the rpc_server/samr/samr_password.c
code.  We also update the msDS-KeyVersionNumber, and the password
history.  This new module can be called at provision time, which
ensures we start with a database that is consistent in this respect.

By ensuring that the krb5key attribute is the only one we need to
retrieve, this also simplifies the run-time KDC logic.  (Each value of
the multi-valued attribute is encoded as a 'Key' in ASN.1, using the
definition from Heimdal's HDB.  This simplfies the KDC code.).

It is hoped that this will speed up the KDC enough that it can again
operate under valgrind.
2007-10-10 13:49:01 -05:00
Andrew Bartlett
0aaff059ba r12598: Make the 'objectClass' part of the templating process actually work.
We need to add to the multivalued objectClass, not ignore it because
the user has already specified a value.

Also rename the template again.

This was caught by more stringent tests in the unicodePwd module, but
breaks MMC.  A later commit will sort the objectClass.

Andrew Bartlett
2007-10-10 13:49:01 -05:00
Jelmer Vernooij
ca8db1a0cd r12592: Remove some useless dependencies 2007-10-10 13:49:00 -05:00
Jelmer Vernooij
0aca5fd513 r12542: Move some more prototypes out to seperate headers 2007-10-10 13:47:55 -05:00
Jelmer Vernooij
b24f2583ed r12498: Eliminate INIT_OBJ_FILES and ADD_OBJ_FILES. We were not using
the difference between these at all, and in the future the
fact that INIT_OBJ_FILES include smb_build.h will be sufficient to
have recompiles at the right time.
2007-10-10 13:47:45 -05:00
Andrew Bartlett
c4520ba2e6 r12427: Move SAMR CreateUser2 to transactions, and re-add support for
different computer account types.  (Earlier code changes removed the
BDC case).

We don't use the TemplateDomainController, so just have a
TemplateServer in provision_templates.ldif

Andrew Bartlett
2007-10-10 13:47:37 -05:00
Andrew Bartlett
d61817ebb7 r12382: Ensure to return OK on anonymous mapping.
Andrew Bartlett
2007-10-10 13:47:33 -05:00
Andrew Bartlett
5ac4178e36 r12381: Try not to segfault on an anonymous LDAP bind, and map to a guest login.
Andrew Bartlett
2007-10-10 13:47:32 -05:00
Andrew Tridgell
53f0fb77c3 r12363: minor fixes for win2000 join/login
- the objectClass needs to be added to the list of attributes to make
   the check for objectClass=computer work

 - the short version of the name needs to be used for the 'cn' in
   cracknames
2007-10-10 13:47:31 -05:00
Andrew Bartlett
8308cf6e04 r12361: Add a new function: ldb_binary_encode_string()
This is for use on user-supplied arguments to printf style format
strings which will become ldb filters.  I have used it on LSA, SAMR
and the auth/ code so far.

Also add comments to cracknames code.

Andrew Bartlett
2007-10-10 13:47:30 -05:00
Andrew Bartlett
e751d81414 r12360: Add simple bind support into our LDAP server.
Needs changes to our client code for automated testing.

Andrew Bartlett
2007-10-10 13:47:30 -05:00