summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib/param: Consolidate code to enable smb signing on the server, always ↵Andrew Bartlett2013-11-221-0/+42
| | | | | | | | | | | | | | | enable on AD DC This uses the code from the source4/ SMB server (the NTVFS smb server) in common, to force SMB Signing to be on when we are an AD DC. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Fri Nov 22 13:13:05 CET 2013 on sn-devel-104
* lib/util: use proper include for struct statChristian Ambach2013-11-211-1/+3
| | | | | | | | | | | | | use <sys/stat.h> instead of forward declaring it This fixes the build on AIX Bug: https://bugzilla.samba.org/show_bug.cgi?id=10276 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Thu Nov 21 22:12:45 CET 2013 on sn-devel-104
* replace: Fix developer build on BSD.Andreas Schneider2013-11-211-0/+1
| | | | | | | | | | This fixes bsd_attr_list() calling geteuid(). 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): Thu Nov 21 03:37:59 CET 2013 on sn-devel-104
* docs: remove duplicate mention of "ntdbtool" in ntdbtool manpage.Günther Deschner2013-11-191-4/+0
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Release ntdb 1.0.Jelmer Vernooij2013-11-162-1/+39
| | | | | Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Sat Nov 16 19:06:59 CET 2013 on sn-devel-104
* util: Remove 32bit macros breaking strict aliasing.Andreas Schneider2013-11-141-50/+2
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10269 These macros might have worked but they break strict aliasing in the meantime and so the compiler is not able to optimize the relevant code. 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): Thu Nov 14 23:16:45 CET 2013 on sn-devel-104
* ldb: Fix CID 241329 Array compared against 0Volker Lendecke2013-11-111-1/+1
| | | | | | | u.generate.remote_names is an array, not a pointer Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* iniparser: Fix CID 241908 Copy into fixed size bufferVolker Lendecke2013-11-111-3/+5
| | | | | | | strcpy is never a good idea.... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* CVE-2013-4476: lib-util: split out file_save_mode() from file_save()Björn Baumbach2013-11-112-5/+13
| | | | | | | | | file_save_mode() writes files with specified mode. 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>
* CVE-2013-4476: lib-util: add file_check_permissions()Björn Baumbach2013-11-112-0/+53
| | | | | | | 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>
* xattr: fix listing EAs on *BSD for non-root usersBjörn Jacke2013-11-081-0/+4
| | | | | | | | | | | | Thanks to Stefan Rompf for reporting. This fixes bug #10247 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 8 20:43:30 CET 2013 on sn-devel-104
* ldb: Fix CID 240798 Uninitialized pointer readVolker Lendecke2013-10-221-1/+1
| | | | | | | | | | | Not called right now, because nobody tries multiple sort attributes. But if someone did, build_response would have looked at the uninitialized controls. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 22 03:28:20 CEST 2013 on sn-devel-104
* lib/param: Add documentation on how loadparm worksAndrew Bartlett2013-10-161-0/+69
| | | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 16 11:39:41 CEST 2013 on sn-devel-104
* param: Autogenerate s3 lp_ctx glue tableAndrew Bartlett2013-10-161-0/+1
| | | | | | | | This allows us to use more lpcfg_ functions without adding them manually. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/param: Do not attempt to access the s3 function for allocated and subbed ↵Andrew Bartlett2013-10-161-11/+10
| | | | | | | | | | | | | string parameters This allows us not to generate array entries for these, which in turn allows us to avoid initialising them. The issue is that we do not have the % macro sub context nor a talloc context handy (yet). Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/param: lp_magicchar takes a const struct share_params *p so should be ↵Andrew Bartlett2013-10-162-2/+2
| | | | | | | | | | | FN_LOCAL_PARM_CHAR This was found when trying to autogenerate prototypes for lp_ functions again. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* talloc: Add a warning to talloc_reference() documentation.Andreas Schneider2013-10-141-0/+8
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Kai Blin <kai@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 14 23:05:54 CEST 2013 on sn-devel-104
* asn1: fix use-after-free in asn1_writeJeff Layton2013-10-141-1/+0
| | | | | | | | | | | | | On talloc_realloc failure, asn1_write calls talloc_free on an asn1_data pointer and then tries to immediately set the has_error flag on it. Skip the free and just set the has_error flag. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Oct 14 16:54:35 CEST 2013 on sn-devel-104
* ntdb: Make sure variables passed by value are initialized.Andreas Schneider2013-10-111-2/+3
| | | | | | | | | | This fixes a GCC warning. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Oct 11 18:05:19 CEST 2013 on sn-devel-104
* ldb:rdn_name: reject 'distinguishedName' depending of the MOD flagsStefan Metzmacher2013-10-101-2/+8
| | | | | | | | | | | | This is what Windows 2008 R2 returns: LDB_MOD_ADD => LDB_ERR_UNWILLING_TO_PERFORM LDB_MOD_REPLACE => LDB_ERR_CONSTRAINT_VIOLATION LDB_MOD_DEL => LDB_ERR_UNWILLING_TO_PERFORM Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: remove unused (and not even compiled) lib/util/capability.c.Günther Deschner2013-10-081-103/+0
| | | | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Oct 8 17:32:59 CEST 2013 on sn-devel-104
* s4-openldap: Remove use of talloc_reference in ldb_map_outbound.cNadezhda Ivanova2013-09-231-9/+13
| | | | | | | | | | Instead of referencing the values array of the element to the new element, copy them, to avoid use of talloc_reference and remove a warning of talloc_steal with reference. The issue is only relevant when openldap backend is used. Signed-off-by: Nadezhda Ivanova <nivanova@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Add LDB_MAP_RENDROP optionHoward Chu2013-09-234-8/+23
| | | | | | | | | | Like LDB_MAP_RENAME, but drop the attribute if it occurs in an Add request. Used for distinguishedName attribute, is read-only and generated but for some bizarre reason AD allows it in an Add request. Signed-off-by: Howard Chu <hyc@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
* Fix SEGV from improperly formed SUBSTRING/PRESENCE filterHoward Chu2013-09-191-1/+1
| | | | | | | | | | Signed-off-by: Howard Chu <hyc@symas.com> Reviewed-by: Simo Sorce <idra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Sep 19 01:42:43 CEST 2013 on sn-devel-104
* Cleanup map return codesHoward Chu2013-09-171-18/+17
| | | | | | | | | | -1 was never a valid LDB return code, just use OPERATIONS_ERROR Signed-off-by: Howard Chu <hyc@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Nadezhda Ivanova <nivanova@samba.org> Autobuild-Date(master): Tue Sep 17 07:51:45 CEST 2013 on sn-devel-104
* lib/ldb-samba/ldb_ildap: Also skip special base DNsAndrew Bartlett2013-09-171-0/+3
| | | | | | | This is so we do not search for @REPLCHANGED against ldap Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
* lib/param: add PROTOCOL_SMB3_02 handlingStefan Metzmacher2013-09-171-0/+1
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ldb: Show the type of failing operation in default error messageAndrew Bartlett2013-09-161-1/+26
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Fix some typos in comments.Björn Jacke2013-09-122-5/+5
| | | | | | | | | | | | Thanks to Stewart A. Levin for reporting. fixes bug #10136 (Documentation typos). Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Karolin Seeger <kseeger@samba.org> Autobuild-User(master): Karolin Seeger <kseeger@samba.org> Autobuild-Date(master): Thu Sep 12 13:54:41 CEST 2013 on sn-devel-104
* loadparm: add new parameter "acl allow execute always"Michael Adam2013-09-102-0/+11
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* ldb: Do not build libldb-cmdline when using system ldb.Jeroen Dekkers2013-09-101-4/+4
| | | | | | | | | | | | | | Cleanup leftover include and linking of libldb-cmdline in oLschema2ldif. Do not build libldb-cmdline anymore when using the system ldb, oLschema2ldif was the only reason for building libldb-cmdline. Signed-off-by: Jeroen Dekkers <jeroen@dekkers.ch> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 10 12:52:26 CEST 2013 on sn-devel-104
* tevent: Use talloc_pooled_object for tevent_req_createVolker Lendecke2013-09-081-1/+4
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun Sep 8 13:39:25 CEST 2013 on sn-devel-104
* talloc: Test the pooled objectVolker Lendecke2013-09-081-0/+36
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* talloc: Add talloc_pooled_objectVolker Lendecke2013-09-085-1/+174
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* talloc: Allow nested pools.Volker Lendecke2013-09-083-24/+52
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* talloc: Add a separate pool sizeVolker Lendecke2013-09-081-12/+23
| | | | | | | | | | | | | This is necessary to allow talloc pools to be objects on their own. It is an incompatible change in the sense that talloc_get_size(pool) now returns 0 instead of the pool size. When the talloc_pooled_object() call is added, this will start to make sense again. Maybe we should add a talloc_pool_size call? Or is that overkill? Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* talloc: Put pool-specific data before the chunkVolker Lendecke2013-09-081-79/+125
| | | | | | | This is a preparation to make talloc pool real objects themselves. Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* talloc: Introduce __talloc_with_prefixVolker Lendecke2013-09-081-10/+22
| | | | | | | | This will allow to exchange the extra talloc pool header with the talloc_chunk structure Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* talloc: Decouple the dual use of chunk->poolVolker Lendecke2013-09-081-25/+23
| | | | | | | | | | | If we want nested pools, we will have pools that are pool members. So we will have to have a separate "next object" pointer for pools. As we have struct talloc_pool_chunk now, this additional pointer does not affect normal talloc objects. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Fix valgrind errors with memmove and talloc pools.Jeremy Allison2013-08-281-0/+21
| | | | | | | | | | bin/smbtorture //127.0.0.1 local.talloc now runs with no valgrind errors. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Aug 28 02:44:17 CEST 2013 on sn-devel-104
* Add simple limited pool tests to test_memlimit().Jeremy Allison2013-08-271-0/+27
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Remove talloc_memlimit_update(). No longer used.Jeremy Allison2013-08-271-24/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Inside _talloc_realloc(), keep track of size changes over malloc/realloc/free.Jeremy Allison2013-08-271-4/+15
| | | | | | | | Replace the last use of talloc_memlimit_update() with talloc_memlimit_grow()/ talloc_memlimit_shrink(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Don't call talloc_memlimit_update() inside _talloc_realloc() when we're just ↵Jeremy Allison2013-08-271-15/+0
| | | | | | | manipulating pool members. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Fix a conditional check. (size - tc->size > 0) is always true if size and ↵Jeremy Allison2013-08-271-1/+1
| | | | | | | | | tc->size are unsigned. Replace with (size > tc->size). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* In _talloc_steal_internal(), correctly decrement the memory limit in the ↵Jeremy Allison2013-08-271-12/+5
| | | | | | | source, and increment in the destination. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Inside _talloc_free_internal(), always call talloc_memlimit_update_on_free() ↵Jeremy Allison2013-08-271-23/+4
| | | | | | | before we free the real memory. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Update memory limits when we call free() on a pool.Jeremy Allison2013-08-271-0/+2
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Change __talloc() to only call ↵Jeremy Allison2013-08-271-12/+9
| | | | | | | | | | talloc_memlimit_check()/talloc_memlimit_grow() on actual malloc allocation. Don't check the memlimit if the allocation was successful from a pool. We already checked the memory limit when we created the pool. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Change _talloc_total_mem_internal() to ignore memory allocated from a pool ↵Jeremy Allison2013-08-271-1/+8
| | | | | | | | | when calculating limit size. We must only count normal tallocs, or a talloc pool itself. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>