summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* r23847: As Dr. Volker says, "A pstring a day....".Jeremy Allison2007-07-121-7/+9
| | | | Jeremy.
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-07-101-2/+1
|
* r23780: Find and fix more GPL2 -> GPL3.Jeremy Allison2007-07-091-1/+1
| | | | Jeremy.
* r23594: Fix parsing of local pids if cluster support is compiled in but noVolker Lendecke2007-06-241-0/+4
| | | | cluster is used
* r23511: Merge branches/SAMBA_3_0@23510James Peach2007-06-151-10/+14
| | | | | Tidy calls to smb_panic by removing trailing newlines. Print the failed expression in SMB_ASSERT.
* r23410: Merge the core of the cluster code.Volker Lendecke2007-06-101-11/+70
| | | | | | | | | | | | | | | | I'm 100% certain I've forgotten to merge something, but the main code should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and messages_ctdbd.c. There should be no changes to the non-cluster case, it does survive make test on my laptop. It survives some very basic tests with ctdbd enables, I did not do the full test suite for clusters yet. Phew... Volker
* r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'mVolker Lendecke2007-05-211-1/+0
| | | | | | | | | | | doing this because for the clustering the marshalling is needed in more than one place, so I wanted a decent routine to marshall a message_rec struct which was not there before. Tridge, this seems about the same speed as it used to be before, the librpc/ndr overhead in my tests was under the noise. Volker
* r22909: Change prototype of dump_data(), so that it takes unsigned char *Michael Adam2007-05-151-3/+3
| | | | | | | | | | instead of char *, which matches what samba4 has. Fix all the callers to prevent compiler warnings. This essentially ports r22001 from SAMBA_3_0 to SAMBA_3_0_26. There are a few additional type cast corrections.
* r22736: Start to merge the low-hanging fruit from the now 7000-line cluster ↵Volker Lendecke2007-05-071-16/+14
| | | | | | | | | patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker
* r22564: Move the _strict -> _zeronull functions into lib/util.cJeremy Allison2007-04-291-0/+99
| | | | | and out of talloc at tridge's request. Jeremy.
* r22555: Ensure our paranoid malloc functions return NULL onJeremy Allison2007-04-281-0/+12
| | | | | size == 0 so we have a known behavior. Jeremy.
* r22050: Fix a couple of off-by-one errors in the rapJeremy Allison2007-04-031-4/+14
| | | | | | | call patch. Jerry, this works now for displaying shares on Win9x (and hopefully everything else as well :-). Jeremy.
* r22045: As Volker noticed, skip_string's last argument isJeremy Allison2007-04-021-1/+1
| | | | | redundent. Remove it. Jeremy.
* r22042: Try and clean up my own mess using the API VolkerJeremy Allison2007-04-021-6/+56
| | | | | | | | | | | | | | suggested. I now use : BOOL is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off) char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off) char *get_safe_str_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off) int get_safe_SVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval) int get_safe_IVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval) Volker, please criticize and comment. Thanks, Jeremy.
* r22019: Jeremy, this hopefully fixes the build farm currently. But I think ↵Volker Lendecke2007-04-011-2/+2
| | | | | | | | we need another get_safe_offset call that also includes the required buffer size. Volker
* r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,Jeremy Allison2007-03-301-0/+23
| | | | | but I've no option. Jeremy.
* r21854: Add gfree_interfaces() to gfree_all().Günther Deschner2007-03-161-0/+1
| | | | Guenther
* r21800: Check-in the DFS rewrite. I am still testing this but itJeremy Allison2007-03-121-0/+3
| | | | | | | | works from smbclient and Windows, and I am promising to support and fix both client and server code moving forward. Still need to test the RPC admin support but I haven't changed that code. Jeremy.
* r21768: Fix the client dfs code such that smbclient canJeremy Allison2007-03-081-1/+14
| | | | | | | | | process deep dfs links (ie. links that go to non root parts of a share). Make the directory handling conanonical in POSIX and Windows pathname processing. dfs should not be fully working in client tools. Please bug me if not. Jeremy.
* r21725: Fix for memalign used without test guards. WasJeremy Allison2007-03-061-15/+0
| | | | | breaking the build on *BSD's. Tested by Herb. Jeremy.
* r21560: Convert name_to_fqdn to BOOL.Günther Deschner2007-02-271-3/+6
| | | | Guenther
* r21525: Go ahead and checkin the mlock() & memalign() fixes so Gerald Carter2007-02-241-0/+28
| | | | | | | | others don't get stuck with the winbindd hang. Still waiting on additional confirmation from Guenther that this fixes thes issues he was observing as well. But it's been running in my local tree for a day without problems.
* r21322: No feedback means consent :-)Volker Lendecke2007-02-131-0/+13
| | | | | | | | | | | It does not matter if I screw up 3.0.25 or 3.0.26 with this, so do it rather sooner than later. Add the notify support that already exists in 3_0 to 3_0_25. If you want to see this patch dissected into digestable parts, look at 3_0, revisions at about 20800 and following. Volker
* r21262: Final part of BUG 4093: fix %a with Windows XP 64bitGerald Carter2007-02-091-1/+4
|
* r21250: Partial fix for BUG 4093: Make %a expand to "Vista"Gerald Carter2007-02-081-0/+3
| | | | | | | | | | based on the flags2 values in the negprot request. This also includes some code for testing the dialect strings for "SMB 2.001" but this is unreliable as Vista only sends that in the 1st negprot and caches the fact that we don't support it. Restartnig the WOrkstation service on the client clears the cache.
* r20413: Merge Volker's open directory changes to 3.0.24.Jeremy Allison2006-12-301-0/+31
| | | | | | I think they're correct, modulo more testing of error codes. Jeremy.
* r20112: Forgot to merge to 3.0.24 - *BSD compile fix.Jeremy Allison2006-12-111-0/+17
| | | | Jeremy.
* r20090: Fix a class of bugs found by James Peach. EnsureJeremy Allison2006-12-091-24/+12
| | | | | | | | | | | | | we never mix malloc and talloc'ed contexts in the add_XX_to_array() and add_XX_to_array_unique() calls. Ensure that these calls always return False on out of memory, True otherwise and always check them. Ensure that the relevent parts of the conn struct and the nt_user_tokens are TALLOC_DESTROYED not SAFE_FREE'd. James - this should fix your crash bug in both branches. Jeremy.
* r19810: more merge work....does not compile currently. Working on smbd mergeGerald Carter2006-11-211-1/+3
|
* r19806: merge time.c changesGerald Carter2006-11-201-1/+1
|
* r19801: grabbing minor changes (some missing pieces from jmcd's SAMR work as ↵Gerald Carter2006-11-201-3/+0
| | | | well)
* r19784: smbd compiles (still a few warning which are actual bugs)Gerald Carter2006-11-191-3/+7
|
* r19081: Merge from vl: Fix a potential NULL dereferenceJeremy Allison2006-10-041-0/+7
|
* r18707: Fix the build when you have libnscd installed (which apparently no hostGünther Deschner2006-09-201-21/+0
| | | | | | on the buildfarm has). Guenther
* r18703: Fix the annoying effect that happens when nscd is running:Günther Deschner2006-09-201-0/+21
| | | | | | | | | We usually do not get the results from user/group script modifications immediately. A lot of users do add nscd restart/refresh commands into their scripts to workaround that while we could flush the nscd caches directly using libnscd. Guenther
* r18534: Fix grammarSimo Sorce2006-09-141-1/+1
|
* r18532: back port name_to_fqdn enhancementsSimo Sorce2006-09-141-3/+29
|
* r16418: Pull in more Klocwork fixes (up to r16415)Gerald Carter2006-06-201-3/+0
|
* r15837: starting sync up for 3.0.23rc1 (in sync with SAMBA_3_0 r15822)Gerald Carter2006-05-231-2/+26
|
* r15047: Add support for using libunwind to generate a backtrace. This isJames Peach2006-04-121-25/+88
| | | | | primarily intended for ia64 systems where libunwind knows more about the different ways of walking the stack that just about anything else.
* r15030: On a performace hunt... Remove as many extraneousJeremy Allison2006-04-111-1/+2
| | | | | memset's as possible. Jeremy.
* r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison2006-04-101-20/+41
| | | | | | | | into 3.0. Also merge the new POSIX lock code - this is not enabled unless -DDEVELOPER is defined. This doesn't yet map onto underlying system POSIX locks. Updates vfs to allow lock queries. Jeremy.
* r15003: patch based on code from Arkady Glabek <aglabek@centeris.com> to ↵Gerald Carter2006-04-081-0/+25
| | | | ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms)
* r14898: This change is an attempt to improve the quality of the information thatJames Peach2006-04-041-35/+30
| | | | | | | | | | | | | | | | | is produced when a process exits abnormally. First, we coalesce the core dumping code so that we greatly improve our odds of being able to produce a core file, even in the case of a memory fault. I've removed duplicates of dump_core() and split it in two to reduce the amount of work needed to actually do the dump. Second, we refactor the exit_server code path to always log an explanation and a stack trace. My goal is to always produce enough log information for us to be able to explain any server exit, though there is a risk that this could produce too much log information on a flaky network. Finally, smbcontrol has gained a smbd fault injection operation to test the changes above. This is only enabled for developer builds.
* r14751: Use the noreturn attribute to try and tell coverity thatJeremy Allison2006-03-281-9/+12
| | | | | smb_panic can't return. Jeremy.
* r14746: Add the Samba4 replacements for opendir/readdir etc. toJeremy Allison2006-03-271-1/+1
| | | | | | | Samba3 - with some 64-bit macro madness. Attempt to fix the broken directory handling in the *BSD-of-the-month club. Jeremy.
* r14703: Clarify the return codes for the POSIX locking case. ThisJeremy Allison2006-03-251-1/+1
| | | | | was confusing. Jeremy.
* r14618: add --no-process-group to all server programmsStefan Metzmacher2006-03-211-3/+3
| | | | | | | | | | | to make the following possible: timelimit 20000 bin/nmbd -F -S --no-process-group timelimit 20000 bin/smbd -F -S --no-process-group this is needed to 'make test' working without losing child processes metze
* r13975: Re-fix Coverity #156 - I had left the hidden arg. inconsistentJeremy Allison2006-03-071-3/+3
| | | | | between Realloc and realloc_array. Jeremy.
* r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison2006-03-071-28/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy.