1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

798 Commits

Author SHA1 Message Date
Andreas Schneider
751b2b2d2a Remove uid_wrapper related code.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:05 +02:00
Andreas Schneider
6d23354f72 lib: Change uid_wrapper to preloadable version.
This imports version 1.0.1 of uid_wrapper.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:05 +02:00
Björn Baumbach
fae7e5d771 lib-util: rename memdup to smb_memdup and fix all callers
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-04-16 20:39:08 +02:00
Volker Lendecke
1dba07db0d dlinklist: Fix a typo
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
2014-04-02 17:11:37 +02:00
Stefan Metzmacher
8ba775b0a3 lib/util/tests: add missing #include "torture/local/proto.h"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:44 +02:00
Stefan Metzmacher
f03653e39a lib/util: fix const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:42 +02:00
Stefan Metzmacher
cc2bc23e46 lib/util: declare smb_panic_default() as _NORETURN_
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:42 +02:00
Stefan Metzmacher
8a66947073 lib/util: let is_ipaddress_v6() cope with "fe80::1234%3"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Volker Lendecke
70dfb51430 iconv: Use a static buffer in iconf not to spoil the talloc_pool
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>
2013-12-14 10:06:28 +01:00
Volker Lendecke
b2dfd57669 lib-util: add functions to get elapsed from given timespec structs
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-12 12:50:21 -08:00
Michael Adam
5aade722cc lib:util: fix a comment typo
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-12-11 17:54:21 +01:00
Christian Ambach
4ea92841b7 lib/util: use proper include for struct stat
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
2013-11-21 22:12:45 +01:00
Andreas Schneider
af69cb2a78 util: Remove 32bit macros breaking strict aliasing.
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
2013-11-14 23:16:45 +01:00
Björn Baumbach
63d98ed904 CVE-2013-4476: lib-util: split out file_save_mode() from file_save()
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>
2013-11-11 11:14:36 +01:00
Björn Baumbach
8eae8d28bc CVE-2013-4476: lib-util: add file_check_permissions()
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>
2013-11-11 11:14:36 +01:00
Jeff Layton
fec84112f3 asn1: fix use-after-free in asn1_write
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
2013-10-14 16:54:34 +02:00
Günther Deschner
2ad37cbd0e lib/util: remove unused (and not even compiled) lib/util/capability.c.
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
2013-10-08 17:32:59 +02:00
Günther Deschner
573b455de9 pkgconfig: Do not hardcode library version numbers in pc files.
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
2013-08-22 20:48:44 +02:00
Volker Lendecke
a39c956315 tevent: Add tevent_received to tevent_req_simple_recv_ntstatus
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-12 13:59:53 -07:00
Volker Lendecke
52c51752e8 lib: Remove unused "client_name"
Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:49 +12:00
Stefan Metzmacher
baecc863de lib/util: add 'ldb' debug class
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>
2013-07-09 15:18:53 +02:00
Björn Jacke
cf87f85874 time: prefer CLOCK_BOOTTIME for clock_gettime_mono()
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
2013-07-05 16:47:34 +02:00
Björn Jacke
e3c2dd13d4 time: don't try to use the coarse clock
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>
2013-07-05 08:54:53 -04:00
Volker Lendecke
c71d6ecbcb genrand: Slightly simplify do_reseed
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
2013-06-14 20:29:56 +02:00
Kai Blin
0de1675e5d libcli: Remove uneeded debug message
Signed-off-by: Kai Blin <kai@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-06-01 18:48:11 +10:00
Andrew Bartlett
922fe921ce lib/util/modules.c: Remove #if SAMBA_BUILD_ == 3 now we only have the waf build
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-28 12:17:12 +10:00
Andrew Bartlett
2a4eaa3241 build: Rework BSD_STYLE_STATVFS check to match autoconf build
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2013-05-27 11:56:48 +10:00
Kai Blin
30cba0d201 debug: Add ability to dump_data per debug class
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-18 10:58:05 +02:00
Kai Blin
4b01099748 debug: Add debugclass for DNS server
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
2013-05-16 21:40:08 +10:00
Gregor Beck
1ed22ba4b7 s3:smbd: add a scavenger process for disconnected durable handles
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>
2013-04-18 13:15:13 +02:00
Stef Walter
ca0d38596d getpass: Don't fail if stdin is not a tty
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
2013-04-05 07:34:37 +02:00
Andrew Bartlett
7ea026e332 lib/util: Cast mode_t result to unsigned int for GNU/Solaris build
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-15 10:38:32 -07:00
Andreas Schneider
90cbfc96d1 Make sure to set umask() before calling mkstemp().
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
2013-03-06 01:16:34 +01:00
Andreas Schneider
f9fb3faaef lib: Add prctl_set_comment to utils.
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:46 +01:00
Stefan Metzmacher
6b948cf54b lib/util: add samba_tevent_set_debug()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-28 12:11:48 +01:00
Stefan Metzmacher
6205262d38 lib/util: allow samba_tevent_debug() to take a name as context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-28 12:10:05 +01:00
Andreas Schneider
3ca727b2f9 lib-util: Don't leak file descriptor on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:14 +01:00
Andrew Bartlett
f2c7f2c93d build: Remove unused includes.h reference to avoid build-time talloc dep
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>
2013-02-22 08:44:58 +01:00
Stefan Metzmacher
f7aa60175a lib/util: add samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:43 +01:00
Michael Adam
762dd3cf29 lib/util/time: strip a potential trailing newline in the asctime case.
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>
2013-02-19 13:58:08 +01:00
Gregor Beck
d8dd0ecc48 lib/util_tdb: factor out tdb_data_talloc_copy()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:24 +01:00
Karolin Seeger
2ed035b5a0 fault.c: Fix typo in comment.
redundent -> redundant

Signed-off-by: Karolin Seeger <kseeger@samba.org>
2013-02-18 22:07:39 +11:00
Stefan Metzmacher
65f2bba559 lib/util: improve check_password_quality() to handle utf8
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Andreas Schneider
6039388fc1 util: Add a strict directory_create_or_exist function.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 09:11:20 +01:00
Andreas Schneider
bdc2f4bd91 util: Remove unused fde_stdin in samba_runcmd.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 23:14:44 +01:00
Andreas Schneider
ac434c4223 util: Don't use the pid ret value uninitialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:33 +01:00
Tsukasa Hamano
16d725b4f5 Fix bug #9471 - SEGV when using second vfs module.
Don't use default_classname_table when we obviously shoud be using
classname_table.

Reviewed by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec  7 17:51:50 CET 2012 on sn-devel-104
2012-12-07 17:51:50 +01:00
Andreas Schneider
27a1327b49 util: Add a UNIX platform independent samba_getpass().
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-12-03 14:35:08 +01:00
Volker Lendecke
647a0fb098 lib/util: Simplify bitmap.c a bit
This avoids the double-talloc for bitmaps

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-07 15:32:24 +01:00
Volker Lendecke
7f4d55d1b8 lib/util: Make "struct bitmap" abstract
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-07 15:32:24 +01:00