summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* lib: Use close_low_fd in close_low_fdsVolker Lendecke2014-08-011-33/+19
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add close_low_fdVolker Lendecke2014-08-012-0/+48
| | | | | | | | This factors out the essential code from close_low_fds for one file descriptor: Redirect a fd to /dev/null Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* fix unstrcpyVolker Lendecke2014-08-011-1/+1
| | | | | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=10735 CVE-2014-3560: unstrcpy macro length is invalid Autobuild-User(master): Ira Cooper <ira@samba.org> Autobuild-Date(master): Fri Aug 1 22:10:23 CEST 2014 on sn-devel-104
* waf: socket_wrapper should check for HAVE_FUNCTION_ATTRIBUTE_FORMAT.Andreas Schneider2014-07-311-0/+12
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Jul 31 21:12:07 CEST 2014 on sn-devel-104
* uwrap: Support dropping all supplemetary groups with setgroups()Jakub Hrozek2014-07-311-2/+12
| | | | | | | | | | Dropping all supplementary groups is a common practice when changing UIDs. This patch adds support for dropping all supplementary groups when setgroups is called with size=0. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* uwrap: Add logging if uwrap is enabled correctly.Andreas Schneider2014-07-311-0/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* uwrap: Log error if we are out of memory.Andreas Schneider2014-07-311-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* uwrap: Add a better logging function.Andreas Schneider2014-07-311-8/+67
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* uwrap: Check for HAVE_FUNCTION_ATTRIBUTE_FORMAT.Andreas Schneider2014-07-312-0/+19
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* uwrap: Fall back to RTLD_NEXT if we can't find libc.Andreas Schneider2014-07-311-4/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* uwrap: Add mutex in uwrap_destructor().Andreas Schneider2014-07-311-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* uwrap: Fix memory leak on error.Andreas Schneider2014-07-311-0/+1
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* debug: Avoid dependency on str_list_makeVolker Lendecke2014-07-311-41/+29
| | | | | | | strtok_r just also does the job and is available in libc Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Fix blank line endingsVolker Lendecke2014-07-311-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Increase maximum header lengthVolker Lendecke2014-07-311-1/+1
| | | | | | | With function names it can become quite long Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: In dbghdrclass, don't call strlen repeatedlyVolker Lendecke2014-07-311-20/+40
| | | | | | | Also properly protect against header_str overflow Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Fix a typoVolker Lendecke2014-07-311-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Simplify debug_parse_levelsVolker Lendecke2014-07-311-6/+6
| | | | | | | Just some minimal refactoring Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Simplify Debug1() -- no va_argsVolker Lendecke2014-07-311-34/+18
| | | | | | | | | | | All callers just have "%s" as format string now, so we don't need to vasprintf anymore. This could speed up DEBUG a bit, we don't do a separate copy and the printf logic Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Remove an "else"Volker Lendecke2014-07-311-1/+3
| | | | | | | No else necessary, we just did a "goto done:" Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Remove two pointless assignmentsVolker Lendecke2014-07-311-2/+0
| | | | | | | "goto done:" jumps to that exact assignment :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Only call Debug1 once in dbghdrclassVolker Lendecke2014-07-311-6/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Move adding timeval and loglevelVolker Lendecke2014-07-311-12/+11
| | | | | | | | The whole routine incrementally creates the hdr_string, do it for the time string and the debuglevel as well Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: slprintf->snprintfVolker Lendecke2014-07-311-6/+7
| | | | | | | snprintf does not need the -1 in sizeof(buf)-1 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Use timeval_str_buf in dbghdrclassVolker Lendecke2014-07-311-12/+11
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Simplify dbghdrclass with an early returnVolker Lendecke2014-07-311-41/+43
| | | | | | | No code change, visible with "git diff -w" Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Create time_basic.[ch]Volker Lendecke2014-07-316-66/+130
| | | | | | | | | Make the two functions that debug.c needs a subsystem of their own. The goal is to put debug.c on a diet. Anybody who wants to use it should not be forced to pull in half of Samba :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Use timeval_str_buf in timeval_stringVolker Lendecke2014-07-311-38/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Add timeval_str_bufVolker Lendecke2014-07-312-0/+51
| | | | | | | Similarly to server_id_str_buf it does not do any allocation Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Statically allocate format_bufrVolker Lendecke2014-07-311-10/+2
| | | | | | | | Everybody needs this, so there's no point talloc'ing it. The side effect is that it removes a dependency on smb_panic() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Fix debug_parse_paramsVolker Lendecke2014-07-311-1/+1
| | | | | | | | | | | | | | The additional check this patch removes potentially drops some debuglevel class settings. While not documented, it is possible to add a debug class like for example "tdb:10" multiple times with multiple values. Later settings overwrite earlier ones, but only if the overall number of settings does not exceed the total number of available debug classes. This patch changes our behaviour, but I can't imagine a situation where someone relies on this check. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Make Debug1 staticVolker Lendecke2014-07-312-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Remove a dependency on charconvVolker Lendecke2014-07-311-1/+1
| | | | | | | | | | | | | | | | util_str has: /* characters below 0x3F are guaranteed to not appear in non-initial position in multi-byte charsets */ if ((c & 0xC0) == 0) { return strrchr(s, c); } '/' is 0x2f, so there's no point in calling strrchr_m and thus pulling in a whole lot of stuff Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Add some readability to debug_logtypeVolker Lendecke2014-07-311-1/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Factor out debug_parse_param()Volker Lendecke2014-07-311-8/+31
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Move variables where they are usedVolker Lendecke2014-07-311-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* debug: Fix indentation in debug_parse_paramsVolker Lendecke2014-07-311-5/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: remove a redundant (and wrong) comment frop lpcfg_service_ok()Michael Adam2014-07-311-1/+0
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:param: remove unused function lp_string_set()Michael Adam2014-07-311-1/+0
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/param: change the default for "winbind expand groups" to "0"Stefan Metzmacher2014-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Expanding groups requires the usage of SAMR, which is often not possible with the trust account credentials. This has caused a lot of trouble in the past, as this is the only operation which requires a member to contact a dc of a trusted domain directly, which is not always possible. With this changed default, it should only be required to contact a dc of our own domain. This is the correct behavior for a domain member. As expanding groups is mostly cosmetic, we should avoid it. This is similar to "winbind enum users" and "winbind enum groups", which are also off by default. Only some broken applications calculate the group memberships of users by traversing groups, such applications will require "winbind expand groups = 1". Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Björn Jacke <bj@sernet.de> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jul 31 18:48:36 CEST 2014 on sn-devel-104
* debug: Remove thread-related code from debug.cVolker Lendecke2014-07-312-88/+0
| | | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jul 31 16:20:53 CEST 2014 on sn-devel-104
* param: Add errors for when an s3 context is used incorrectlyGarming Sam2014-07-311-0/+9
| | | | | | | | | | Change-Id: I176b4413769f41739639875ab874a3e340b6a184 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Jul 31 10:41:58 CEST 2014 on sn-devel-104
* param: get rid of unnecessary get_default_loadparm_service pointerGarming Sam2014-07-312-4/+0
| | | | | | | Change-Id: I9f512be671e5cd738c43fd97c9c3e0b4ee7a2736 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: remove unused lp_do_parameter from s3 helpersGarming Sam2014-07-311-1/+0
| | | | | | | Change-Id: I0de55ee30beb6b94350700afcdb85155e913bda8 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: remove unnecessary lp_do_parameter callGarming Sam2014-07-311-8/+2
| | | | | | Change-Id: I0cd1842bac3fcb6dde7236b87d5d235f10277e60 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* param: remove lp_get_parameterGarming Sam2014-07-312-7/+4
| | | | | | | | | Ensure lpcfg_parm_struct, its counterpart is equivalent Change-Id: I127ce5d3cf7fe02ebf161aa011ec3b41bc32a656 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: remove init printer values from s3-helpersGarming Sam2014-07-313-8/+2
| | | | | | | Change-Id: I2c4a85b4f5039158924982a277be20ebc2d6302e Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: move init_printer_values to lib/paramGarming Sam2014-07-311-0/+121
| | | | | | | Change-Id: I45df7d589c742d6e5572b0950daed563533cca3c Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: change init_printer_values to take an lp ctxGarming Sam2014-07-313-4/+5
| | | | | | | Change-Id: I55cda94bbf1daf276ec0c45b056bd81645eaa25f Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: add the necessary new line for the debug message in handle_copyGarming Sam2014-07-311-1/+1
| | | | | | | Change-Id: Ia6fc12b9d85032b6f501395cd82c31bcfe229822 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>