summaryrefslogtreecommitdiff
path: root/source3/lib/debug.c
AgeCommit message (Collapse)AuthorFilesLines
2010-11-02s3-libsmbclient Add comments to describe the behaviour of DEBUG()Andrew Bartlett1-0/+5
This isn't quite what you would expect from this interface, but actually avoids some really nasty situations if you ever have more than one libsmbclient context in a process. In the real world, if you have asked for DEBUG() to stderr in one part of the code, you will want it globally, even in a different thread (which in the past would have rest everything to stdout again, at least while starting up). Andrew Bartlett
2010-11-02debug Explain the behaviour of setup_logging() more clearlyAndrew Bartlett1-0/+6
2010-11-02s3-debug Clarify the handling of invalid state.fd values in debug.cAndrew Bartlett1-9/+10
This makes it clear that -1 and 0 are both invalid file descriptor values for DEBUG output. Andrew Bartlett
2010-11-02s3-debug Convert from x_file to real file descriptors.Andrew Bartlett1-47/+31
X_FILE does not gain us anything in this use case, we want our log messages on disk, not in a buffer, and we don't gain anything from the X_FILE api. I discussed the matter with tridge, who feels that to use FILE in the first place was a mistake, and that X_FILE isn't any better, but was a stop-gap to avoid issues on solaris. Andrew Bartlett
2010-11-02s3-debug Remove 'AllowDebugChange' and use lp_set_cmdline() insteadAndrew Bartlett1-4/+0
By removing this global variable, the API between the two different debug systems is made more similar. Both s3 and s4 now have lp_set_cmdline() which ensures that the smb.conf cannot overwrite these the user-specified log level. Andrew Bartlett
2010-11-02s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett1-74/+90
This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
2010-05-06s3: only include gen_ndr headers where needed.Günther Deschner1-0/+1
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time as follows: ccache build w/o patch real 4m21.529s ccache build with patch real 3m6.402s pch build w/o patch real 4m26.318s pch build with patch real 3m6.932s Guenther
2010-02-12Use sec_initial_uid() in the places where being root doesn't matter,Jeremy Allison1-1/+1
and 0 in the places where it does. Jeremy
2009-11-29s3: "check_log_size" only looks at the sizeVolker Lendecke1-2/+1
2009-11-29s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke1-1/+3
Step 0 to restore it as a per-share paramter
2009-11-03s3: Remove debug_ctx()Volker Lendecke1-17/+2
smbd just crashed on me: In a debug message I called a routine preparing a string that itself used debug_ctx. The outer routine also used it after the inner routine had returned. It was still referencing the talloc context that the outer debug_ctx() had given us, which the inner DEBUG had already freed.
2009-08-26s3: Allow full_audit to play nice with smbd if it's using syslogtprouty1-0/+6
Explictly pass the facility from both smbd and full_audit to syslog. Really the only major change is to not call openlog() in full_audit if WITH_SYSLOG is defined, which implies that smbd is already using syslog. This allows full audit to piggy-back on the same ident as smbd, while still differentiating the logging via the facility.
2009-06-29Fix ndrdump to use a common setup_logging() APIAndrew Bartlett1-0/+9
By adding a new common setup_logging_stdout() API, we no longer need to abuse the ABI compatability between the different setup_logging() calls in Samba3 and Samba4's DEBUG() subsystems. The revert of 49a6d757b4d944cd22c91b2838beb83f04fbe1e9 works with this to fix bug 6211. Andrew Bartlett
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-1/+1
This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
2008-12-19Move some bytes from data to text, make use of the ARRAY_SIZE macroVolker Lendecke1-2/+2
Probably pointless, but it doesn't add complexity and it is fun to see bss and data shrink :-)
2008-12-05Fix logging to syslogDan Sledz1-1/+1
2008-11-06Add wrapper str_list_make_v3() to replace the old S3 behavior ofJeremy Allison1-1/+1
str_list_make(). From Dan Sledz <dan.sledz@isilon.com>: In samba 3.2 passing NULL or an empty string returned NULL. In master, it now returns a list of length 1 with the first string set to NULL (an empty list). Jeremy.
2008-11-01Use dup2() replacement from libreplace.Jelmer Vernooij1-2/+2
2008-10-11Provide the same set of helper functions for DEBUG in Samba 3 and SambaJelmer Vernooij1-3/+9
4, even though the macros are still different. This makes it possible to use object code compiled with one DEBUG() macro from the other sourceX directory.
2008-10-02Fix bug 5805: don't close stdoutDerrell Lipman1-1/+3
- When calling setup_logging multiple times, the code was closing the debug file descriptor before opening or assigning the new one. We don't, however, want to close the debug file descriptor if it is stdout. Derrell
2008-08-12Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.Jeremy Allison1-6/+17
Here is a patch to allow many subsystems to be re-initialized. The only functional change I made was to remove the null context tracking, as the memory allocated here is designed to be left for the complete lifetime of the program. Freeing this early (when all smb contexts are destroyed) could crash other users of talloc. Jeremy. (This used to be commit 8c630efd25cf17aff59448ca05c1b44a41964b16)
2008-07-01MSG_DEBUG now forwarded to all the winbindd children by parent.Darshan Purandare1-1/+1
smbcontrol winbindd debug level would only set the debug level of the parent winbindd process and not the child processes. This patch adds the functionality of broadcasting the debug message to all winbindd children. Now the debug level message is propagated to all the winbindd processes that includes parent and children. (This used to be commit cfbcfc3ffe74f28ec874a6bf1ab93f55f405b6e6)
2008-03-28Add a talloc context parameter to current_timestring() to fix memleaks.Michael Adam1-4/+6
current_timestring used to return a string talloced to talloc_tos(). When called by DEBUG from a TALLOC_FREE, this produced messages "no talloc stackframe around, leaking memory". For example when used from net conf. This also adds a temporary talloc context to alloc_sub_basic(). For this purpose, the exit strategy is slightly altered: a common exit point is used for success and failure. Michael (This used to be commit 16b5800d4e3a8b88bac67b2550d14e0aaaa302a9)
2008-02-25Fix some warningsVolker Lendecke1-4/+6
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result (This used to be commit ad37b7b0aee265a3e4d8b7552610f4b9a105434d)
2008-02-04Always pass a TALLOC_CTX to str_list_make and str_list_copyVolker Lendecke1-3/+3
(This used to be commit e2c9fc4cf5f0ff725330fa44f53782db65fca37e)
2008-01-23strtok -> strtok_rVolker Lendecke1-2/+3
(This used to be commit fd34ce437057bb34cdc37f4b066e424000d36789)
2008-01-07In gfree_debugsyms() free the format_bufr as well.Günther Deschner1-0/+2
Guenther (This used to be commit 48f09ca376f9fc7923309f3466e5d72f7c21a56f)
2007-12-26Fix some memleaksVolker Lendecke1-5/+6
(This used to be commit 78b0b66cbac349625257260d2e45d918e0c93617)
2007-12-15Add debug_ctx according to an idea by TridgeVolker Lendecke1-0/+14
Sorry, Jeremy, I think for debug messages this is just the right way to do it. (This used to be commit 6312016e2727c2b5b1a4964a98cfb9585d77cc8c)
2007-12-14debug: fix crash bug when DEBUG() is used before setup_logging()Stefan Metzmacher1-0/+4
this was introduced by the pstring removal (1ea3ac80146b83c2522b69e7747c823366a2b47d) metze (This used to be commit a412e6c7c676a054acd9db371221a50078cfe1d9)
2007-11-26Fix a C++ warningVolker Lendecke1-1/+1
(This used to be commit 9bf5ead4b2be57fa84e5b3137bfa0305a916f10f)
2007-11-15More pstring removal. This one was tricky. I had to addJeremy Allison1-36/+69
one horror (pstring_clean_name()) which will have to remain until I've removed all pstrings from the client code. Jeremy. (This used to be commit 1ea3ac80146b83c2522b69e7747c823366a2b47d)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-21/+21
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r25434: Add the option to print the debug class (DBGC_CLASS) in the debug ↵Michael Adam1-1/+10
header. Control this by a new boolean smb.conf option "debug class" which is by default set to "no" to keep the default debug header unchanged. Michael Note: You need to make clean for this patch. (This used to be commit 066a46ba91ca734d9e20cb9d6db36fec209a27d7)
2007-10-10r25424: Align log level (by two) in debugging output.Michael Adam1-1/+1
Michael (This used to be commit 9265b3cde25208884a8d3a9c42461d1c6e6fc353)
2007-10-10r25416: Add registry debug class.Günther Deschner1-0/+1
Guenther (This used to be commit b28dd747cb5a3d0eee865076eb4733dc123a6968)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23226: Make the "debug prefix timestamp" output a bit more readable by makingVolker Lendecke1-1/+1
the debug level alway at least 2 digits (This used to be commit 94d2fd919c268efa3df2661d2ccb32e492c52f53)
2007-10-10r22910: Make message_send_pid static to messages.cVolker Lendecke1-12/+20
(This used to be commit 27224922cf964cc70aad7cf529ab6c03fb277a89)
2007-10-10r22908: All callers of message_init now also call messaging_init. Unify those.Volker Lendecke1-16/+6
(This used to be commit 330946ad2307ca34f0a8d068a0193fcb8a0d6036)
2007-10-10r22736: Start to merge the low-hanging fruit from the now 7000-line cluster ↵Volker Lendecke1-2/+2
patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8)
2007-10-10r22213: We can't use become_root() here, as it does DEBUG()Volker Lendecke1-5/+8
itself. become_root_uid_only did not :-) Revert 21868, we need to find a better way. Volker (This used to be commit 629f966714c7a8d96b06027d514b86cde81b69b9)
2007-10-10r22096: become_root_uid_only() is unneeded - it's only used inJeremy Allison1-2/+2
messages.c. Refactor to use become_root() instead and make it local to messages.c Jeremy. (This used to be commit f3ffb3f98472b69b476b702dfe5c0575b32da018)
2007-10-10r21868: Remove check_log_size from the central smbd processing loop. This ↵Volker Lendecke1-8/+5
can be done with a become_root/unbecome_root in debug.c. (This used to be commit 4632a0caaf251d9cc7b9d84cbd20362d37f0e4e0)
2007-10-10r21825: add debug prefix timestamp to allow "short timestamps" to beHerb Lewis1-2/+8
added to debug messages (This used to be commit 4af2795e65f6bab156b300d720c7ea75c944bb87)
2007-10-10r21064: The core of this patch isVolker Lendecke1-4/+4
void message_register(int msg_type, void (*fn)(int msg_type, struct process_id pid, - void *buf, size_t len)) + void *buf, size_t len, + void *private_data), + void *private_data) { struct dispatch_fns *dfn; So this adds a (so far unused) private pointer that is passed from message_register to the message handler. A prerequisite to implement a tiny samba4-API compatible wrapper around our messaging system. That itself is necessary for the Samba4 notify system. Yes, I know, I could import the whole Samba4 messaging system, but I want to do it step by step and I think getting notify in is more important in this step. Volker (This used to be commit c8ae60ed65dcce9660ee39c75488f2838cf9a28b)
2007-10-10r17334: Some C++ warningsVolker Lendecke1-5/+5
(This used to be commit 8ae7ed1f3cecbb5285313d17b5f9511e2e622f0b)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-1/+1
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16388: Klocwork #320. Null deref.Jeremy Allison1-0/+5
Jeremy. (This used to be commit ceea8e21006bd6bae9e203a672f82e4d066bba28)