summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix formatting of back traces - pathc by metzeJelmer Vernooij2003-03-311-2/+3
|
* Use SAFE_FREE() instead of plain free() - pointed out by metzeJelmer Vernooij2003-03-261-1/+2
|
* Output backtrace to logfile in smb_panic(), as suggested by mbpJelmer Vernooij2003-03-261-8/+27
| | | | (only on systems that support it, of course)
* - Use FUNCTION_MACRO, not __FUNCTION__.Jelmer Vernooij2003-03-221-1/+1
| | | | - Add some const
* 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
* - 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
* 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
* fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before ↵Gerald Carter2003-03-141-0/+16
| | | | dereferencing
* adding some initiaial code to sert %a to Win2K3 (using Native LanMan string ↵Gerald Carter2003-03-121-0/+3
| | | | from .NET RC2)
* 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.
* Add constAndrew Bartlett2003-02-241-4/+4
|
* Fix memory leak found my Leo Qiu <leoxqiu@yahoo.com>.Jeremy Allison2003-01-241-1/+4
| | | | Jeremy.
* Enable dynamic loading of RPC modules. See docs/textdocs/RPC_PLUGGIN.txt ↵Jim McDonough2003-01-171-0/+12
| | | | for instructions.
* 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
* 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
* Accessing data after it's been free()ed really is a no-no...Andrew Bartlett2003-01-131-1/+1
| | | | Andrew Bartlett
* patch to include support for daemontools from Michael HandlerGerald Carter2003-01-031-3/+6
|
* Add PRINTF_ATTRIBUTE() to a few more printf() style functions. Aids inAndrew Bartlett2003-01-021-1/+1
| | | | compiler-based argument checking.
* 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
* Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.Jeremy Allison2002-12-111-0/+2
| | | | Jeremy.
* Ensure global_scope() returns "", not the NULL string. Froma tpot fix.Jeremy Allison2002-12-061-0/+6
| | | | Jeremy.
* fns for retrieving dns host name and domain name (get rid of lp_realm hacks).Jim McDonough2002-12-031-0/+56
|
* 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.
* 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
* Some debugs for panic_action.Tim Potter2002-08-281-1/+11
|
* added smb_xstrndup()Andrew Tridgell2002-08-221-0/+11
|
* Another smattering of static and constAndrew Bartlett2002-07-211-1/+1
|
* 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
* Add useful VALGRIND #ifdef.Jeremy Allison2002-07-181-0/+2
| | | | Jeremy.
* *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.
* 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
* put the ifdef for HAVE_VA_COPY in one place rather than in lots ofAndrew Tridgell2002-06-031-5/+3
| | | | functions
* 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
* 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
* 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
* Fix usage of va_list passed as an arg. Use __va_copy before using itJim McDonough2002-05-171-1/+7
| | | | when it exists.
* 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
* 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
* Merge in Jerry's called name fix.Jeremy Allison2002-05-081-58/+66
| | | | Jeremy.
* Fix different args to sys_fcntl without going varargs....Jeremy Allison2002-04-191-3/+3
| | | | Jeremy.
* Added sys_fcntl (not to be used everywhere). Added sys_read/sys_writeJeremy Allison2002-04-191-7/+4
| | | | | for transfer_file. Jeremy.
* First cut at fix for the EINTR problem... More needs to be done I think.Jeremy Allison2002-04-191-4/+5
| | | | Jeremy.
* Also look for libinsure.so where the full version installs it.Tim Potter2002-04-041-0/+5
|
* In msleep - never sleep for more than 1 second. Cope with time changes.Jeremy Allison2002-03-271-16/+27
| | | | Jeremy.
* Add assertions that kill() is never accidentally passed a non-positiveMartin Pool2002-03-201-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
* Fix from Michael Steffens <michael_steffens@hp.com> to make signalJeremy Allison2002-01-311-1/+1
| | | | | | processing work correctly in winbindd. This is a really good patch that gives full select semantics to the Samba modified select. Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* minor fix and checksSimo Sorce2002-01-271-2/+4
|
* Remove the 'direct to winbind' hacks, as they should (if I understandAndrew Bartlett2002-01-261-12/+0
| | | | | | | | correctly) be no longer needed. This is in aid of the 'winbind default domain' code - which works much better when smbd always goes via the standard unix interfaces. Andrew Bartlett
* minor fixesSimo Sorce2002-01-251-2/+3
|