summaryrefslogtreecommitdiffstats
path: root/source3/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* sync 3.0 into HEAD for the last timeGerald Carter2003-09-091-76/+5
| | | | (This used to be commit c17a7dc9a190156a069da3e861c18fd3f81224ad)
* port latest changes from SAMBA_3_0 treeSimo Sorce2003-08-021-2/+2
| | | | (This used to be commit 3101c236b8241dc0183995ffceed551876427de4)
* trying to get HEAD building again. If you want the codeGerald Carter2003-07-161-12/+37
| | | | | prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE (This used to be commit adb98e7b7cd0f025b52c570e4034eebf4047b1ad)
* Fix unused variable warning.Tim Potter2003-05-271-1/+2
| | | | (This used to be commit 0a80db5bde14e19d79411d832d51430d1b1c3454)
* Merge from 3.0 - try harder to get our real DNS domain name, and send thisAndrew Bartlett2003-04-221-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)
* Only use backtrace variables when we can use themJelmer Vernooij2003-04-161-0/+2
| | | | (This used to be commit 17243c61b56c20c86b5d10be294d06addffedb6a)
* A new RPC pipe! The \pipe\echo named pipe is for testing large RPCTim Potter2003-04-111-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)
* Fix formatting of back traces - pathc by metzeJelmer Vernooij2003-03-311-2/+3
| | | | (This used to be commit 9cc17bcfe633496ba6270fd82963ff768ae017b0)
* Use SAFE_FREE() instead of plain free() - pointed out by metzeJelmer Vernooij2003-03-261-1/+2
| | | | (This used to be commit b49436d020f8d88d42428c83ea9a278d3433d134)
* Output backtrace to logfile in smb_panic(), as suggested by mbpJelmer Vernooij2003-03-261-8/+27
| | | | | (only on systems that support it, of course) (This used to be commit bf439d733df6a11a25ff561a853c3382a3b34b96)
* - Use FUNCTION_MACRO, not __FUNCTION__.Jelmer Vernooij2003-03-221-1/+1
| | | | | - Add some const (This used to be commit e149e70717f38e082ce35d55f9b4d84ba8419af7)
* Small clenaup patches:Andrew Bartlett2003-03-221-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)
* - Make ReadDirName return a const char*.Andrew Bartlett2003-03-161-1/+1
| | | | | | | | | - Consequential changes from that - mark our fstring/pstring assumptions in function prototypes Andrew Bartlett (This used to be commit fe2bc64bc439b27387b8f326b0f4f3bfcc3d04a1)
* String handling parinoia fixes.Andrew Bartlett2003-03-151-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)
* fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before ↵Gerald Carter2003-03-141-0/+16
| | | | | | dereferencing (This used to be commit 2487480228b99183cab9e34ab497997e0c144ed6)
* adding some initiaial code to sert %a to Win2K3 (using Native LanMan string ↵Gerald Carter2003-03-121-0/+3
| | | | | | from .NET RC2) (This used to be commit 4c823e61d14a33344deb887043b60b2e3c83416f)
* additional fix for CR 601Gerald Carter2003-02-271-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)
* Add constAndrew Bartlett2003-02-241-4/+4
| | | | (This used to be commit ffaa608be01d72075942ca3aff2325c6364e0556)
* Fix memory leak found my Leo Qiu <leoxqiu@yahoo.com>.Jeremy Allison2003-01-241-1/+4
| | | | | Jeremy. (This used to be commit af6e4ea640828438fe234db1652dc4c1e10a487e)
* Enable dynamic loading of RPC modules. See docs/textdocs/RPC_PLUGGIN.txt ↵Jim McDonough2003-01-171-0/+12
| | | | | | for instructions. (This used to be commit d51e12df78ff8fc721d693fedbd1c633f39edd49)
* Patch from metze to add what he feels is the correct semantics for a DomainAndrew Bartlett2003-01-131-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)
* Patch from metze to to make testparm show values for 'workgroup', 'netbiosAndrew Bartlett2003-01-131-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)
* Accessing data after it's been free()ed really is a no-no...Andrew Bartlett2003-01-131-1/+1
| | | | | Andrew Bartlett (This used to be commit 6e821285a4aacfc0031957b88ddbec73d7e1dc11)
* patch to include support for daemontools from Michael HandlerGerald Carter2003-01-031-3/+6
| | | | (This used to be commit 4c48c475a28450ad4fd8dcc8263e841c0c39a80e)
* Add PRINTF_ATTRIBUTE() to a few more printf() style functions. Aids inAndrew Bartlett2003-01-021-1/+1
| | | | | compiler-based argument checking. (This used to be commit 16fe928e68623a878b125910ff83df500a29d0ce)
* BIG patch...Andrew Bartlett2003-01-021-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)
* Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.Jeremy Allison2002-12-111-0/+2
| | | | | Jeremy. (This used to be commit ff3a8d37289216a2cb808406044a7abef1e564d0)
* Ensure global_scope() returns "", not the NULL string. Froma tpot fix.Jeremy Allison2002-12-061-0/+6
| | | | | Jeremy. (This used to be commit 7185b846e41da2bf7edaa7f3edeff1cc1486d28b)
* fns for retrieving dns host name and domain name (get rid of lp_realm hacks).Jim McDonough2002-12-031-0/+56
| | | | (This used to be commit 456813308d8542211183f9655b7fe598144f7bfc)
* Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison2002-11-121-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)
* Add a bit of 'const' and move a lot of our 'repeditive' DEBUG() statements toAndrew Bartlett2002-08-311-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)
* Some debugs for panic_action.Tim Potter2002-08-281-1/+11
| | | | (This used to be commit 8f065f788b3af333c7c61236e33b6571b62b0c0d)
* added smb_xstrndup()Andrew Tridgell2002-08-221-0/+11
| | | | (This used to be commit 26fc20187d405702c50d1e7a38d3a94c84932bed)
* Another smattering of static and constAndrew Bartlett2002-07-211-1/+1
| | | | (This used to be commit 897cc4a610932e596f8a9807213166e380ef0203)
* Add support for duplicating stderr into our logfiles.Andrew Bartlett2002-07-201-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)
* Add useful VALGRIND #ifdef.Jeremy Allison2002-07-181-0/+2
| | | | | Jeremy. (This used to be commit 07716f3a2316fedfe9a3210fd1dad8f7d1e4d9c8)
* *Experimental* new large-scaling printer code. Splits printing.tdb intoJeremy Allison2002-07-111-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)
* Add back sys_getpwnam() and freinds to the system.c interface, but don'tAndrew Bartlett2002-06-151-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)
* put the ifdef for HAVE_VA_COPY in one place rather than in lots ofAndrew Tridgell2002-06-031-5/+3
| | | | | functions (This used to be commit 1cf3228fdc20f0314d1f8e71ad710a5e548b3f72)
* Add a bit more const, and kill of (finally!) sys_getpwnam and sys_getpwuid.Andrew Bartlett2002-05-221-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)
* Cleanups!Andrew Bartlett2002-05-221-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)
* Fix a silly memory (getpnam_alloc()) leak spotted by Elrond, and moveAndrew Bartlett2002-05-221-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)
* Fix usage of va_list passed as an arg. Use __va_copy before using itJim McDonough2002-05-171-1/+7
| | | | | when it exists. (This used to be commit 85ab07bdc1b2ce7b2c1b8197fad45124b1460dca)
* This removes --with-ssl from Samba.Andrew Bartlett2002-05-171-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)
* pidfile merge from SAMBA_2_2 (including --with-fhs) and a few other minor ↵Gerald Carter2002-05-091-14/+39
| | | | | | things; compiles and shouldnt break, but needs testing (This used to be commit 19b9b50d9039afe614284aaf379f9f1078e2e307)
* Merge in Jerry's called name fix.Jeremy Allison2002-05-081-58/+66
| | | | | Jeremy. (This used to be commit 6d957924579d64407bdd94d7e78088fb1ea5c9ce)
* Fix different args to sys_fcntl without going varargs....Jeremy Allison2002-04-191-3/+3
| | | | | Jeremy. (This used to be commit 65742067e07195048edcee46dae95a58a4a50950)
* Added sys_fcntl (not to be used everywhere). Added sys_read/sys_writeJeremy Allison2002-04-191-7/+4
| | | | | | for transfer_file. Jeremy. (This used to be commit c7ff521bab838c070931f2b0ece4be3371fbcdbf)
* First cut at fix for the EINTR problem... More needs to be done I think.Jeremy Allison2002-04-191-4/+5
| | | | | Jeremy. (This used to be commit 48475a7a697242b9fd7b1aec24389afb112569c4)
* Also look for libinsure.so where the full version installs it.Tim Potter2002-04-041-0/+5
| | | | (This used to be commit 2bf6595a2a5527ff64f9083f2434aa344c9637d9)