summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r19080: Fix a potential NULL dereferenceVolker Lendecke1-0/+7
(This used to be commit 682b490c23bb88a1a570bd1fcb7d2b6aa778dd14)
2007-10-10r18707: Fix the build when you have libnscd installed (which apparently no hostGünther Deschner1-21/+0
on the buildfarm has). Guenther (This used to be commit b0bb364df0efe140780328d90ae55bb823e6b10d)
2007-10-10r18705: not all compilers like thisStefan Metzmacher1-2/+2
metze (This used to be commit 2ec4bc0f5299f295525f306279ddb136e0b19ee1)
2007-10-10r18703: Fix the annoying effect that happens when nscd is running:Günther Deschner1-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 (This used to be commit 7db6ce295afbedfada7b207ad56566d2195a0d21)
2007-10-10r18534: Fix grammarSimo Sorce1-1/+1
(This used to be commit 6c9b80bde39be7feb15f0fab4024a1de2980f4c1)
2007-10-10r18530: typosSimo Sorce1-2/+2
(This used to be commit 8c5c4959ede04e1cdbfe65beeee1f67ac0a93753)
2007-10-10r18529: warn the user that putting the machine host name on theSimo Sorce1-0/+8
127.0.0.1 line in /etc/hosts is not ok for Kerberos. (This used to be commit 85126391e11006514af8e6c6b88eb7fa21abf49a)
2007-10-10r18066: It's a bit pointless to send ourselves a signal just to check if we ↵Volker Lendecke1-0/+4
exist :-) Volker (This used to be commit 44105ff2ffa726d2961cecdabbd2056f243ad914)
2007-10-10r17922: sync samba3's talloc with samba4's and move the samba3 specific ↵Stefan Metzmacher1-1/+1
stuff to tallocmsg.c metze (This used to be commit 7704e3e51dec1768772663024a0579cb4a271cc1)
2007-10-10r17800: Start using struct timespec internally for file timesJeremy Allison1-1/+1
on the wire. This allows us to go to nsec resolution for systems that support it. It should also now be easy to add a correct "create time" (birth time) for systems that support it (*BSD). I'll be watching the build farm closely after this one for breakage :-). Jeremy. (This used to be commit 425280a1d23f97ef0b0be77462386d619f47b21d)
2007-10-10r17569: Make 'max smbd processes' more robust. Counting on the child to ↵Volker Lendecke1-3/+0
decrement a tdb entry is not the most reliable way to count children correctly. This increments the number of children after a fork and decrements it upon SIGCLD. I'm keeping a list of children just for consistency checks, so that we at least get a debug level 0 message if something goes wrong. Volker (This used to be commit eb45de167d24d07a218307ec5a48c0029ec097c6)
2007-10-10r17231: Some patch cosmeticsVolker Lendecke1-1/+1
(This used to be commit 736e55101b1e7cc22f043b836be877afbb031edf)
2007-10-10r17025: Remove one blank line - test checking in to twoJeremy Allison1-1/+0
branches simultaneously..... Jeremy. (This used to be commit 13e7fe540acf575c3b4503050a25cbe4d30b8835)
2007-10-10r16997: Simo's patch (based on repotr from Seth Elssworth of Quest) to try ↵Gerald Carter1-2/+21
to be more robust in the precense of more broken /etc/hosts files when determining our fwdn (This used to be commit 6413df8348829659807c0c30e6eaef511815e0ed)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-2/+4
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16386: Klockwork #lots. Ensure talloc_get_type_abort abortsJeremy Allison1-3/+0
if handed a NULL pointer, not returns NULL. Jeremy. (This used to be commit d47ec4dc25bffa6f605c0f6fa1d9c046dbc520a7)
2007-10-10r15509: Preserve errno in fcntl lock wrappers.James Peach1-0/+4
(This used to be commit 624318245fbd4060617d9404700a04df23d667ac)
2007-10-10r15508: Use clock_gettime for profiling timstamps if it is available. UseJames Peach1-0/+18
the fastest clock available on uniprocessors. (This used to be commit d44862928206b524f826bd7c2997ab5353c0b6a0)
2007-10-10r15446: Tidy up the formatting of locking debug messages and make it moreJames Peach1-2/+4
consistent. Bring oplocks withing the purview of the locking debug channel. (This used to be commit e817cfd7d3a42d141198122eada58b5a7ba90e9c)
2007-10-10r15047: Add support for using libunwind to generate a backtrace. This isJames Peach1-25/+88
primarily intended for ia64 systems where libunwind knows more about the different ways of walking the stack that just about anything else. (This used to be commit 256a19d722f360dac3c8e83f5bfac453fa70db96)
2007-10-10r15030: On a performace hunt... Remove as many extraneousJeremy Allison1-1/+2
memset's as possible. Jeremy. (This used to be commit 1217ed392b75aa8bfefa9c3f1ec5fa3bba841ee0)
2007-10-10r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison1-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. (This used to be commit 08e52ead03304ff04229e1bfe544ff40e2564fc7)
2007-10-10r15003: patch based on code from Arkady Glabek <aglabek@centeris.com> to ↵Gerald Carter1-0/+25
ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms) (This used to be commit 1e0b79e591d70352a96e0a0487d8f394dc7b36ba)
2007-10-10r14898: This change is an attempt to improve the quality of the information thatJames Peach1-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. (This used to be commit 56bc02d64498eb3faf89f0c5452b9299daea8e95)
2007-10-10r14751: Use the noreturn attribute to try and tell coverity thatJeremy Allison1-9/+12
smb_panic can't return. Jeremy. (This used to be commit ba9c98983efbf4871e1ec07df37590d97ec52fba)
2007-10-10r14746: Add the Samba4 replacements for opendir/readdir etc. toJeremy Allison1-1/+1
Samba3 - with some 64-bit macro madness. Attempt to fix the broken directory handling in the *BSD-of-the-month club. Jeremy. (This used to be commit fd98427f64f4206c01f16f82fadf24f5863878db)
2007-10-10r14703: Clarify the return codes for the POSIX locking case. ThisJeremy Allison1-1/+1
was confusing. Jeremy. (This used to be commit bc1a605a39e58a7dbdcd4d132345e957e3ed9d5e)
2007-10-10r14618: add --no-process-group to all server programmsStefan Metzmacher1-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 (This used to be commit c3a9f30e2a12cc852c9fa3a7d161f5c6ee0694ce)
2007-10-10r13975: Re-fix Coverity #156 - I had left the hidden arg. inconsistentJeremy Allison1-3/+3
between Realloc and realloc_array. Jeremy. (This used to be commit 841c9b1847ae12656b827e3d35b8bf0c3f68b8b4)
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-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. (This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
2007-10-10r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()Gerald Carter1-2/+2
macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2)
2007-10-10r13316: Let the carnage begin....Gerald Carter1-4/+4
Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
2007-10-10r12279: unix_mask_match has been broken for *ever*... (How).Jeremy Allison1-1/+2
Ensure it returns a BOOL. Jerry (and anyone else) please check this, I think all uses are now correct but could do with another set of eyes. Essential for 3.0.21 release. Jeremy. (This used to be commit 0c7b8a7637e760fcb6629092f36b610b8c71f5c9)
2007-10-10r11446: Remove unused fn. Remove unneeded strncpy use.Jeremy Allison1-7/+2
Jeremy. (This used to be commit d202aae3c821f3d78ff063d867bac1f84dca3548)
2007-10-10r11159: Added some const to fix warnings.Jeremy Allison1-2/+2
Jeremy. (This used to be commit de27b0eef2eb021f28e8bf300c4dd524e30fc7ed)
2007-10-10r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4Jeremy Allison1-7/+7
x86_64 box. Jeremy. (This used to be commit d720867a788c735e56d53d63265255830ec21208)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-3/+67
* \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
2007-10-10r9536: Fix one more DIR -> SMB_STRUCT_DIR typo.Jeremy Allison1-1/+1
Jeremy. (This used to be commit c5b79a6709a1333d1d69d9216620b1f06fdfd5d3)
2007-10-10r9325: Remember to ignore FILE_SHARE_DELETE when mapping to old shareJeremy Allison1-2/+1
modes for display. Jeremy. (This used to be commit f00d41a9dcd03033c59a399090058c76b5ce14c1)
2007-10-10r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison1-0/+22
tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb)
2007-10-10r7882: Looks like a large patch - but what it actually does is make SambaJeremy Allison1-3/+3
safe for using our headers and linking with C++ modules. Stops us from using C++ reserved keywords in our code. Jeremy (This used to be commit 9506b8e145982b1160a2f0aee5c9b7a54980940a)
2007-10-10r7842: With the patch I sent Steve yesterday this gives us complete POSIX ↵Jeremy Allison1-0/+6
pathnames. ie. files containing : and \ can be accessed from Linux. Jeremy. (This used to be commit e9b8d23d6138d909a65ea70b2e801881e8333b38)
2007-10-10r7415: * big change -- volker's new async winbindd from trunkGerald Carter1-0/+23
(This used to be commit a0ac9a8ffd4af31a0ebc423b4acbb2f043d865b8)
2007-10-10r6942: * merging the registry changes back to the 3.0 treeGerald Carter1-38/+0
* removing the testprns tool (This used to be commit 81ffb0dbbbd244623507880c323a3c37e2b8dc4d)
2007-10-10r6890: Refactor printing interface to take offset into job. Fixes bugJeremy Allison1-0/+40
where large print jobs can have out-of-order offsets. Bug found by Arcady Chernyak <Arcady.Chernyak@efi.com> Jeremy. (This used to be commit 482f7e0e3706098b71aa0b31a134994acb1e9fcf)
2007-10-10r6550: Move function make_dir_struct from util to dir.cJeremy Allison1-34/+0
Jeremy. (This used to be commit 5b86e3dcdf31dec61449d2faede61d24c3a8d79f)
2007-10-10r6502: add LOCKING debug class - pull PRINTINGDB class definition from trunkHerb Lewis1-0/+6
so our numbers don't get out of sync (This used to be commit 58e307664e02ebf0415f19ed625d2f166d9cb1cc)
2007-10-10r6495: Bugfix for #2596 by James Peach @ SGI. Fix become_root link issues ↵Jeremy Allison1-1/+1
and one IRIX stack backtrace bug. Jeremy. (This used to be commit c0b99c692b7e23a2bfe12c7230fd539771020750)
2007-10-10r6445: Make us survive the PARANOID_MALLOC_CHECKER. Should we enable that forVolker Lendecke1-10/+17
--enable-developer=yes? Volker (This used to be commit 61d40ac60dd9c8c9bbcf92e4fc57fe1d706bc721)
2007-10-10r6351: This is quite a large and intrusive patch, but there are not many ↵Volker Lendecke1-0/+50
pieces that can be taken out of it, so I decided to commit this in one lump. It changes the passdb enumerating functions to use ldap paged results where possible. In particular the samr calls querydispinfo, enumdomusers and friends have undergone significant internal changes. I have tested this extensively with rpcclient and a bit with usrmgr.exe. More tests and the merge to trunk will follow later. The code is based on a first implementation by Günther Deschner, but has evolved quite a bit since then. Volker (This used to be commit f0bb44ac58e190e19eb4e92928979b0446e611c9)