summaryrefslogtreecommitdiffstats
path: root/source/tdb/tdbutil.c
Commit message (Collapse)AuthorAgeFilesLines
* Fresh meat in trusted domains code:Rafal Szczesniak2003-03-141-7/+146
| | | | | | | | | | | | | | | - packing/unpacking utility functions for trusted domain password struct; can be used to prepare buffer to store in secrets.tdb or (soon) passdb backend - similiar functions for DOM_SID - respectively modified secrets_(fetch|store) routines - new auth mapping code utilising introduced is_trusted_domain function - added tdb (un)packing of single bytes Rafal
* Add 3 second timeout when terminating server and sending print notifyJeremy Allison2003-01-301-4/+13
| | | | | | messages. Stops build-up of large numbers of smbd's waiting to terminate on large print throughput. Jeremy.
* Keep all the const warnings in one place, by adding a utility function toAndrew Bartlett2003-01-121-44/+31
| | | | | | make the TDB_DATA. Andrew Bartlett
* tdb_chainlock_with_timeout: Add TODO: If we time out waiting for aMartin Pool2003-01-091-0/+4
| | | | | | | | | lock, it might be nice to use F_GETLK to get the pid of the process currently holding the lock and print that as part of the debugging message. I'd like to have this in appliance_head, but the code is too different so I won't worry for now.
* BIG patch...Andrew Bartlett2003-01-021-21/+21
| | | | | | | | | | | | | | | | This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett
* Lots of fixes for error paths where tdb_fetch() data need freeing.Jeremy Allison2002-11-231-4/+8
| | | | | Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>. Jeremy.
* Add chainlock_read functions to get a read lock. Used in *massively*Jeremy Allison2002-11-091-4/+39
| | | | | contended tdb's (and I've got one :-). Jeremy.
* Merge of scalable printing code fix... Needs testing.Jeremy Allison2002-11-071-11/+8
| | | | | | | Also tidied up some of Richard's code (I don't think he uses the compiler flags -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual like I do :-) :-). Jeremy.
* Add a timeout to tdb_lock_bystring(). Ensure we never have more thanJeremy Allison2002-10-041-5/+44
| | | | | MAX_PRINT_JOBS in a queue. Jeremy.
* Added tdb_delete_by_string() function.Tim Potter2002-06-031-0/+14
|
* Partly based on the work by mimir (Rafal SzczesniakAndrew Bartlett2002-04-141-0/+72
| | | | | | | | | | | | | | <mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly enumerate its trusted domains - by exaimining the keys in the secrets.tdb file. This patch has been tested with both NT4 and rpcclient/wbinfo, and adds some extra functionality to talloc and rpc_parse to allow it to deal with already unicode strings. Finally, this cleans up some const warnings that were in net_rpc.c by pushing another dash of const into the rpc client code. Andrew Bartlett
* Make our atomic increment code actually do this during its first/second run.Andrew Bartlett2002-04-131-5/+20
| | | | | | | The previous code would return the same value for both the initial and second call, only incrementing on later calls. Andrew Bartlett
* When printing a tdb log message display "unnamed" instead of "unknown" ifTim Potter2002-04-091-1/+1
| | | | the tdb has not been named.
* uint32 store and fectch functions, a signed int is not enough sometimesSimo Sorce2002-04-071-0/+96
|
* Make winbindd_idmap tdb endian independent. This is very important forJeremy Allison2002-03-211-93/+0
| | | | | | | | sharing between machines with rsync. Finally removed tdb_store_int/tdb_fetch_int. Now only tdb_store_int32/tdb_fetch_int32 which are endian independent are allowed. Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Display tdb name of "unknown" in logging debug when tdb has not been named.Tim Potter2002-01-221-1/+1
|
* This is another *BIG* change...Andrew Bartlett2002-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Samba now features a pluggable passdb interface, along the same lines as the one in use in the auth subsystem. In this case, only one backend may be active at a time by the 'normal' interface, and only one backend per passdb_context is permitted outside that. This pluggable interface is designed to allow any number of passdb backends to be compiled in, with the selection at runtime. The 'passdb backend' paramater has been created (and documented!) to support this. As such, configure has been modfied to allow (for example) --with-ldap and the old smbpasswd to be selected at the same time. This patch also introduces two new backends: smbpasswd_nua and tdbsam_nua. These two backends accept 'non unix accounts', where the user does *not* exist in /etc/passwd. These accounts' don't have UIDs in the unix sense, but to avoid conflicts in the algroitmic mapping of RIDs, they use the values specified in the 'non unix account range' paramter - in the same way as the winbind ranges are specifed. While I was at it, I cleaned up some of the code in pdb_tdb (code copied directly from smbpasswd and not really considered properly). Most of this was to do with % macro expansion on stored data. It isn't easy to get the macros into the tdb, and the first password change will 'expand' them. tdbsam needs to use a similar system to pdb_ldap in this regard. This patch only makes minor adjustments to pdb_nisplus and pdb_ldap, becouse I don't have the test facilities for these. I plan to incoroprate at least pdb_ldap into this scheme after consultation with Jerry. Each (converted) passdb module now no longer has any 'static' variables, and only exports 1 init function outside its .c file. The non-unix-account support in this patch has been proven! It is now possible to join a win2k machine to a Samba PDC without an account in /etc/passwd! Other changes: Minor interface adjustments: pdb_delete_sam_account() now takes a SAM_ACCOUNT, not a char*. pdb_update_sam_account() no longer takes the 'override' argument that was being ignored so often (every other passdb backend). Extra checks have been added in some places. Minor code changes: smbpasswd no longer attempts to initialise the passdb at startup, this is now done on first use. pdbedit has lost some of its 'machine account' logic, as this behaviour is now controlled by the passdb subsystem directly. The samr subsystem no longer calls 'local password change', but does the pdb interactions directly. This allow the ACB_ flags specifed to be transferred direct to the backend, without interference. Doco: I've updated the doco to reflect some of the changes, and removed some paramters no longer applicable to HEAD.
* Ensure we log tdb open fails. Patch from Alexander Bokovoy ↵Jeremy Allison2002-01-181-4/+2
| | | | | | <a.bokovoy@sam-solutions.net> Jeremy.
* Added int32 version of "atomic" update.Jeremy Allison2002-01-091-0/+35
| | | | Jeremy.
* Added int32 versions of the endian-dependent code.Jeremy Allison2002-01-091-2/+66
| | | | Jeremy.
* Fixed nasty cast of tdb_delete in traversals.Jeremy Allison2002-01-031-0/+11
| | | | Jeremy.
* changed the DEBUG level of tdb_pack and tdb_unpack. Instead of 8, it's nowJean-François Micouleau2001-12-051-2/+2
| | | | | | | | | | 18. when you're looking at a level 10, and it's all clutered with tdb_pack/unpack, it's getting .... And anyway most of our code using tdb_pack/unpack have DEBUG around the call if there is a problem. J.F.
* Tidup.Jeremy Allison2001-12-041-43/+80
| | | | Jeremy.
* undoMartin Pool2001-12-041-1/+3
|
* Better error handling:Martin Pool2001-12-041-3/+1
| | | | | | | | | | | | | - tdb_open api changed so that you now pass an error handling callback when opening the file, so that errors detected during opening have somewhere to go. (All calls from the body of Samba to this function go through a wrapper in tdbutil, which has been updated.) - Clean up logic for deciding how to open tdb. Emit log messages if something goes wrong (e.g. bad magic.) - tdbtool now logs errors to stderr.
* actually obey the "use mmap" smb.conf optionAndrew Tridgell2001-09-061-1/+5
|
* merged fix for tdb_unpack from 2_2Andrew Tridgell2001-05-301-1/+4
|
* - fixed an off-by-1 bug in the delayed deletion code that I believeAndrew Tridgell2001-05-301-0/+1
| | | | | | | | was the initial cause of the connections database becoming corrupt. Note that this bug only happens when doing deletions within a traversal, which is why it has only showed up now - added delete within traversal testing to tdbtorture - added a lot more logging to tdb
* added a tdb_open_log() function that opens a tdb and enables loggingAndrew Tridgell2001-05-301-0/+33
| | | | | | of messages from the tdb code into the Samba DEBUG() system just call tdb_open_log() instead of tdb_open() to enable this on any tdb
* Added tdb_change_int_atomic() to allow atomic updates of a tdb int value.Jeremy Allison2001-05-251-3/+32
| | | | Jeremy.
* merge from 2.2Andrew Tridgell2001-05-061-2/+5
|
* merge from 2.2Andrew Tridgell2001-04-181-0/+1
|
* Getting medieval with compiler warnings as Jeremy puts it.Tim Potter2001-04-161-2/+2
|
* Merge of Andrew's changes in 2.2.Jeremy Allison2001-04-131-48/+2
| | | | Jeremy.
* Fixed some compiler warnings.Tim Potter2001-04-111-2/+2
|
* Added HAVE_STDARG_H to tdbutil.cJeremy Allison2001-04-101-5/+51
| | | | Jeremy.
* tdb_chainunlock() no longer returns a value.Tim Potter2000-12-061-2/+2
|
* Changed to sourceforge tdb code. This includes spinlocks (so we now haveJeremy Allison2000-12-061-2/+2
| | | | | | | | a --with-spinlocks option to configure, this does mean the on-disk tdb format has changed, so 2.2alphaX sites will need to re-create their tdb's. The upside is no more tdb fragmentation and a +5% on netbench. Swings and roundabouts.... Jeremy.
* rpc_parse/parse_spoolss.c: Updated comment for old version of W2K.Jeremy Allison2000-11-101-1/+1
| | | | | tdb/tdbutil.c: With varargs uint16 is cast to (int). Jeremy.
* added tdb_lock_bystring() and tdb_unlock_bystring()Andrew Tridgell2000-10-101-0/+24
|
* Added John Reilly's enumports/addprinter/delprinter scripting code plus theJeremy Allison2000-07-311-0/+14
| | | | | | | | | | fix for the Win9x printer drivers. Changed command names to add "command" string on the end for some consistancy with the other scripting commands. Added '%P' option to tdbpack/unpack to store long comment string. Made port name be "Samba Printer Port" if no enum port script given. Fixed prs_uint32_pre code to cope with null args. Jeremy.
* Moved tdb functions that access parse structs into parse_prs.cJeremy Allison2000-06-081-30/+0
| | | | | to prevent builkd breaking. Jeremy.
* Fixing get/set of security descriptors.Jeremy Allison2000-06-071-8/+4
| | | | | | Removed ugly hack for NT printing. Fixed up tdb parse stuff memory leaks. Jeremy.
* added some debug code to track down pack/unpack problemsAndrew Tridgell2000-06-041-0/+12
|
* getting and setting security descriptors on printers now worksAndrew Tridgell2000-05-271-10/+42
| | | | this needed some fixes in tdb_unpack(). Tim, you'll need to update
* added tdb_pack() and tdb_unpack()Andrew Tridgell2000-05-241-0/+148
|
* While we're all making incompatible tdb changes, I changed the implementationTim Potter2000-05-121-4/+4
| | | | | | | | | of tdb_{store,get}_int() to store the length of the string key + 1 so the stored key contains the trailing NULL character. This allows normal string library routines to manipulate keys. Also renamed tdb_get_int() to tdb_fetch_int() to keep the set of verbs consistent.
* Added tdb_store_by_string() and tdb_fetch_by_string() functions to storeTim Potter2000-05-091-0/+27
| | | | data with null terminated string keys.
* put tdb utility functions in a separate fileAndrew Tridgell2000-04-291-0/+67