summaryrefslogtreecommitdiff
path: root/source3/lib/debug.c
AgeCommit message (Collapse)AuthorFilesLines
2001-10-29More spelling and grammer from Vance. <vance@digital-host.net>Andrew Bartlett1-15/+16
Thanks! Andrew Bartlett (This used to be commit f019bed7663b4a20c1b5ab6b59fcadda17b89acd)
2001-10-27smbd/notify_hash.c: Merged Herb's fix.Jeremy Allison1-1/+2
lib/debug.c: Fix for potential null pointer access. Jeremy. (This used to be commit 5a4d22dd66ab782f6161aa5a4162c0e7f1d811fb)
2001-10-02Fixed the bug with member servers in a Samba PDC hosted domain not allowingJeremy Allison1-2/+8
other access. Problem was max time was being set to 0xffffffff, instead of 0x7fffffff. Jeremy. (This used to be commit 94403d841710391ec26539e4b4157439d5778ff7)
2001-09-10replaced stdio in many parts of samba with a XFILE. XFILE is a cut-downAndrew Tridgell1-17/+17
replacemnt of stdio that doesn't suffer from the 8-bit filedescriptor limit that we hit with nasty consequences on some systems I would eventually prefer us to have a configure test to see if we need to replace stdio, but for now this code needs to be tested widely so I'm enabling it by default. (This used to be commit 1af8bf34f1caa3e7ec312d8109c07d32a945a448)
2001-07-25got rid of INFO: msgs at debug level 1Andrew Tridgell1-2/+2
(This used to be commit e6773b08a4a1a54dca4a2e2ec5d4e9c43383b072)
2001-07-06got rid of insanely verbose debug messages on startupAndrew Tridgell1-1/+1
(This used to be commit c3a21fc0f21b3f493031cb0c9a6a990528b276d9)
2001-07-04strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell1-1/+1
can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-06-22Fix for race condition found by Herb where we can end up with a NULL dbf.Jeremy Allison1-8/+0
Jeremy. (This used to be commit 5cbb2106735ad0533198a83d62541cabd7beed20)
2001-06-01If a debug class was explicitly set to zero the debug system would notTim Potter1-14/+36
recognise it as there was no distinction made between zeroing a debug class and just not setting it to anything. I've added a debuglevel_isset array in parallel with the debuglevel_class array to fix this. Added a couple of new debug classes which I might start filling out to get smb, rpc header and rpc marshall/unmarshalling debugs tidied up. Fixed a bunch of cut&paste bugs in include/debug.h Modified smbcontrol and the messaging system debug handler to like the debuglevel_isset stuff. (This used to be commit 391e7caf76cbc22021629ef0ec5e0c32806edfd7)
2001-05-07Hey what happened to my debug messages? Early exit from reopen_logs()Tim Potter1-0/+11
if using stdout_logging. (This used to be commit 831b0983bd799fd73de18921f09991a1647ec482)
2001-04-28- added test for vasprintfAndrew Tridgell1-42/+0
- cleaned up GNUC printf attribute macros - added enum handling in mkproto - removed non-vararg code - made slprintf and vslprintf just macros for snprintf and vsnprintf - don't need slprintf code any more (This used to be commit c7aeb2254dfc3cd0aa0b6c0bdd426f9323be0ddf)
2001-04-27More %d (uid_t) stuff...Jeremy Allison1-3/+3
Jeremy. (This used to be commit 73b425121a8c99af3ed7adbdcff3f6f0cec92ac7)
2001-03-27Patch from David Gibson <dgibson@linuxcare.com> to reduce "silent abort"Jeremy Allison1-51/+83
problems with smbd failing to create a log file. If we can't create a log file keep using the old file. Jeremy. (This used to be commit c4e6aa1322fa7bc59708163c42eef6ccbd6c2305)
2001-03-11Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison1-2/+7
RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549)
2001-02-20up the debug level of the debug level change msgAndrew Tridgell1-2/+2
(This used to be commit 9b25342f4ac4a250b3a10a3bb048ca6baa2ca41e)
2001-02-13It compiles for me now :-). rpc_server/srv_lsa.c - added fix to allow w2kJeremy Allison1-6/+6
clients to join a Samba domain - odd or even domain name length. Needs more testing. Jeremy. (This used to be commit 408672d38261e34cc3714200617b35464d88f931)
2001-02-12Merge of JohnR's changes to appliance-head, JF's changes to 2.2,Jeremy Allison1-6/+122
updated the POSIX_ACL code to be in sync. Jeremy. (This used to be commit c0517d6f4e3079feca1309fd1ea7b21e83f0de02)
2000-11-16Fix for a problem with the new messaging system. If a sender is using theJeremy Allison1-1/+1
messaging system as a notification mechanism, and the speed of notification greatly exceeds the speed of message recovery, then you get a massively (>75Mb) growing tdb. If the message is a simple notification, then the message is static, and you only need one of them in transit to a target process at any one time. This patch adds a BOOL "allow_duplicates" to the message_send_XX primitives. If set to False, then before sending a message the sender checks the existing message queue for a target pid for a duplicate of this message, and doesn't add to it if one already exists. Also added code into msgtest.c to test this. Jeremy. (This used to be commit 3aa7995660395ecb85c8e35b638fa9fbbb952558)
2000-11-10Merge in Herb's changes from 2.2.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 24d76c5fbda29d89c96d7c22193ec2eb93ad3887)
2000-09-12- changed the msg_type to be an int instead of an enum so that it isAndrew Tridgell1-1/+1
easier to add new message types to messages.h without breaking old binaries - added a MSG_FORCE_ELECTION message to force nmbd to hold an election (This used to be commit f1c49ca7ce56bc39259041a71479e84ebf53eeca)
2000-09-12much nicer message interface. We now register dispatch functions,Andrew Tridgell1-18/+17
allowing new bits of code or vfs modules to register functions without impacting on the messaging code itself. Also note that multiple registrations for the same message type are possible allowing the same message to be delivered to multiple parts of the code (possibly useful for reload messages). (This used to be commit c3350c77f52cade48d2945574e09cb630af85b92)
2000-09-11the first cut of the internal messaging system.Andrew Tridgell1-44/+17
The motivation for this system is to replace the UDP message for oplocks, but this commit only does the "set debug level" message. (This used to be commit 2a34ee95f3929cff131db6c5a2b4820194c05b2d)
2000-08-28made reopen_logs() always re-open logs, not try and be smart about notAndrew Tridgell1-37/+34
re-opening in some circumstances. This fixes a problem where a HUP does not re-open logs and leaves the log open on a unlinked file. (This used to be commit f99f028c77482e591741df2a3da7f036f7409a68)
2000-06-12totally rewrote the async signal, notification and oplock notificationAndrew Tridgell1-0/+4
handling in Samba. This was needed due to several limitations and races in the previous code - as a side effect the new code is much cleaner :) in summary: - changed sys_select() to avoid a signal/select race condition. It is a rare race but once we have signals doing notification and oplocks it is important. - changed our main processing loop to take advantage of the new sys_select semantics - split the notify code into implementaion dependent and general parts. Added the following structure that defines an implementation: struct cnotify_fns { void * (*register_notify)(connection_struct *conn, char *path, uint32 flags); BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t); void (*remove_notify)(void *data); }; then I wrote two implementations, one using hash/poll (like our old code) and the other using the new Linux kernel change notify. It should be easy to add other change notify implementations by creating a sructure of the above type. - fixed a bug in change notify where we were returning the wrong error code. - rewrote the core change notify code to be much simpler - moved to real-time signals for leases and change notify Amazingly, it all seems to work. I was very surprised! (This used to be commit 44766c39e0027c762bee8b33b12c621c109a3267)
2000-05-02Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison1-1/+1
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
2000-04-15Log file check patch from Mattias Gronlund <Mattias.Gronlund@sa.erisoft.se>.Jeremy Allison1-6/+32
Modified to do checks in timeout processing not in main loop. This (IMHO) is the correct place as (a) we are already root, and (b) it is guarenteed to be called every 200 smb requests. Jeremy. (This used to be commit c3794fd29fdc4e5a0dbd725cdc24fe210934caf2)
2000-02-15Added replacement functions sys_popen and sys_pclose. These are basedJeremy Allison1-4/+8
on the glibc source code and are safer than the traditional popen as they don't use a shell to exec the requested command. Now we have these functions they can be tightened up (environment etc.) as required to make a safe popen. It should now be safe to add the environement variable loading code to loadparm.c Jeremy. (This used to be commit b52e92b09d4ca3b66e534f520468dee27065d048)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-196/+60
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1998-12-16A while back, Andrew and I talked about making the debug parsing code aChristopher R. Hertel1-1/+159
better "fit" with other Samba code. This is a small first step toward doing what (I think) we agreed to do. I've moved the key function from ubiqx/debugparse.c into lib/debug.c. I have also moved the enum from ubiqx/debugparse.h into the debug section in smb.h. The next thing to do is to get debug2html added into the Makefile.in so that it is always produced when compiling the suite. Chris -)----- (This used to be commit 782474f41e0c2bc0b1f098758a3e5cb44e87d8b1)
1998-11-17Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1-4/+4
Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac)
1998-11-17- group database API. oops and oh dear, the threat has been carried out:Luke Leighton1-4/+16
the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION. (This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-09-28Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1-0/+4
Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09)
1998-09-17configure configure.in: Added checks for statvfs64. Last bit of 64 bit ↵Jeremy Allison1-2/+2
widening (I hope :-). include/config.h.in: Added #undef STAT_STATVFS64. include/includes.h: Added SMB_STRUCT_STATVFS type, Changed SMB_BIG_INTEGER to SMB_BIG_UINT and SMB_BIG_INT types. include/smb.h: Added flag defines from CIFS spec. lib/debug.c: Fixed one more mode_t issue. lib/system.c: Added sys_statvfs wrapper. lib/util.c: Changed trim_string to use size_t. param/loadparm.c: Moved "blocking locks" into locking section. Alphabetised locking options. Question - shuld we do this for all options ? passdb/ldap.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. passdb/nispass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. passdb/smbpass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. smbd/dfree.c: Changed to use 64 bit types if available. Moved to use unsigned types. smbd/dosmode.c: Fixed one more mode_t issue. smbd/negprot.c: Changed literals to be FLAG_ #defines. smbd/nttrans.c: Removed dead code. smbd/open.c: Changed disk_free call. smbd/process.c: Changed literals to be FLAG_ #defines. smbd/reply.c: Changed disk_free call. smbd/trans2.c: Fixed but in SMB_QUERY_FS_VOLUME_INFO call. Was using UNICODE - should use ascii. tests/summary.c: Added STAT_STATVFS64 check. Jeremy. (This used to be commit c512b1b91fb7f2a7a93b9033a33e06d966daadb4)
1998-09-03Ok - this is the 64 bit widening check in. It changes the configureJeremy Allison1-1/+1
to check for stat64 and friends, and then changes much of Samba to use the data type SMB_OFF_T for file size information. stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide the 64 bit calls if needed. Note that this still does not expose 64 bit functionality to the client, as the changes to the reply_xxx smb's are not yet done. This code change should make these changes possible. Still to do before full 64 bit-ness to the client: fcntl lock code. statfs code widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T types being in place). Let me know if wierd things happen after this check-in and I'll fix them :-). Jeremy. (This used to be commit 14500936c321d15995c963766aac67bf1f4e3824)
1998-09-01More abstraction of file system data types, to move to a 64Jeremy Allison1-1/+1
bit file interface for the NT SMB's. Created a new define, SMB_STRUCT_STAT that currently is defined to be struct stat - this wil change to a user defined type containing 64 bit info when the correct wrappers are written for 64 bit stat(), fstat() and lstat() calls. Also changed all sys_xxxx() calls that were previously just wrappers to the same call prefixed by a dos_to_unix() call into dos_xxxx() calls. This makes it explicit when a pathname translation is being done, and when it is not. Now, all sys_xxx() calls are meant to be wrappers to mask OS differences, and not silently converting filenames on the fly. Jeremy. (This used to be commit 28aa182dbffaa4ffd86047e608400de4b26e80eb)
1998-08-30don't put two spaces at the start of lines if logging to stdoutAndrew Tridgell1-1/+3
or not timestamping. (This used to be commit 70ed0ec202c50655e3ba99535b06ad918409051e)
1998-08-21Just tweaking.Christopher R. Hertel1-2/+20
If the output line is longer than the format buffer could manage, I was simply ignoring the additional output (that is, *not* copying it to the format buffer--thus avoiding a buffer overrun). Instead, I now output the current content followed by " +>\n", and then reset the format buffer. I have never seen a debug line that exceeds the size of a pstring, but I might as well handle the situation...just in case. Chris -)----- (This used to be commit 8a11d04b7796b256953bf92b2f2ccab763215bc4)
1998-08-15configure: Changes for extra headers.Jeremy Allison1-4/+2
configure.in: Source for header changes. client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile. include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers. include/includes.h: Headers for the above. include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int). lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/debug.c: Fixed signal functs. lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile. libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem_sysv.c: Fixed error messages in sysV stuff. nmbd/asyncdns.c: Fixed signal functs. nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/nttrans.c: Fixed fsp code path. smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem. smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/trans2.c: Fixed core dump bug. smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile. Jeremy. (This used to be commit 1b9cbcd02e575dc0a95fa589f720df30a4acc46b)
1998-08-12I've added a dbgflush() function to debug.c. Calling this will cause theChristopher R. Hertel1-5/+31
debug format buffer to be written out (and reset). fflush() is also called to force the issue. I replaced the call to fflush() in client.c with a call to dbgflush(), which seems to have fixed the problem that Andrew was working on (i.e., that the prompt was not displayed when using smbclient). Chris -)----- (This used to be commit a97460869fe1448be5132fdab586d30872d21a69)
1998-08-11Cleaned up some lint warnings (functions with return values that wereChristopher R. Hertel1-12/+13
ignored). (This used to be commit 8fedcfc48da2741722b867bbb056a078901e7431)
1998-08-11I've added a test for lp_loaded() so that timestamps *will* be outputChristopher R. Hertel1-4/+9
before the config file has been loaded. Otherwise the default is no timestamp. Chris -)----- (This used to be commit fd7eaed59efbe2ce6998d5902e70d79f533b3372)
1998-08-11fixed a nasty bug in debug.cAndrew Tridgell1-1/+1
Debug1() was being called like this: Debug1( format_bufr ); but if format_bufr contains any %s or other % arguments (such as when processing a smb.conf file containing % macros) then smbd dies a horrible death. The quick fix is to use: Debug1( "%s", format_bufr); (This used to be commit 5ae04012819ae3e63102d6875088ef00c27492b4)
1998-08-03First implementation of ChangeNotify - this version only checksJeremy Allison1-2/+3
for changes in the directory modify timestamps. A better version will look at the requested client flags, and create a hash that represents the current state of the directory, and check against this instead. debug.c: Added lp_timestamp_logs() function. loadparm.c: Added "change notify timeout" in seconds (default 60) - this is the scan rate for a directory. Added ""timestamp logs" boolean - default True. Turns off log timestamps (so I can read them :-). nttrans.c: ChangeNotify implementation. server.c: ChangeNotify implementation. shmem_sysv.c: Added exits on shmem errors (without them smbd can core dump if some calls fail). smb.h: Added ChangeNotify flags for future use. util.c: Tidied up typedef. Jeremy. (This used to be commit a0748c3f53974483680ebe2ea4f556ece8d7fa43)
1998-08-03This is the remaining set of changes needed to replace the changes lostChristopher R. Hertel1-11/+7
when Andrew and I were both working with util.c. I really don't know how I lost the autoconfigure changes (honest, I *did* run frequent updates). Chris -)----- (This used to be commit bedefc2066ac86199b29ccd7f65ad5f1d8a899c4)
1998-08-03I have fixed some of the autoconfigure problems. I'm studying the diffsChristopher R. Hertel1-9/+13
for the rest. I've found that only debug.h seems to be out of sync (i.e., util.c itself appears to be okay). Chris -)----- (This used to be commit b41cdbffb7233f73ac15526f7b5499658256cd82)
1998-07-31Debugging functions are now in their own module.Christopher R. Hertel1-0/+533
Chris -)----- (This used to be commit 2c6dc2779647bbc0c27a102632882e617ef7643e)