summaryrefslogtreecommitdiff
path: root/lib/util
Commit message (Collapse)AuthorAgeFilesLines
* lib/util: remove unused prototypes in debug.hStefan Metzmacher2019-08-081-2/+0
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13915 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit d98a971247450d494c581c5454e6c270ad1b6880)
* lib/util: fix call to dbghdrclass() for DEBUGC()Stefan Metzmacher2019-08-081-1/+1
| | | | | | | | | | | | | | | | dbghdrclass() sets the global 'current_msg_class' and for that DEBUGC() should pass the given dbgc_class instead of the per file DBGC_CLASS. This is important with the new per class logfile with: log level = 1 dsdb_audit:10@/var/log/samba/log.dsdb_audit BUG: https://bugzilla.samba.org/show_bug.cgi?id=13915 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (similar to commit bb0ffbf38cb1955c9e400003add680eabcf706a6)
* lib: util: Finally remove possibilities of using sys_popen() unsafely.Jeremy Allison2019-06-132-96/+0
| | | | | | | | | | | | | | All code now uses sys_popenv() which is much harder to use incorrectly. Remove the extract_args() function that was the cause of possible issues. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 9fa95d5b45369acfdd38923e8618e94e5d04b07e)
* lib: util: Remove file_pload()Jeremy Allison2019-06-132-47/+0
| | | | | | | | | | No longer used. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit c5729ae44219ec81008040d4d50f0f5fdf254201)
* lib: util: Add file_ploadv().Jeremy Allison2019-06-132-0/+47
| | | | | | | | | | | | | | Not yet used. Duplicate code to file_pload() except uses vectored argument list. file_pload() will be removed once all callers are converted. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 5c34fa0b85e4d9a3c5fd4fa0b39af4772ec023db)
* lib: popen: Prepare to remove sys_popen().Jeremy Allison2019-06-132-20/+38
| | | | | | | | | | | | | | | Add sys_popenv(char * const argl[]) that uses a NULL terminated vector array of args. Change sys_popen() to split up its command string and call sys_popenv(). Once all callers are converted to sys_popenv() we can remove sys_popen(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit f20538de041eed1cadbabe2149b2b7cfcb779cb5)
* s3:util: Move static file_pload() function to lib/utilAliaksei Karaliou2019-06-132-0/+53
| | | | | | | | | | | | | | | file_pload() is static private function in Samba3 library, however it does not have any special dependencies and might be widely used as common function, so moving it into common samba-util library. Extra fix needed to enable easy back-port of code for: BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit d21fc7d8b86b0cddc619ffe528d9cd93eeedbb0b)
* s3:util: Move popen wrappers to lib/utilAliaksei Karaliou2019-06-133-2/+282
| | | | | | | | | | | | | | | | | When linked into Samba3 libraries, sys_popen()/sys_pclose() cannot be used in lower level libraries because of circular dependencies. This patch moves them into common samba-util library. Extra fix needed to enable easy back-port of code for: BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964 Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 65ea3f2a461c0eeca7d14c4258eea52e19f0ed06)
* s3:debug: enable logging for early startup failuresRalph Wuerthner2019-05-171-0/+19
| | | | | | | | | | | | | | | | | | | Commit c89a33a07a 'debug: Use backends instead of explicitly logging to syslog or file' introduced a regression where early startup failures (e.g. unable to connect to CTDB) are no longer logged because the debug subsystem is not yet fully initialized. Enable logging again with reasonable defaults when reopen_logs() is called and the parameter file is not yet parsed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13904 Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Thu Apr 18 22:21:15 UTC 2019 on sn-devel-144 (cherry picked from commit 9b30fcda64080592d20de64b384fd6d3d0775cbf)
* s3:debug: adjust indentionRalph Wuerthner2019-05-171-2/+4
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13904 Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> (cherry picked from commit a45675879ddcb43ab274d28496eedd6833466ae4)
* s3:debug: use struct initializerRalph Wuerthner2019-05-171-10/+9
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13904 Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> (cherry picked from commit b9e1b4ad0033c211710da285c30d603ccb8b8d40)
* debug: add a call to debug_parse_levels() to reopen_logs()Ralph Boehme2019-05-171-0/+1
| | | | | | | | This allows correct refresh of the "log level" setting when reloading config. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 4341f24069f991dc7119093e418aac392e0a1b50)
* debug: add an empty lineRalph Boehme2019-05-171-0/+1
| | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 2bc7e254a62cfc6a60ecff425fc71173c6d21a10)
* lib util debug: Increase format buffer to 4KiBGary Lockyer2019-05-171-1/+1
| | | | | | | | | | | | | | | | | Increase the debug line buffer to 4KiB, the existing size of 1KiB is too small for dsdbChange JSON audit messages. These messages were then split across multipe lines causing issues in log ingestion tools expecting single line messages. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13902 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Mon May 6 01:18:22 UTC 2019 on sn-devel-184 (cherry picked from commit ad3af7cdffb98b7998857db609548fc96f60c669)
* memcache: Properly track the size of talloc objectsChristof Schmitt2019-04-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | With memcache_add_talloc, the talloc object becomes part of the pool and the memcache_element stores a pointer to the talloc object. The size of the the talloc object was not used when tracking the used space, allowing the cache to grow larger than defined in the memcache_init call. Fix this by adding the size of the talloc object to the used space. Also record the initial size of the talloc object for proper adjustment of the used space in the cache later. This is in case the size of the talloc object is modified while being owned by the cache (e.g. allocating talloc child objects). This should never happen, but better be safe than ending up with a broken cache usage counter. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13865 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit a04ca6f3438595ba7e1a110877f53d1cac0f0402)
* memcache: Introduce struct for storing talloc pointerChristof Schmitt2019-04-121-15/+20
| | | | | | | | | | | This allows extending the additional data stored for talloced objects later. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13865 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 7c44f2f76eefb9156cb1d170c92b4ff07dd6a3d5)
* Send status to systemd on daemon startMarcos Mello2019-03-221-10/+8
| | | | | | | | | | | | | | | | | | | | systemd service files run in no-forking mode (--foreground) since 8b6f58194da7e849cdb9d20712dff49b17a93a77. Rearrange sd_notify() call in become_daemon() to only send status to systemd in this mode (Type=notify is not designed to monitor forking). Drop READY=0 (it does nothing) and MAINPID= (unnecessary because the process spawned by systemd is already the main PID). Also remove STATUS= prefix from debug messages. Signed-off-by: Marcos Mello <marcosfrm@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 440ddf8470b11a46066d282bf8945201d547c192) BUG: https://bugzilla.samba.org/show_bug.cgi?id=11568
* lib:util: Move debug message for mkdir failing to log level 1Andreas Schneider2019-03-121-3/+3
| | | | | | | | | | | | | | If you connnect to a host with smbclient this gets always printed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13823 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit c71334ec0c92e791022a9b7c900aa0dd649226c2) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Tue Mar 12 16:13:29 UTC 2019 on sn-devel-144
* lib/util: Count a trailing line that doesn't end in a newlineMartin Schwenke2019-01-092-3/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the final line of a file does not contain a newline then it isn't included in the line count. Change i to point to the next slot in the array instead of the current one. This means that that the current line won't be thrown away if no newline is seen. Without changing i to unsigned int, the -O3 --picky -developer build fails with: [ 745/4136] Compiling lib/util/util_file.c ==> /builds/samba-team/devel/samba/samba-o3.stderr <== ../../lib/util/util_file.c: In function ‘file_lines_parse’: ../../lib/util/util_file.c:251:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] while (i > 0 && ret[i-1][0] == 0) { ^ cc1: all warnings being treated as errors BUG: https://bugzilla.samba.org/show_bug.cgi?id=13717 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Dec 19 08:08:28 CET 2018 on sn-devel-144 (cherry picked from commit 5118985841aa0363147d552f243ab5a7d90dbdaf)
* lib:util: Fix DEBUGCLASS pointer initializiationAndreas Schneider2018-11-121-2/+2
| | | | | | | | | | | | | | | | | This fixes a segfault in pyglue: ==10142== Process terminating with default action of signal 11 (SIGSEGV) ==10142== Bad permissions for mapped region at address 0x6F00A20 ==10142== at 0x6F1074B: py_set_debug_level (pyglue.c:165) BUG: https://bugzilla.samba.org/show_bug.cgi?id=13679 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 71ef09c1afdbf967b829cb66b33c3a5cb1c18ba0) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Mon Nov 12 16:04:51 CET 2018 on sn-devel-144
* lib: Avoid the use of open_memstream in tevent_req_profile_stringVolker Lendecke2018-10-102-55/+38
| | | | | | | | | | | | Solaris does not have it. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13629 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e7d3678ddb5916416193d553f3cc562627e7d8ab) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Wed Oct 10 18:57:59 CEST 2018 on sn-devel-144
* s3: util: Do not take over stderr when there is no log filePaulo Alcantara2018-09-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case we don't have either a /var/log/samba directory, or pass a non-existent log directory through '-l' option, all commands that are daemonized with '-D' option hang when executed within a subshell. An example on how to trigger that: # rm -r /var/log/samba # s=$(nmbd -D -s /etc/samba/smb.conf -l /foo123) (never returns) So, when the above command is executed within a subshell the following happens: (a) Parent shell creates a pipe, sets write side of it to fd 1 (stdout), call read() on read-side fd, forks off a new child process and then executes nmbd in it. (b) nmbd sets up initial logging to go through fd 1 (stdout) by calling setup_logging(..., DEBUG_DEFAULT_STDOUT). 'state.fd' is now set to 1. (c) reopen_logs() is called by the first time which then calls reopen_logs_internal() (d) in reopen_logs_internal(), it attempts to create log.nmbd file in /foo123 directory and fails because directory doesn't exist. (e) Regardless whether the log file was created or not, it calls dup2(state.fd, 2) which dups fd 1 into fd 2. (f) At some point, fd 0 and 1 are closed and set to /dev/null The problem with that is because parent shell in (a) is still blocked in read() call and the new write side of the pipe is now fd 2 -- after dup2() in (e) -- and remains unclosed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13578 Signed-off-by: Paulo Alcantara <palcantara@suse.de> Reviewed-by: Jim McDonough <jmcd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Aug 18 01:32:25 CEST 2018 on sn-devel-144 (cherry picked from commit 41aa55f49233ea7682cf14e5a7062617274434ce)
* lib: Add tevent_req_profile helpersVolker Lendecke2018-07-113-0/+570
| | | | | | | Print and marshall/unmarshall tevent_req_profile structs Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib: Multi-line a long line in wscript_buildVolker Lendecke2018-07-111-1/+5
| | | | | | | Why? I'll add another file in a later commit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib:charset: Fix error messages from charset conversionChristof Schmitt via samba-technical2018-07-072-3/+1
| | | | | | | | | | | | | | When e.g. trying to access a filename through Samba that does not adhere to the encoding configured in 'unix charset', the log will show the encoding problem, followed by "strstr_m: src malloc fail". The problem is that strstr_m assumes that any failure from push/pull_ucs2_talloc is a memory allocation problem, which is not correct. Address this by removing the misleading messages and add a missing message in convert_string_talloc_handle. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: smb_threads: fix access before init bugRalph Boehme2018-07-041-0/+3
| | | | | | | | | | | | | talloc_stackframe_internal() calls SMB_THREAD_GET_TLS(global_ts) which calls smb_get_tls_pthread() in the POSIX pthread wrapper implementation. If SMB_THREAD_SET_TLS() hasn't been called before, global_ts is NULL and smb_get_tls_pthread dereferences it so it crashes. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13505 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* talloc_stack: Call talloc destructors while frame is still aroundVolker Lendecke2018-06-231-0/+29
| | | | | | | | | | This fixes "samba-tool ntacl set -d10" Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jun 23 04:56:44 CEST 2018 on sn-devel-144
* util_str_hex: use array syntax in guid functions to document usageDouglas Bagnall2018-05-312-4/+4
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* util/charset/iconv: use read_hex_bytes rather than sscanfDouglas Bagnall2018-05-311-3/+6
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* memcache: Add new cache type for dfree informationChristof Schmitt2018-05-251-1/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13446 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib:util: Fix size types in debug.cAndreas Schneider2018-05-171-7/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib:util: Fix parameter aliasing in tfork testAndreas Schneider2018-05-171-5/+2
| | | | | | | | | | | | | | | ../lib/util/tests/tfork.c:483:24: error: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Werror=restrict] ret = pthread_create(&threads[i], ^~~~~~~~~~~ ../lib/util/tests/tfork.c:486:10: (void *)&threads[i]); ~~~~~~~~~~~~~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib:util: Fix string check in mkdir_p()Andreas Schneider2018-05-171-2/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* debug: Add group logging classesGary Lockyer2018-05-162-0/+4
| | | | | | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed May 16 07:02:20 CEST 2018 on sn-devel-144
* logging: add ldb audit classesGary Lockyer2018-05-162-0/+12
| | | | | Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* util: Add tini to samba-util-coreAmitay Isaacs2018-05-121-2/+2
| | | | | | | So it can be used by CTDB. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* Fix spelling s/unitialized/uninitialized/Mathieu Parent2018-05-121-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* lib/util: Call log_stack_trace() in smb_panic_default()Andrew Bartlett2018-04-111-2/+1
| | | | | | | | | | This matches the AD DC with the behaviour in smbd. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 11 04:03:07 CEST 2018 on sn-devel-144
* lib/util: Move log_stack_trace() to common codeAndrew Bartlett2018-04-113-0/+106
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: Log PANIC before calling pacic action just like s3Andrew Bartlett2018-04-111-1/+3
| | | | | | | | This is like the changes made in s3 by 4fa555980070d78b39711ef21d77628d26055bc2 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib:util: Fix size types in fgets_slash()Andreas Schneider2018-04-032-3/+3
| | | | | | | This fixes compilation with -Wstrict-overflow=2. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: remove unused '#include <sys/syscall.h>' from tests/tfork.cStefan Metzmacher2018-04-031-1/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13342 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: SMB2: Add DBGC_SMB2_CREDITS class to specifically debug credit issues.Jeremy Allison2018-03-222-0/+2
| | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* lib: debug: Add DBGC_XXX versions of the macros to allow class-specific ↵Jeremy Allison2018-03-221-0/+30
| | | | | | | | | messages. https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all ↵Jeremy Allison2018-03-222-0/+2
| | | | | | | | | | | smbd/smb2_*.c files with it. Will allow easier smb2-specific debugging. https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* build: fix standalone ctdb build --with-systemdDavid Disseldorp2018-03-051-1/+2
| | | | | | | | | | | | | | | | | | For standalone ctdb builds, a samba-util-core dependency is added, without corresponding systemd libraries, which are needed when become_daemon.c is built --with-systemd. This results in: default/lib/util/become_daemon_20.o: In function `daemon_status': become_daemon.c:(.text+0x456): undefined reference to `sd_notifyf' collect2: error: ld returned 1 exit status Fix this by moving the systemd library dependencies from samba-util to samba-util-core, the become_daemon.c base build target. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Mar 5 20:49:51 CET 2018 on sn-devel-144
* tests: Add basic ms_fnmatch unit testDavid Disseldorp2018-03-022-0/+119
| | | | | | | Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
* util: Fix the logic in ms_fnmatch_protocol()Andreas Schneider2018-03-021-2/+7
| | | | | | | Make sure we always pass a valid max_n pointer to ms_fnmatch_core(). Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* lib:util: Add FALL_THROUGH statements in util_file.cAndreas Schneider2018-03-011-1/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:util: Add FALL_THROUGH statements in charset/charset_macosxfs.cAndreas Schneider2018-03-011-6/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>