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

162 Commits

Author SHA1 Message Date
Matthias Dieter Wallnöfer
07af3f289e s4:samdb_set_password - return "NT_STATUS_WRONG_PASSWORD" when a user account doesn't exist
This is for the (SAMR) account detection protection mechanism.
2010-08-14 18:48:20 +02:00
Matthias Dieter Wallnöfer
303089f5b8 s4:dsdb/common/util.c - provide a call which returns the forest function level
Sooner or later we'll need this too since not all operations depend only on the
current's domain function level (see the MS-ADTS docs).
2010-08-10 19:08:56 +02:00
Matthias Dieter Wallnöfer
e53fc1228f s4:dsdb/common/util.c - use LDB constants whenever possible 2010-08-10 19:08:56 +02:00
Matthias Dieter Wallnöfer
25e973d5db s4:dsdb/common/util.c - add a function "dsdb_add" 2010-08-07 14:22:41 +02:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Andrew Tridgell
87df785a68 s4-dsdb: use ldb_operr() in the dsdb code
this replaces "return LDB_ERR_OPERATIONS_ERROR" with "return ldb_operr(ldb)"
in places in the dsdb code where we don't already explicitly set an
error string. This should make is much easier to track down dsdb
module bugs that result in an operations error.
2010-07-07 20:14:55 +10:00
Matthias Dieter Wallnöfer
9c8135785a s4:dsdb - samdb_result_force_password_change - also when "pwdLastSet" is "-1" we shouldn't force a password change
This value is set by the ADUC console.
2010-07-06 21:54:20 +02:00
Nadezhda Ivanova
5a18fc2b2a Implementation of self membership validated right.
When this right is granted, the user can add or remove themselves from a group even
if they dont have write property right.
2010-06-28 10:43:50 +03:00
Matthias Dieter Wallnöfer
c38f94ed9b s4:dsdb_load_partition_usn - free the right memory context (tmp_ctx) 2010-06-21 11:10:02 +02:00
Matthias Dieter Wallnöfer
87d0f63632 s4:dsdb - add a new dsdb delete function which understands the tree delete control 2010-06-20 18:52:29 +02:00
Andrew Bartlett
8ea4118472 s4:dsdb Add const to dsdb_dn functions that operate on an ldb_val.
Andrew Bartlett
2010-06-15 10:53:50 +10:00
Matthias Dieter Wallnöfer
cadf774f8b s4:dsdb/common/util.c - provide a better implementation of the "samdb_msg_add_(add/del)val" calls
This supports now also coexisting add and delete message elements with the
same attribute name.
2010-06-06 20:47:10 +02:00
Matthias Dieter Wallnöfer
0fce829de4 s4:dsdb_load_udv_v1 - "uint32_t" counter type fits better than "unsigned int" 2010-05-31 22:43:28 +02:00
Matthias Dieter Wallnöfer
f927881028 s4:dsdb/common/util.c - fix a counter variable 2010-05-30 20:52:10 +02:00
Andrew Bartlett
e0d141bd46 s4:dsdb Allow a NULL search expression in dsdb_search()
The NULL search expression expands to (objectClass=*), but %s expands
NULL to (NULL) which doesn't parse...

Andrew Bartlett
2010-05-24 23:08:11 +10:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Anatoliy Atanasov
26d41c23f6 s4-rodc: Cache am_rodc flag 2010-05-17 13:30:27 +03:00
Stefan Metzmacher
11730520a7 s4:dsdb: fix samdb_result_logon_hours() and don't hardcode units_per_week
metze
2010-05-13 19:12:42 +02:00
Stefan Metzmacher
7e49fd92ca s4:dsdb: cached results of samdb_rodc()
metze
2010-05-11 18:11:06 +02:00
Matthias Dieter Wallnöfer
029351571a s4:samdb_set_password - adapt it for the user password change handling
Make use of the new "change old password checked" control.
2010-05-10 19:12:26 +02:00
Matthias Dieter Wallnöfer
6e8098b261 s4:samdb_set_password/samdb_set_password_sid - Rework
Adapt the two functions for the restructured "password_hash" module. This
means that basically all checks are now performed in the mentioned module.

An exception consists in the SAMR password change calls since they need very
precise NTSTATUS return codes on wrong constraints ("samr_password.c") file
2010-05-10 19:07:46 +02:00
Matthias Dieter Wallnöfer
946993238f s4:dsdb/util.c - Add a new function for retrieving password change attributes
This is needed since we have not only reset operations on password fields
(attributes marked with REPLACE flag) but also change operations which can be
performed by users itself. They have one attribute with the old value marked
with the REMOVE flag and one with the new one marked with the ADD flag.
This function helps to retrieve them (argument "new" is used for the new
password on both reset and change).
2010-05-10 12:20:27 +02:00
Andrew Bartlett
6dfa851ce9 s4:dsdb Provide an intelegent fallback if not CN=Subnets is found
We may as well fall back rather than return NULL (which callers don't
do useful things with).

