summaryrefslogtreecommitdiff
path: root/source3/utils/net_cache.c
Commit message (Collapse)AuthorAgeFilesLines
* gencache: Remove transaction-based tdbVolker Lendecke2018-11-061-26/+0
| | | | | | | | | | | | | | | | | | | | | At more than one large site I've seen significant problems due to gencache_stabilize. gencache_stabilize was mainly introduced to survive machine crashes with the cache still being in place. Given that most installations crash rarely and this is still a cache, this safety is overkill and causes real problems. With the recent changes to tdb, we should be safe enough to run on completely corrupted databases and properly detect errors. A further commit will introduce code that wipes the gencache.tdb if such a corruption is detected. There is one kind of corruption that we don't properly handle: Orphaned space in the database. I don't have a good idea yet how to handle this in a graceful and efficient way during normal operations, but maybe this idea pops up at some point. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* net: Use dom_sid_str_bufVolker Lendecke2018-11-021-3/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove gencache.h from proto.hVolker Lendecke2018-10-191-0/+1
| | | | | | | | | | It's a pain to recompile the world if gencache.h changes Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Oct 19 18:52:50 CEST 2018 on sn-devel-144
* net: Avoid tallocsVolker Lendecke2018-04-041-2/+3
| | | | | | | | | Not really performance critical, but I think it's worth establishing sample code to use more stack variables than going out to talloc. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* net: Fix CID 1414752 Resource leakVolker Lendecke2018-04-041-0/+3
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* net: Parse namemap_cache in "net cache list"Volker Lendecke2017-11-291-0/+19
| | | | | | | | | | namemap_cache.c saves these as strv lists: An array of 0-terminated strings. "net cache list" only printfs the values, so they would be cut off. We might want to do this with other gencache values too in the future. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* net: fix net cache samlogon list outputRalph Boehme2017-07-041-4/+5
| | | | | | | | | Don't print the table header for every entry. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12875 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* net: add net cache samlogon list|show|ndrdump|deleteRalph Boehme2017-07-041-0/+232
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Jul 4 00:12:46 CEST 2017 on sn-devel-144
* lib: Add "mem_ctx" to gencache_get_data_blobVolker Lendecke2013-09-051-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-utils: fix crash in net cache getChristian Ambach2011-06-141-1/+1
| | | | | | | free the blob correctly Autobuild-User: Christian Ambach <ambi@samba.org> Autobuild-Date: Tue Jun 14 12:01:59 CEST 2011 on sn-devel-104
* s3: Properly print binary values "net cache"Volker Lendecke2010-11-281-7/+21
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Nov 28 15:03:26 CET 2010 on sn-devel-104
* s3: Use localtime_r, libreplace defines itVolker Lendecke2010-11-271-11/+9
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sat Nov 27 20:50:27 CET 2010 on sn-devel-104
* s3 net: Fix compile warningsKai Blin2010-01-191-12/+25
|
* s3/net: split up some printable stings to ease i18nBjörn Jacke2010-01-181-10/+11
| | | | | | If we put strings like "Usage:" into separate _() macros and not the whole "Usage:..." string we can cover much more messages by only one single translation. The drawback is that the message in the sources looks less pretty.
* s3 net: i18n support for net cacheKai Blin2009-07-291-49/+51
|
* Make gencache more stableVolker Lendecke2009-07-151-0/+23
| | | | | | | | | | This provides a compromise between stability and performance: gencache is a persistent database these days that for performance reasons can not use tdb transactions for all writes. This patch splits up gencache into gencache.tdb and gencache_notrans.tdb. gencache_notrans is used with CLEAR_IF_FIRST, writes to it don't use transactions. By default every 5 minutes and when a program exits, all entries from _notrans.tdb are transferred to gencache.tdb in one transaction.
* Remove gencache_init/shutdownVolker Lendecke2009-07-151-4/+0
| | | | | gencache_get/set/del/iterate call gencache_init() internally anyway. And we've been very lazy calling gencache_shutdown, so this seems not really required.
* S3: Fixes for coverity issues.todd stecher2009-02-101-1/+2
|
* Fix all warnings in source3 with gcc4.3.Jeremy Allison2008-12-311-3/+2
| | | | Jeremy.
* Revert "Return timed out entries from gencache_get if timeout param != NULL"Volker Lendecke2008-07-111-2/+1
| | | | | This reverts commit 2954b2be563149380e1fae7fe088b98d6cbd42e7. (This used to be commit 77ab2fb306a7ad59447a3e1591c2af03447e09c5)
* Return timed out entries from gencache_get if timeout param != NULLVolker Lendecke2008-07-031-1/+2
| | | | | | | | net cache get was the only one interested in the timeout. That single caller can take care of the timeout itself then. With this API change idmap_cache.c can be converted to gencache. (This used to be commit 2954b2be563149380e1fae7fe088b98d6cbd42e7)
* net: Rename functable3 to functable, get rid of old functablesKai Blin2008-06-101-2/+2
| | | | (This used to be commit bb7c5fc4ec77db4073d3beccf12af12910b6bd07)
* net: Make "net cache" use functable3Kai Blin2008-06-101-33/+75
| | | | (This used to be commit 60ac59fb8a391989f2c2e25b288674e6cc63ae60)
* net: more whitespace cleanupKai Blin2008-05-101-30/+30
| | | | (This used to be commit ef0184d580500734fc7af51e1c790b075180a3d0)
* net: Remove globalsKai Blin2008-05-101-11/+19
| | | | (This used to be commit 1e9319cf88b65a2a8d4f5099a1fe5297e405ed2e)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r18310: Add a little test for some gencache routinesVolker Lendecke2007-10-101-43/+0
| | | | | | | | Remove unused gencache_set_only Use CONST_DISCARD instead of SMB_STRDUP Volker (This used to be commit 651e7e44e2e56eab81c5fe708f33e6d3918a39f9)
* r16267: Fix Klocwork #401, #402 - ensure format specifierJeremy Allison2007-10-101-1/+8
| | | | | | limited. Fix memleak in printing gencache contents. Jeremy. (This used to be commit 81731e1f68cdf4af80733338238aeae0a7d108c0)
* r16230: Fix Klocwork #861 and others. localtime and asctimeJeremy Allison2007-10-101-7/+19
| | | | | | can return NULL. Ensure we check all returns correctly. Jeremy. (This used to be commit 6c61dc8ed6d84f310ef391fb7700e93ef42c4afc)
* r12986: Use d_fprintf(stderr, ...) for any error message in net.Lars Müller2007-10-101-7/+7
| | | | | | | | | All 'usage' messages are still printed to stdout. Fix some compiler warnings for system() calls where we didn't used the return code. Add appropriate error messages and return with the error code we got from system() or NT_STATUS_UNSUCCESSFUL. (This used to be commit f650e3bdafc4c6bcd7eb4bcf8b6b885b979919eb)
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-1/+1
| | | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
* Typo fix for bug 258.Tim Potter2003-07-291-1/+1
| | | | (This used to be commit a4e342c20cbddbb4d9d6ac49258457751146d890)
* Just a few formatting fixed caught while testing.Rafal Szczesniak2003-07-101-1/+1
| | | | | rafal (This used to be commit 156554738cf4e4ffa5a811d9979acd19418e7908)
* Merge from HEAD - mimir's new gencache based namecache code.Andrew Bartlett2003-01-041-18/+38
| | | | | Andrew Bartlett (This used to be commit f79324f730c400342f445c931b0d75ff756d7cc7)
* added gencache implementation from mimir - thanks!Andrew Tridgell2002-09-111-0/+328
(This used to be commit 05a202c287f5daeb1ccbaf9479aa93e7928e93db)