summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
2010-05-07Make us pass all SMB2 lock tests except MULTIPLE-UNLOCK and CONTEXT. Them ↵Jeremy Allison1-1/+3
next :-). Jeremy.
2010-05-06s3-eventlog: move all eventlog headers to lib/eventlog and only include ↵Günther Deschner3-0/+79
where required. Guenther
2010-05-06Remove the copy of ldb from Samba 3.Jelmer Vernooij132-38549/+246
There were two utility functions that other parts of Samba 3 still relied on; they have been moved to lib/ldb_compat.[ch].
2010-05-06s3: only include gen_ndr headers where needed.Günther Deschner6-2/+4
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time as follows: ccache build w/o patch real 4m21.529s ccache build with patch real 3m6.402s pch build w/o patch real 4m26.318s pch build with patch real 3m6.932s Guenther
2010-05-04s3-lib: Create a sec_desc_merge and sec_desc_merge_buf function.Andreas Schneider1-1/+42
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-27s3: use shared registry functions.Günther Deschner1-142/+0
Guenther
2010-04-23s3-time: Added a function to get the startup time of the server.Andreas Schneider1-0/+13
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-11s3: Move sanitize_username to lib/util_str.cVolker Lendecke1-0/+8
2010-04-10s3: Use IS_DC macro in get_global_sam_name()Volker Lendecke1-1/+1
Much as I dislike macros, this one is there. So why not use it...
2010-04-09s3: add iconv_convenience handle to pull/push sz helpers.Günther Deschner2-11/+15
Guenther
2010-03-28s3: Remove unused bitmap_[allocate|free]Volker Lendecke1-36/+0
2010-03-28s3: A NULL context might be perfectly valid for bitmap_tallocVolker Lendecke1-2/+0
2010-03-28s3: Fix a memleak in bitmap_tallocVolker Lendecke1-0/+1
2010-03-28s3: Use TALLOC_ZERO_ARRAY in bitmap_tallocVolker Lendecke1-4/+1
2010-03-28s3: Fix the memory hierarchy in bitmap_tallocVolker Lendecke1-1/+1
2010-03-28s3: Slightly simplify logic in conv_str_sizeVolker Lendecke1-29/+33
2010-03-28s3: Fix indentation in conv_str_sizeVolker Lendecke1-2/+2
2010-03-28s3: Use tdb_transaction_start_nonblock in gencache_stabilizeVolker Lendecke1-1/+10
This avoids the thundering herd problem when 5000 smbds exit simultaneously because the network went down.
2010-03-28Revert "s3: Optimize gencache for smbd exit"Volker Lendecke1-75/+14
This reverts commit 5ca63676dc59e83ffd9560fdcfa26063f267f283. That does not fully fix the problem, adding a tdb_transaction_start_nonblock to fix it.
2010-03-26s3-util_sock: Rise debug level for getpeername failed messages.Karolin Seeger1-4/+6
Don't show all getpeername failed messages in debug level 0 and 1. Karolin Signed-off-by: Volker Lendecke <vl@samba.org>
2010-03-26s3-event: switch s3 to using tevent_re_initialise()Andrew Tridgell2-8/+2
This correctly initialises the event backend, and checks for errors (thanks to Metze for suggesting this)
2010-03-25s3: Add a comment to serverid_parent_init, this is pretty confusingVolker Lendecke1-0/+6
2010-03-25s3: Add a comment to messaging_tdb_parent_init, this is pretty confusingVolker Lendecke1-0/+6
2010-03-25s3: Make sure our CLEAR_IF_FIRST optimization works for serverid.tdbVolker Lendecke1-0/+16
In the child, we fully re-open serverid.tdb, which leads to one fcntl lock for CLEAR_IF_FIRST detection per smbd. This opens the tdb in the parent and holds it, so that tdb_reopen_all correctly catches the CLEAR_IF_FIRST bit.
2010-03-25s3: Make sure our CLEAR_IF_FIRST optimization works for messaging.tdbVolker Lendecke1-0/+16
In the child, we fully re-open messaging.tdb, which leads to one fcntl lock for CLEAR_IF_FIRST detection per smbd. This opens the tdb in the parent and holds it, so that tdb_reopen_all correctly catches the CLEAR_IF_FIRST bit.
2010-03-25s3: Fix some nonempty blank linesVolker Lendecke1-6/+6
2010-03-24s3: Optimize gencache for smbd exitVolker Lendecke1-14/+75
If thousands of smbds try to gencache_stabilize at the same time because the network died, all of them might be sitting in transaction_start. Don't do the stabilize transaction if nothing has changed in gencache_notrans.tdb. Volker
2010-03-22share_info.tdb could use non-canonicalized sharenames.Jeremy Allison1-14/+143
Fix this by moving canonicalization into lib/sharesec.c. Update the db version to 3. Ensures we always find share names with security descriptors attached. Jeremy.
2010-03-22s3: Add the "ctdb locktime warn threshold" parameterVolker Lendecke1-0/+12
This is mainly a debugging aid for post-mortem analysis in case a cluster file system is slow.
2010-03-21s3: Open winbindd_cache.tdb with read/write access.Bo Yang1-1/+1
Open winbindd_cache.tdb with read/write access when validate the cache, otherwise, validation fails to get lock in tdb_check. It results in validation failure even the cache is good. Signed-off-by: Bo Yang <boyang@samba.org>
2010-03-17s3-eventlog: fix elog_tdbname(), we were always lower-casing entire lockdir ↵Günther Deschner1-5/+19
path... Found by RPC-EVENTLOG torture test. Guenther
2010-03-14s3: Use a switch to implement map_nt_error_from_tdbVolker Lendecke1-30/+47
First, this immediately gave me the warning that TDB_ERR_NESTING was not covered and second, this saved 48 bytes in the .o :-)
2010-03-14s3: Remove some unused codeVolker Lendecke1-20/+0
2010-03-13s3: Make tdb_wrap_open more robustVolker Lendecke1-41/+87
This hides the use of talloc_reference from the caller, making it impossible to wrongly call talloc_free() on the result.
2010-03-12s3: Add "g_lock_do" as a convenience wrapper functionVolker Lendecke1-0/+64
2010-03-10s3: Fix a long-standing problem with recycled PIDsVolker Lendecke3-14/+309
When a samba server process dies hard, it has no chance to clean up its entries in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb. For locking.tdb and brlock.tdb Samba is robust by checking every time we read an entry from the database if the corresponding process still exists. If it does not exist anymore, the entry is deleted. This is not 100% failsafe though: On systems with a limited PID space there is a non-zero chance that between the smbd's death and the fresh access, the PID is recycled by another long-running process. This renders all files that had been locked by the killed smbd potentially unusable until the new process also dies. This patch is supposed to fix the problem the following way: Every process ID in every database is augmented by a random 64-bit number that is stored in a serverid.tdb. Whenever we need to check if a process still exists we know its PID and the 64-bit number. We look up the PID in serverid.tdb and compare the 64-bit number. If it's the same, the process still is a valid smbd holding the lock. If it is different, a new smbd has taken over. I believe this is safe against an smbd that has died hard and the PID has been taken over by a non-samba process. This process would not have registered itself with a fresh 64-bit number in serverid.tdb, so the old one still exists in serverid.tdb. We protect against this case by the parent smbd taking care of deregistering PIDs from serverid.tdb and the fact that serverid.tdb is CLEAR_IF_FIRST. CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not work when all smbds are restarted. For this, "net serverid wipe" has to be run before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up sessionid.tdb and connections.tdb. While there, this also cleans up overloading connections.tdb with all the process entries just for messaging_send_all(). Volker
2010-03-10s3: Make TLDAP_IS_ALPHA and TLDAP_IS_ADH static functionsVolker Lendecke1-5/+12
2010-03-09Fix typoSimo Sorce1-2/+2
2010-03-09s3:tldap add own filter parsingSimo Sorce1-114/+600
Also add torture test to check filter parsing.
2010-03-08Revert "Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail ↵Karolin Seeger1-61/+4
to respond to a read or write." This reverts commit a6ae7a552f851a399991262377cc0e062e40ac20. This fixes bug #7222 (All users have full rigths on all shares) (CVE-2010-0728). (cherry picked from commit 1c9494c76cc9686c61e0966f38528d3318f3176f)
2010-03-05s3: Remove the unused parameter "persistent" from fetch_locked_internalVolker Lendecke1-8/+2
2010-03-05s3: db->persistent==true was handled earlier, make this more obviousVolker Lendecke1-1/+1
2010-03-01s3: Abstract access to sessionid.tdb, similar to conn_tdb.cVolker Lendecke1-0/+138
2010-03-01s3: Add connections_forall_read()Volker Lendecke1-0/+42
In a cluster, this makes a large difference: For r/w traverse, we have to do a fetch_locked on every record which for most users of connections_forall is just overkill.
2010-03-01s3: Make the difference between r/o and r/w in connections_db_ctx more obviousVolker Lendecke1-9/+4
2010-03-01s3: Make connections_forall open connections.tdb r/wVolker Lendecke1-1/+7
connections_forall is called from count_current_connections() which potentially deletes dead records. This needs r/w access to connections.tdb. connections_traverse says it does not provide this. Does not really matter in the smbd case, because we have opened it before r/w, so this is "just" cleanup.
2010-02-25s3-nltest: fix uninitialized query level.Günther Deschner1-1/+1
Guenther
2010-02-24s3: Make connections_fetch_record() staticVolker Lendecke1-2/+2
2010-02-23s3: Consolidate server_id_self into the equivalent procid_self()Volker Lendecke1-5/+0
2010-02-23s3-lib: Remove obsolete signal type cast.Andreas Schneider3-12/+12