summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
AgeCommit message (Collapse)AuthorFilesLines
2003-05-27Fix unused variable warning.Tim Potter1-1/+2
(This used to be commit 0a80db5bde14e19d79411d832d51430d1b1c3454)
2003-04-22Merge from 3.0 - try harder to get our real DNS domain name, and send thisAndrew Bartlett1-6/+21
to the client when it asks for our DNS name and forest name. (needed for win2k to trust us as a trusted domain). Andrew Bartlett (This used to be commit 2a1015eb57da7b69caafd1221b871b6bff1af2fb)
2003-04-16Only use backtrace variables when we can use themJelmer Vernooij1-0/+2
(This used to be commit 17243c61b56c20c86b5d10be294d06addffedb6a)
2003-04-11A new RPC pipe! The \pipe\echo named pipe is for testing large RPCTim Potter1-44/+0
requests and responses and is only compiled in when --enable-developer is passed to configure. It includes server and client side code for generating and responding to functions on this pipe. The functions are: - AddOne: add one to the uint32 argument and return ig - EchoData: echo back a variable sized char array to the caller - SourceData: request a variable sized char array - SinkData: send a variable sized char array and throw it away There's a win32 implementation of the client and server in the junkcode CVS repository in the rpcecho-win32 subdirectory. (This used to be commit 4ccd34ef836eba05f81dc2da73fd7cfaac201798)
2003-03-31Fix formatting of back traces - pathc by metzeJelmer Vernooij1-2/+3
(This used to be commit 9cc17bcfe633496ba6270fd82963ff768ae017b0)
2003-03-26Use SAFE_FREE() instead of plain free() - pointed out by metzeJelmer Vernooij1-1/+2
(This used to be commit b49436d020f8d88d42428c83ea9a278d3433d134)
2003-03-26Output backtrace to logfile in smb_panic(), as suggested by mbpJelmer Vernooij1-8/+27
(only on systems that support it, of course) (This used to be commit bf439d733df6a11a25ff561a853c3382a3b34b96)
2003-03-22- Use FUNCTION_MACRO, not __FUNCTION__.Jelmer Vernooij1-1/+1
- Add some const (This used to be commit e149e70717f38e082ce35d55f9b4d84ba8419af7)
2003-03-22Small clenaup patches:Andrew Bartlett1-1/+3
- safe_string.h - don't assume that __FUNCTION__ is available - process.c - use new workaround from safe_string.h for the same - util.c - Show how many bytes we smb_panic()ed trying to smb_xmalloc() - gencache.c - Keep valgrind quiet by always null terminating. - clistr.c - Add copyright - srvstr.h - move srvstr_push into a .c file again, as a real function. - srvstr.c - revive, with 'safe' checked srvstr_push - loadparm.c - set a default for the display charset. Andrew Bartlett (This used to be commit a7eba37aadeb0b04cb1bd89deddb58be8aba825c)
2003-03-16 - Make ReadDirName return a const char*.Andrew Bartlett1-1/+1
- Consequential changes from that - mark our fstring/pstring assumptions in function prototypes Andrew Bartlett (This used to be commit fe2bc64bc439b27387b8f326b0f4f3bfcc3d04a1)
2003-03-15String handling parinoia fixes.Andrew Bartlett1-1/+15
This patch enables the compile-time checking of strings assable by means of sizeof(). (Original code had the configure check reversed). This is extended to all safe_strcpy() users, push_string and pull_string, as well as the cli and srv derivitives. There is an attempt to cap strings at the end of the cli buffer, and clobber_region() of the speified length (when not -1 :-). Becouse of the way they are declared, the 'overmalloc a string' users of safe_strcpy() have been changed to use overmalloc_safe_strcpy() (which skips some of the checks). This whole ball of mud worked fine, until I pulled out my 'fix' for our statcache. When jeremy fixes that, we should be able to get back to testing this stuff. This patch also includes a 'marker' of the last caller to clobber_region (ie, the function that called pstrcpy() that called clobber_region) to assist in debugging problems that may have smashed the stack. This is printed at smb_panic() time. (Original idea and patch by metze). It also removes some unsused functions, and #if 0's some others that are unused but probably should be used in the near future. For now, this patch gives us some confidence on one class of trivial parsing error in our code. Andrew Bartlett (This used to be commit 31f4827acc2a2f00399a5528fc83a0dae5cebaf4)
2003-03-14fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before ↵Gerald Carter1-0/+16
dereferencing (This used to be commit 2487480228b99183cab9e34ab497997e0c144ed6)
2003-03-12adding some initiaial code to sert %a to Win2K3 (using Native LanMan string ↵Gerald Carter1-0/+3
from .NET RC2) (This used to be commit 4c823e61d14a33344deb887043b60b2e3c83416f)
2003-02-27additional fix for CR 601Gerald Carter1-0/+3
* distinguish WinXP from Win2k * add a 1/3 of a second delay in OpenPrinter in order to trigger a LAN/WAN optimization in 2k clients. (This used to be commit 96570699d1b715f47c35aa211da6ec18f6fc4109)
2003-02-24Add constAndrew Bartlett1-4/+4
(This used to be commit ffaa608be01d72075942ca3aff2325c6364e0556)
2003-01-24Fix memory leak found my Leo Qiu <leoxqiu@yahoo.com>.Jeremy Allison1-1/+4
Jeremy. (This used to be commit af6e4ea640828438fe234db1652dc4c1e10a487e)
2003-01-17Enable dynamic loading of RPC modules. See docs/textdocs/RPC_PLUGGIN.txt ↵Jim McDonough1-0/+12
for instructions. (This used to be commit d51e12df78ff8fc721d693fedbd1c633f39edd49)
2003-01-13Patch from metze to add what he feels is the correct semantics for a DomainAndrew Bartlett1-0/+17
Controller. As we have had a number of attempts at this over the last little while, I need to get my test rig going, and give this whole area a poke... Meanwhile, if you want to use this, just adjust your 'auth methods' line to use samstrict_dc... Andrew Bartlett (This used to be commit 18e598ec24493026008fcfe486057555b8832108)
2003-01-13Patch from metze to to make testparm show values for 'workgroup', 'netbiosAndrew Bartlett1-7/+1
name' and 'netbios scope'. Probably has a similar effect on SWAT. Also adds '-V' to testparm. Andrew Bartlett (This used to be commit 71f4d8efd36351ddb2180103c160a6d737da62b1)
2003-01-13Accessing data after it's been free()ed really is a no-no...Andrew Bartlett1-1/+1
Andrew Bartlett (This used to be commit 6e821285a4aacfc0031957b88ddbec73d7e1dc11)
2003-01-03patch to include support for daemontools from Michael HandlerGerald Carter1-3/+6
(This used to be commit 4c48c475a28450ad4fd8dcc8263e841c0c39a80e)
2003-01-02Add PRINTF_ATTRIBUTE() to a few more printf() style functions. Aids inAndrew Bartlett1-1/+1
compiler-based argument checking. (This used to be commit 16fe928e68623a878b125910ff83df500a29d0ce)
2003-01-02BIG patch...Andrew Bartlett1-4/+4
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 (This used to be commit 92a777d0eaa4fb3a1c7835816f93c6bdd456816d)
2002-12-11Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.Jeremy Allison1-0/+2
Jeremy. (This used to be commit ff3a8d37289216a2cb808406044a7abef1e564d0)
2002-12-06Ensure global_scope() returns "", not the NULL string. Froma tpot fix.Jeremy Allison1-0/+6
Jeremy. (This used to be commit 7185b846e41da2bf7edaa7f3edeff1cc1486d28b)
2002-12-03fns for retrieving dns host name and domain name (get rid of lp_realm hacks).Jim McDonough1-0/+56
(This used to be commit 456813308d8542211183f9655b7fe598144f7bfc)
2002-11-12Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison1-600/+783
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
2002-08-31Add a bit of 'const' and move a lot of our 'repeditive' DEBUG() statements toAndrew Bartlett1-44/+39
'DEBUGADD', so we don't repeat headers. (Makes them much easier to read). (Based on patch by kai) Andrew Bartlett (This used to be commit 9deada345c5f89f338530c4de62835cc1eeb3d0e)
2002-08-28Some debugs for panic_action.Tim Potter1-1/+11
(This used to be commit 8f065f788b3af333c7c61236e33b6571b62b0c0d)
2002-08-22added smb_xstrndup()Andrew Tridgell1-0/+11
(This used to be commit 26fc20187d405702c50d1e7a38d3a94c84932bed)
2002-07-21Another smattering of static and constAndrew Bartlett1-1/+1
(This used to be commit 897cc4a610932e596f8a9807213166e380ef0203)
2002-07-20Add support for duplicating stderr into our logfiles.Andrew Bartlett1-17/+21
This is for two things: To allow panic actions etc to pump out backtraces to stderr and to allow vangrind to put its stuff in a logfile - making it possible to debug smbd when launched from inetd. I've also cleaned up some of the duplicate names in procedures between smbd and nmbd. Andrew Bartlett (This used to be commit 4bcb32731984b4aef1d4911a168a4e7a10d32fd4)
2002-07-18Add useful VALGRIND #ifdef.Jeremy Allison1-0/+2
Jeremy. (This used to be commit 07716f3a2316fedfe9a3210fd1dad8f7d1e4d9c8)
2002-07-11*Experimental* new large-scaling printer code. Splits printing.tdb intoJeremy Allison1-3/+3
a separate tdb per printer, but only keeps (currently one) tdb open at a time (although this is easily changed by changing a #define). Needs scalability testing with large numbers of printers now.... Jeremy. (This used to be commit b0909cfa14fc7ef29d2b98b56d52723570da782a)
2002-06-15Add back sys_getpwnam() and freinds to the system.c interface, but don'tAndrew Bartlett1-1/+1
use the silly cache any more. Also add group functions and fix a few callers. Andrew Bartlett (This used to be commit 41d4b94077c118ecde2bf8792b9bb7ab71c6403e)
2002-06-03put the ifdef for HAVE_VA_COPY in one place rather than in lots ofAndrew Tridgell1-5/+3
functions (This used to be commit 1cf3228fdc20f0314d1f8e71ad710a5e548b3f72)
2002-05-22Add a bit more const, and kill of (finally!) sys_getpwnam and sys_getpwuid.Andrew Bartlett1-6/+9
These might be reimplmented as simple pass-through functions, but all users really should be doing 'getpwnam_alloc' or 'getpwuid_alloc' to ensure that there are not shared static buffers. I don't beleive we actually need a getpw*() cache inside samba - if we do then I think we should look at our code design first. (some of these changes are for platforms I don't have access to, but they look sane) Andrew Bartlett (This used to be commit 9d8431b04f41dceffe4c45cc969472ee59f7282f)
2002-05-22Cleanups!Andrew Bartlett1-1/+1
Make some code static, add some const to the PAM code, and make the plaintext password code actually function - particulary without the requirement to modify the 'struct passwd' (which it assumed was made up of fstrings) This kills some particularly ugly code in lib/util_pw.c Andrew Bartlett (This used to be commit 302dad4990ba5194f072e435465d9adaa089ae06)
2002-05-22Fix a silly memory (getpnam_alloc()) leak spotted by Elrond, and moveAndrew Bartlett1-94/+9
the DATA_BLOB code into its own file. It would be nice to go over some of the other util.c functions, and check that we still use them all, and that we use them in more than one place. Andrew Bartlett (This used to be commit d0ea70fce55df9a5b5878f50fce7bc115ffb37c2)
2002-05-17Fix usage of va_list passed as an arg. Use __va_copy before using itJim McDonough1-1/+7
when it exists. (This used to be commit 85ab07bdc1b2ce7b2c1b8197fad45124b1460dca)
2002-05-17This removes --with-ssl from Samba.Andrew Bartlett1-7/+0
This option was badly maintained, useless and confused our users and distirbutors. (its SSL, therfore it must be good...) No windows client uses this protocol without help from an SSL tunnel. I can't see any reason why setting up a unix-side SSL wrapper would be any more difficult than the > 10 config options this mess added to samba in any case. On the Samba client end, I think the LIBSMB_PROG hack should be sufficient to start stunnel on the unix side. We might extend this to take %i and %p (IP and port) if there is demand. Andrew Bartlett (This used to be commit b04561d3fd3ee732877790fb4193b20ad72a75f8)
2002-05-09pidfile merge from SAMBA_2_2 (including --with-fhs) and a few other minor ↵Gerald Carter1-14/+39
things; compiles and shouldnt break, but needs testing (This used to be commit 19b9b50d9039afe614284aaf379f9f1078e2e307)
2002-05-08Merge in Jerry's called name fix.Jeremy Allison1-58/+66
Jeremy. (This used to be commit 6d957924579d64407bdd94d7e78088fb1ea5c9ce)
2002-04-19Fix different args to sys_fcntl without going varargs....Jeremy Allison1-3/+3
Jeremy. (This used to be commit 65742067e07195048edcee46dae95a58a4a50950)
2002-04-19Added sys_fcntl (not to be used everywhere). Added sys_read/sys_writeJeremy Allison1-7/+4
for transfer_file. Jeremy. (This used to be commit c7ff521bab838c070931f2b0ece4be3371fbcdbf)
2002-04-19First cut at fix for the EINTR problem... More needs to be done I think.Jeremy Allison1-4/+5
Jeremy. (This used to be commit 48475a7a697242b9fd7b1aec24389afb112569c4)
2002-04-04Also look for libinsure.so where the full version installs it.Tim Potter1-0/+5
(This used to be commit 2bf6595a2a5527ff64f9083f2434aa344c9637d9)
2002-03-27In msleep - never sleep for more than 1 second. Cope with time changes.Jeremy Allison1-16/+27
Jeremy. (This used to be commit 9fb6a475264f465e30a23c34b5c9266921d135d1)
2002-03-20Add assertions that kill() is never accidentally passed a non-positiveMartin Pool1-0/+3
pid. This follows a bug in rsync where it would accidentally kill(-1), removing all the user's processes. I can't see any way this would directly happen in Samba, but having the assertions seems beneficial. http://cvs.samba.org/cgi-bin/cvsweb/rsync/util.c.diff?r1=1.108&r2=1.109&f=h (This used to be commit 098905bea29c7d5b886809d431294ddf2fc1e152)
2002-01-31Fix from Michael Steffens <michael_steffens@hp.com> to make signalJeremy Allison1-1/+1
processing work correctly in winbindd. This is a really good patch that gives full select semantics to the Samba modified select. Jeremy. (This used to be commit 3af16ade173cac24c1ac5eff4a36b439f16ac036)