Andrew Bartlett
2010-05-09 21:18:52 +10:00
Anatoliy Atanasov
f84aeea739 s4/rodc: Support read-only database
Check on modify if we are RODC and return referral.
On the ldap backend side now we pass context and ldb_modify_default_callback
to propagate the referral error to the client.
2010-05-04 18:32:18 +02:00
Anatoliy Atanasov
d3081741c9 s4/rodc: Implement msDS-isRODC constructed attr 2010-05-03 18:28:00 +02:00
Anatoliy Atanasov
dbbbc7d1f8 s4/rodc: RODC FAS initial implementation 2010-04-29 10:18:06 +03:00
Kamen Mazdrashki
bf49ac99c9 s4/dsdb: dsdb_validate_invocation_id() should validate by objectGUID
This function is used in DRSUpdateRefs() implementation where we
get DSA's objectGUID rather than invocationId
2010-04-28 12:11:03 +03:00
Stefan Metzmacher
4d191b6fa7 s4:dsdb/common: if we don't have the ip of the client return the server site as client site
metze
2010-04-27 13:00:24 +02:00
Matthias Dieter Wallnöfer
093d35661d s4:util - add a function which finds the matching client site using the client address
The lookup of the client site is done using the subnets in the configuration
partition. If no one matches we use the Windows Server fallback mechansim.
This means: if only one site is available just use it. If they're more set the
output variable to "".

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-27 15:24:41 +10:00
Andrew Tridgell
1f92df90fd s4-drs: removed dsdb_validate_client_flags()
This test is in the wrong place. We end up validating our own flags.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-22 19:36:16 +10:00
Andrew Tridgell
a06b537cc3 s4-dsdb: added dsdb_validate_invocation_id()
this validates that a invocationID matches an account sid

This will be used to ensure that we don't allow DRS replication
from someone a non-DC or administrator

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-22 19:36:16 +10:00
Andrew Tridgell
1ecefd74a2 s4-dsdb: added dsdb_get_extended_dn_sid()
This will be used by the RODC code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
73513fb7e7 s4-drs: Use new samdb_rodc() function in s4 code
This patch fits the calling to the new samdb_rodc() function and
fix a little bug in this function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
fbdbd67c76 s4-drs: dsdb_validate_client_flags() function
This function is intended to check if some client is not lying about
his flags. At this moment, it only checks for RODC flags.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
57bcdf008f s4-drs: samdb_is_rodc() function and new samdb_rodc() function
This patch creates the samdb_is_rodc() function, which looks for
the NTDSDSA object for a DC that has a specific invocationId
and if msDS-isRODC is present on such object and it is TRUE, then
consider the DC as a RODC.
The new samdb_rodc() function uses the samdb_is_rodc() function
for the local server.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Andrew Bartlett
ea5cf7ce05 s4:provision Pass in the invoication ID and NTDS Settings DN to Schema()
By putting these values into the cache on the LDB, this reduces some
of the noise in provision, particularly with the LDAP backend.

Andrew Bartlett
2010-04-20 12:11:18 +10:00
Matthias Dieter Wallnöfer
34ff1c6944 s4:samdb_server_site_name - fix indentation 2010-04-13 15:40:43 +02:00
Matthias Dieter Wallnöfer
719a46913b s4:dsdb/common/util.c - add a call which determines centrally the forest DNS domainname 2010-04-13 09:32:33 +02:00
Matthias Dieter Wallnöfer
c116d80053 s4:remove "samdb_root_dn", "samdb_base_dn", "samdb_config_dn" and "samdb_schema_dn"
They aren't needed anymore.
2010-04-13 08:57:07 +02:00
Matthias Dieter Wallnöfer
ad9e407357 Revert "s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions"
We should use the "ldb_get_*_basedn" calls since they are available in the LDB
library.
2010-04-13 08:55:15 +02:00
Matthias Dieter Wallnöfer
568ca2433d s4:samdb_server_site_dn - free unused DNs in the right way 2010-04-11 13:20:44 +02:00
Andrew Bartlett
d0b54476fc s4:dsdb Move dsdb_save_partition_usn() to be a module helper function
This function should not traverse the module stack again, but instead
run from this point.  Also add a matching
dsdb_module_load_partition_usn() and change repl_meta_data to match.

Andrew Bartlett
2010-03-22 20:24:41 +11:00
Nadezhda Ivanova
deebbe7cfa A helper function to get the Infrastructure DN. 2010-03-09 14:56:46 +02:00
Matthias Dieter Wallnöfer
61ae4be256 s4:dsdb/util - Change also here counters to "unsigned"
No need to have "signed" counters at those places.
2010-03-05 18:30:08 +01:00
Anatoliy Atanasov
b73437fbaa s4/rodc: Implement samdb_rodc with ldb context 2010-03-01 14:17:32 +02:00
Andrew Tridgell
64911507a0 s4-dsdb: fixed the fetch of the server site name
when the ntds objects were moved by a recent change it broke the
calculation of the server site

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-26 13:22:12 +11:00
Matthias Dieter Wallnöfer
eca8697d61 s4:dsdb/util.c - Use LDB result constants in some more helper functions
Always better to rely on the standards rather than on custom results.
2010-02-21 21:43:47 +01:00
Andrew Tridgell
018fb2d1ae s4-dsdb: return LDB_ERR_CONSTRAINT_VIOLATION on num_recs != 1
In a single record search, LDB_ERR_CONSTRAINT_VIOLATION is more useful
than the generic LDB_ERR_OPERATIONS_ERROR

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:52 +11:00
Andrew Tridgell
b630530730 s4-dsdb: added dsdb_search_one() and cleanup dsdb_find_dn_by_guid()
dsdb_find_dn_by_guid() now takes a struct GUID instead of a
guid_string. All the callers in fact wanted a struct GUID, so we now
avoid the extra conversion.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00
Andrew Tridgell
8f4a34272e s4-dsdb: replace dsdb_find_dn_by_guid() with a dsdb_search() call
much simpler code by using dsdb_flags

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00