summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
Commit message (Collapse)AuthorAgeFilesLines
* s4:dsdb/common: add samdb_domain_guid() helper functionStefan Metzmacher2018-09-051-0/+55
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 0e442e094240abbf79aaca00a9d1a053a200a7e8)
* dsdb:util_trusts: add dsdb_trust_local_tdo_info() helper functionStefan Metzmacher2018-09-051-0/+16
| | | | | | | | | | | This is similar to dsdb_trust_xref_tdo_info(), but will also work if we ever support more than one domain in our forest. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit c1b0ac95db5c6112d90356c7ada8c3d445e9b668)
* dsdb/util_trusts: domain_dn is an input parameter of ↵Stefan Metzmacher2018-09-051-6/+0
| | | | | | | | | | | | | | dsdb_trust_crossref_tdo_info() We should not overwrite it within the function. Currently it doesn't matter as we don't have multiple domains within our forest, but that will change in future. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit f5f96f558b499770cdeb3d38998167a387e058b9)
* s4:dsdb: add dsdb_trust_domain_by_{sid,name}()Stefan Metzmacher2018-02-271-0/+222
| | | | | | | | | | | | | This gets the lsa_ForestTrustDomainInfo for the searched domain as well as the lsa_TrustDomainInfoInfoEx for the direct trust (which might be the same for external trust or the forest root domain). Bug: https://bugzilla.samba.org/show_bug.cgi?id=13286 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit e9ace1852ff88ebb7778e8db9a49bc5c61512d16)
* s4:dsdb: add dsdb_trust_search_tdo_by_sid() helper functionStefan Metzmacher2018-01-131-0/+65
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* Update util.c to include DBGC_AUTH classkkplein2018-01-081-2/+2
| | | | | | Signed-off-by: Mourik Jan C Heupink <heupink@merit.unu.edu> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* drs: Add basic GET_TGT supportTim Beale2017-09-181-0/+40
| | | | | | | | | | | | | | | | | | | | | | This adds basic DRS_GET_TGT support. If the GET_TGT flag is specified then the server will use the object cache to store the objects it sends back. If the target object for a linked attribute is not in the cache (i.e. it has not been sent already), then it is added to the response message. Note that large numbers of linked attributes will not be handled well yet - the server could potentially try to send more than will fit in a single repsonse message. Also note that the client can sometimes set the GET_TGT flag even if the server is still sending the links last. In this case, we know the client supports GET_TGT so it's safe to send the links interleaved with the source objects (the alternative of fetching the target objects but not sending the links until last doesn't really make any sense). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Add missing \n to debugAndrew Bartlett2017-09-071-1/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* dsdb: Add comment showing where the normal password rules are appliedAndrew Bartlett2017-08-301-0/+5
| | | | | | | This looks like a footnote, but is actually where the default password rules are applied. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* dsdb: Add a samdb_dns_host_name which avoids searchingGarming Sam2017-06-221-0/+47
| | | | | | | This ideally should also be used in rootDSE. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb: Ensure replication of renames works in schema partitionAndrew Bartlett2017-06-151-0/+13
| | | | | | | | | | | | This caused failures against vampire_dc (on large-dc), likely due to more frequent replication propagating the record before it was renamed. The DC ran out of RIDs and RID allocation causes schema replication, which failed. Signed-off-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12841 Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Allow parsed_dn_find to have a prefixed blob matchGarming Sam2017-03-132-1/+13
| | | | | | | | This allows us to search against binary DN using only the attributeID in the case of msDS-RevealedUsers (as it appears right at the beginning). Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb: Move parsed_dn_find into a common locationGarming Sam2017-03-132-0/+241
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Correct "hexidecimal" typos.Chris Lamb2017-02-221-1/+1
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* source4: Change to use lib/util/access functions.Jeremy Allison2016-11-161-1/+2
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12419 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Nov 16 16:35:12 CET 2016 on sn-devel-144
* werror: replace WERR_GENERAL_FAILURE with WERR_GEN_FAILURE in ↵Günther Deschner2016-09-281-1/+1
| | | | | | | | | source4/dsdb/common/util.c Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb: Avoid ldb_dn_validate() call on trusted input when not requiredAndrew Bartlett2016-09-271-4/+20
| | | | | | | | | | | | | This call is very costly, because of the time required to strictly check the syntax of the extended DN components. This allows a 20% decrease in time taken for some link-heavy tests. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Sep 27 20:47:34 CEST 2016 on sn-devel-144
* dsdb: Do not use free'd memory.Andreas Schneider2016-09-091-1/+1
| | | | | | | | The msg has already been free'd at this point so we need to print the user_dn which gets assigned to msg->dn. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb: Rework kcc_deleted() into dsdb_garbage_collect_tombstones()Andrew Bartlett2016-09-011-0/+10
| | | | | | | | | | | This is so that in a future commit, we can wrap this in python and allow it to be called from outside the samba server processs. This requires that we rework the callers and internals to avoid reference to private data structures of the KCC service. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: Limit potential stack use when parsing extended DNsAndrew Bartlett2016-07-281-9/+15
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb: add vanish links controlDouglas Bagnall2016-07-152-16/+24
| | | | | | | | | | | | Normally linked attributes are deleted by marking them as with RMD flags, but sometimes we want them to vanish without trace. At those times we set the DSDB_CONTROL_REPLMD_VANISH_LINKS control. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: prepare dsdb_user_obj_set_defaults() for tombstone reanimationStefan Metzmacher2016-07-091-14/+47
| | | | | | | | accountExpires gets a different value, logonHours is not updated, operatorCount and adminCount are added. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: add a replication metadata stamp for an empty logonHours ↵Stefan Metzmacher2016-07-081-3/+21
| | | | | | | | | | attribute When a user object is created it gets a metadata stamp for logonHours, while the logonHours attribute has no value. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb: Add missing header file for write() and close()Andreas Schneider2016-07-061-0/+1
| | | | | | | This fixes compilation with gcc 4.8.5. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* check_password_script: Add a DEBUG message for timeoutsBob Campbell2016-07-051-12/+35
| | | | | | Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* check-password-script: Allow AD to execute these scriptsGarming Sam2016-07-051-1/+60
| | | | | | | In contrast to source3, this is run as root and without substitution. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb: add some const to {samdb_result,dsdb}_effective_badPwdCount()Stefan Metzmacher2016-06-301-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: remove unused samdb_result_force_password_change()Stefan Metzmacher2016-06-301-39/+0
| | | | | | | | | | The logic is incomplete and the correct logic is already available via the constructed "msDS-UserPasswordExpiryTimeComputed" attribute. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: add some const to helper functionsStefan Metzmacher2016-06-271-3/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=9654 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/samldb: add DSDB_CONTROL_PASSWORD_DEFAULT_LAST_SET_OID when ↵Stefan Metzmacher2016-06-271-5/+38
| | | | | | | | | defaulting pwdLastSet=0 BUG: https://bugzilla.samba.org/show_bug.cgi?id=9654 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb: Avoid talloc() calls in dsdb_get_extended_dn_*()Andrew Bartlett2016-06-271-18/+14
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4-dsdb: Fix a possible NULL pointer dereferenceAndreas Schneider2016-06-221-1/+3
| | | | | | | Detected by clang compiler. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* repl: Allow GetNCChanges DRSUAPI_EXOP_REPL_OBJ to succeed against a deleted ↵Andrew Bartlett2016-06-061-1/+1
| | | | | | | object Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dsdb/common/util: be careful about zero length string listsDouglas Bagnall2016-05-101-1/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb/common/util: remove some unnecessary str_list_length()sDouglas Bagnall2016-05-101-2/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dlist: remove unneeded type argument from DLIST_ADD_END()Michael Adam2016-02-061-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-dsdb: Add debug message if we have a ldb error stringAndreas Schneider2016-02-021-0/+1
| | | | | | | | | | | | | | When trying to change the password with kpasswd, the KDC returns "Unspecified password quality failure". Because we do not get the ldb error which is e.g.: password is too young to change! This way at least the admin can find out what is going on. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Feb 2 11:49:51 CET 2016 on sn-devel-144
* s4:dsdb/common: make it possible to find a reason for LDB_ERR_NO_SUCH_OBJECTStefan Metzmacher2016-02-011-9/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s4:dsdb/common: add dsdb_module_werror() helper functionStefan Metzmacher2016-02-012-0/+21
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s4:dsdb/common: add some const to dsdb_dn_is_upgraded_link_val()Stefan Metzmacher2016-02-011-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib: Convert callers of sid_blob_parse to sid_parseVolker Lendecke2015-08-261-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CID 1311772: Fix null pointer checkAndreas Schneider2015-07-151-1/+1
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 15 04:50:36 CEST 2015 on sn-devel-104
* CID 1311771: Fix a null pointer dereferenceAndreas Schneider2015-07-151-1/+1
| | | | | | | We check for dir == NULL but dereference it during variable declaration. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CID 1311767: Cast enum type to avoid compiler warningsAndreas Schneider2015-07-151-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CID 1311764: Fix logical compare in if clauseAndreas Schneider2015-07-151-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:dsdb/common: add dsdb_trust_merge_forest_info() helper functionStefan Metzmacher2015-07-081-0/+418
| | | | | | | | | | | This is used to merge the netr_GetForestTrustInformation() result with the existing information in msDS-TrustForestTrustInfo. New top level names are added with LSA_TLN_DISABLED_NEW while all others keep their flags. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: dsdb_trust_normalize_forest_info_step[1,2]() and ↵Stefan Metzmacher2015-07-081-0/+752
| | | | | | | | | | | | | | | | | | | | dsdb_trust_verify_forest_info() These will be used in dcesrv_lsa_lsaRSetForestTrustInformation() in the following order: - dsdb_trust_normalize_forest_info_step1() verifies the input forest_trust_information and does some basic normalization. - the output of step1 is used in dsdb_trust_verify_forest_info() to verify overall view of trusts and forests, this may generate collision records and marks records as conflicting. - dsdb_trust_normalize_forest_info_step2() prepares the records to be stored in the msDS-TrustForestTrustInfo attribute. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: add dsdb_trust_xref_tdo_info() helper functionStefan Metzmacher2015-07-081-0/+20
| | | | | | | This emulates a lsa_TrustDomainInfoInfoEx struct for our own domain. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: add dsdb_trust_forest_info_from_lsa() helper functionStefan Metzmacher2015-07-081-0/+103
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/common: add dsdb_trust_get_incoming_passwords() helper functionStefan Metzmacher2015-07-081-0/+116
| | | | | | | | This extracts the current and previous nt hashes from trustAuthIncoming as the passed TDO ldb_message. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>