summaryrefslogtreecommitdiffstats
path: root/lib/util
Commit message (Collapse)AuthorAgeFilesLines
* lib: Use server_id_str_buf in server_id_strVolker Lendecke2014-06-171-22/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add server_id_str_bufVolker Lendecke2014-06-172-0/+26
| | | | | | | This is usable in a DEBUG statement without talloc_tos() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: add missing newline to debug message in daemon_ready()Michael Adam2014-05-231-1/+2
| | | | | | | | | | | Wrap overly long line while touching it anyways. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri May 23 04:03:43 CEST 2014 on sn-devel-104
* lib/util: s/daemon/nameStefan Metzmacher2014-05-231-5/+5
| | | | | | | | daemon() is a public function... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* Add a comment regarding strwicmp only being an ASCII string compareGarming Sam2014-05-071-1/+7
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* move str_list_make_v3 out of s3 codeGarming Sam2014-05-072-0/+74
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* byteorder: do not assume PowerPC is big-endianDavid Disseldorp2014-05-061-4/+6
| | | | | | | | | | | byteorder.h currently uses reverse-indexing ASM instructions for little endian multi-byte storage/retrieval on PowerPC. With Power8 this is an incorrect assumption, as it can be big or little endian. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10590 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* add systemd integrationAlexander Bokovoy2014-04-233-2/+49
| | | | | | | | | | | | | | | Add --with-systemd / --without-systemd options to check whether libsystemd-daemon library is available and use it to report service startup status to systemd for smbd/winbindd/nmbd and AD DC. The problem it solves is correct reporting of the Samba services at the point when they are ready to serve clients, important for high availability software integration. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib: Add missing include for unistd.h in unix_privs.Andreas Schneider2014-04-171-0/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib: Add missing include for unistd.h in setid.Andreas Schneider2014-04-171-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Remove uid_wrapper related code.Andreas Schneider2014-04-171-44/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib: Change uid_wrapper to preloadable version.Andreas Schneider2014-04-172-3/+3
| | | | | | | This imports version 1.0.1 of uid_wrapper. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib-util: rename memdup to smb_memdup and fix all callersBjörn Baumbach2014-04-162-2/+2
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
* dlinklist: Fix a typoVolker Lendecke2014-04-021-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Apr 2 17:11:37 CEST 2014 on sn-devel-104
* lib/util/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-0211-0/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: fix const warningsStefan Metzmacher2014-04-024-6/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: declare smb_panic_default() as _NORETURN_Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: let is_ipaddress_v6() cope with "fe80::1234%3"Stefan Metzmacher2014-03-251-12/+54
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* iconv: Use a static buffer in iconf not to spoil the talloc_poolVolker Lendecke2013-12-141-15/+1
| | | | | | | | | | | This is a buffer that is strictly used like a stack variable. This patch makes it one and while there it fixes an error path memleak. In the "pull_failed" case we did not talloc_free(cvtbuf). With talloc_tos(), this does not really matter, but for code without this it does. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib-util: add functions to get elapsed from given timespec structsVolker Lendecke2013-12-122-0/+28
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib:util: fix a comment typoMichael Adam2013-12-111-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib/util: use proper include for struct statChristian Ambach2013-11-211-1/+3
| | | | | | | | | | | | | use <sys/stat.h> instead of forward declaring it This fixes the build on AIX Bug: https://bugzilla.samba.org/show_bug.cgi?id=10276 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Thu Nov 21 22:12:45 CET 2013 on sn-devel-104
* util: Remove 32bit macros breaking strict aliasing.Andreas Schneider2013-11-141-50/+2
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10269 These macros might have worked but they break strict aliasing in the meantime and so the compiler is not able to optimize the relevant code. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Nov 14 23:16:45 CET 2013 on sn-devel-104
* CVE-2013-4476: lib-util: split out file_save_mode() from file_save()Björn Baumbach2013-11-112-5/+13
| | | | | | | | | file_save_mode() writes files with specified mode. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* CVE-2013-4476: lib-util: add file_check_permissions()Björn Baumbach2013-11-112-0/+53
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* asn1: fix use-after-free in asn1_writeJeff Layton2013-10-141-1/+0
| | | | | | | | | | | | | On talloc_realloc failure, asn1_write calls talloc_free on an asn1_data pointer and then tries to immediately set the has_error flag on it. Skip the free and just set the has_error flag. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Oct 14 16:54:35 CEST 2013 on sn-devel-104
* lib/util: remove unused (and not even compiled) lib/util/capability.c.Günther Deschner2013-10-081-103/+0
| | | | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Oct 8 17:32:59 CEST 2013 on sn-devel-104
* pkgconfig: Do not hardcode library version numbers in pc files.Günther Deschner2013-08-221-1/+1
| | | | | | | | | | | | | | We control version numbers via 'vnum' from the wscript_build files for all other libraries. In case of libndr we already reported a wrong 0.0.1 version via pkgconfig while in fact the library is versioned as 0.0.2. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Kai Blin <kai@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Thu Aug 22 20:48:44 CEST 2013 on sn-devel-104
* tevent: Add tevent_received to tevent_req_simple_recv_ntstatusVolker Lendecke2013-08-121-5/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove unused "client_name"Volker Lendecke2013-08-121-1/+0
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: add 'ldb' debug classStefan Metzmacher2013-07-092-1/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bj@sernet.de>
* time: prefer CLOCK_BOOTTIME for clock_gettime_mono()Björn Jacke2013-07-051-2/+12
| | | | | | | | | | | this clock moves on while the machine was suspended. This is what we prefer actually. Signed-off-by: Björn Jacke <bj@sernet.de> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Simo Sorce <idra@samba.org> Autobuild-Date(master): Fri Jul 5 16:47:34 CEST 2013 on sn-devel-104
* time: don't try to use the coarse clockBjörn Jacke2013-07-051-9/+2
| | | | | | | | | as we prefer to use the suspend aware CLOCK_BOOTTIME as monotonic clock source we cannot deal with the mono coarse clock any more. Actually I never saw a real performance gain with it. Signed-off-by: Björn Jacke <bj@sernet.de> Reviewed-by: Simo Sorce <idra@samba.org>
* genrand: Slightly simplify do_reseedVolker Lendecke2013-06-141-13/+11
| | | | | | | | | | The only caller set "use_fd" to "true". 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): Fri Jun 14 20:29:56 CEST 2013 on sn-devel-104
* libcli: Remove uneeded debug messageKai Blin2013-06-011-1/+0
| | | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util/modules.c: Remove #if SAMBA_BUILD_ == 3 now we only have the waf buildAndrew Bartlett2013-05-281-8/+0
| | | | | | Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* build: Rework BSD_STYLE_STATVFS check to match autoconf buildAndrew Bartlett2013-05-271-12/+10
| | | | Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* debug: Add ability to dump_data per debug classKai Blin2013-05-183-0/+45
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* debug: Add debugclass for DNS serverKai Blin2013-05-162-1/+3
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com>
* s3:smbd: add a scavenger process for disconnected durable handlesGregor Beck2013-04-182-1/+3
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* getpass: Don't fail if stdin is not a ttyStef Walter2013-04-051-23/+29
| | | | | | | | | | | We don't need to manipulate the tty state (such as turning off echo) when prompting for passwords if we're not reading from a tty. Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Fri Apr 5 07:34:37 CEST 2013 on sn-devel-104
* lib/util: Cast mode_t result to unsigned int for GNU/Solaris buildAndrew Bartlett2013-03-151-1/+1
| | | | Reviewed-by: Jeremy Allison <jra@samba.org>
* Make sure to set umask() before calling mkstemp().Andreas Schneider2013-03-061-0/+3
| | | | | | | Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Wed Mar 6 01:16:34 CET 2013 on sn-devel-104
* lib: Add prctl_set_comment to utils.Andreas Schneider2013-03-053-1/+70
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* lib/util: add samba_tevent_set_debug()Stefan Metzmacher2013-02-282-1/+14
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib/util: allow samba_tevent_debug() to take a name as contextStefan Metzmacher2013-02-281-5/+16
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib-util: Don't leak file descriptor on error.Andreas Schneider2013-02-221-0/+1
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* build: Remove unused includes.h reference to avoid build-time talloc depAndrew Bartlett2013-02-221-1/+0
| | | | | | | | | | | | talloc is not a dependency of this library, but is required by includes.h. By not including includes.h, we avoid needing to add an otherwise false talloc dep. (this comes up if talloc.h is not installed as a system package). Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/util: add samba_tevent_context_init()Stefan Metzmacher2013-02-193-2/+76
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib/util/time: strip a potential trailing newline in the asctime case.Michael Adam2013-02-191-0/+9
| | | | | | | | | If strftime() is not available, asctime() is used, and this usually appends a newline character to the result. This is not desired for timestamp(). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>