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

58 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Stefan Metzmacher
95f3662bbd lib/util: don't SMB_ASSERT() in process_exists_by_pid()
Just return false...

metze
2012-08-24 13:43:32 +02:00
Stefan Metzmacher
3c3ed70690 lib/util: fix fd leak in anonymous_shared_allocate() if MAP_ANON is not available
metze
2012-06-29 15:21:10 +02:00
Jelmer Vernooij
55bd27935f lib/util: Allow calloc use in util.c, too.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 18:50:32 CET 2012 on sn-devel-104
2012-03-24 18:50:32 +01:00
Jelmer Vernooij
14fdc1c5cd lib/util: Move calloc_array and memalign_array to top-level libutil. 2012-03-24 15:19:09 +01:00
Stefan Metzmacher
800209aad5 lib/util: only change umask during mkdir()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
bfe990af89 lib/util: cope with races between lstat and mkdir in directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
e03059fc96 lib/util: use a helper variable in directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
f306261119 lib/util: do an early return on error directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
bd492befc0 lib/util: remove unneeded else branch in directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
687606b452 lib/util: don't start DEBUG output with 'error '
This confused the subunit code.

metze
2012-03-14 12:00:46 +01:00
Volker Lendecke
a0e44c30e2 lib/util: Add hex_encode_buf
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Feb  6 09:15:33 CET 2012 on sn-devel-104
2012-02-06 09:15:32 +01:00
Volker Lendecke
e9d66999c6 Introduce dump_data_file
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jan 25 11:57:18 CET 2012 on sn-devel-104
2012-01-25 11:57:18 +01:00
Andreas Schneider
7cb08171ce Include uid_wrapper correctly. 2011-10-27 13:32:02 +02:00
Michael Adam
47aa9ed82f lib/util: skip single hex digit at the end of the input sting - fix potential segfault
The second of two digits was read without checking for the length of the input
string. For a non-zero-terminated input string, this might have caused a
segfault.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Oct 18 22:32:59 CEST 2011 on sn-devel-104
2011-10-18 22:32:59 +02:00
Michael Adam
cb47890cf2 lib/util: fix function header comment to strhex_to_str()
The description did not match the function's behaviour.
2011-10-18 20:58:26 +02:00
Michael Adam
5d91a2680e lib/util: untangle assignent from check in strhex_to_str() 2011-10-18 20:58:26 +02:00
Simo Sorce
039ddef209 util: add function to extend anonymous shared memory 2011-08-14 20:19:02 -04:00
Simo Sorce
09ad4d47f8 lib-util: Make create_unlink_tmp argument optional
Use tmpdir() if no dir is provided.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Simo Sorce
05455b459a lib-util: Make useful function a common utility.
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Andrew Bartlett
f946668b7a Improve debug messages when creating socket directories
This makes clear what the permissions error and directory name actually is

Andrew Bartlett
2011-05-08 10:56:28 +02:00
Volker Lendecke
4be643d4ce lib: Move next_token next to next_token_talloc
Signed-off-by: Jeremy Allison <jra@samba.org>
2011-04-13 14:13:25 -07:00
Stefan Metzmacher
cc59f347ee lib/util: add anonymous_shared_free()
metze
2011-01-20 05:31:45 +01:00
Stefan Metzmacher
34ea909636 lib/util: s/allocate_anonymous_shared/anonymous_shared_allocate/
metze
2011-01-20 05:31:45 +01:00
Stefan Metzmacher
9e00d2a9a4 lib/util: fix rounding to page size in allocate_anonymous_shared()
metze
2011-01-20 05:31:43 +01:00
Volker Lendecke
0831807782 Add dump_data_cb() 2010-10-24 20:46:28 +00:00
Volker Lendecke
611bcfcb49 Add print_asc_cb() 2010-10-24 20:46:28 +00:00
Björn Jacke
1a22b1b44d lib/util: usec_time_diff takes arguments the other way round than TvalDiff did 2010-09-17 14:05:53 +02:00
Björn Jacke
2b254c814b s3/s4: merge msleep and smb_msleep
the merged variant is renamed to smb_msleep as some platforms already have a
msleep function.
2010-09-16 21:38:20 +02:00
Günther Deschner
a4d23ed66f lib/util: remove some unused_result warnings.
Guenther
2010-09-09 11:11:04 +02:00
Andrew Tridgell
b58bfb3510 util: added samba_start_debugger()
This developer function is useful for debugging unusual error
conditions
2010-09-04 12:29:10 +10:00
Stefan Metzmacher
01f2c023f7 lib/util: add allocate_anonymous_shared()
metze
2010-03-22 17:15:10 +01:00
Brad Hards
dd89dc2c31 Spelling fixes for libutil
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:35 +01:00
Matthias Dieter Wallnöfer
16aa0744c6 s4:UID wrapper - Fix includes
The includes of the UID wrapper headers werent't really efficient according
to metze's post on the technical mailing list (http://lists.samba.org/archive/samba-technical/2010-February/069165.html).
To achieve this move the "uid_wrapper.h" includes into "lib/util/unix_privs.c",
 "lib/util/util.c", "ntvfs/posix/pvfs_acl.c" and "ntvfs/unixuid/vfs_unixuid.c".
2010-02-05 19:47:26 +01:00
Andrew Bartlett
7a290130bd lib/util Use rfc1738.c from Squid for all our URL encode/decode needs.
Andrew Bartlett
2009-11-02 16:36:52 +11:00
Kamen Mazdrashki
8330d78b21 util: strhex_to_str() fixed to handle '0x' correctly 2009-10-01 23:12:58 +02:00
Kamen Mazdrashki
154ab0b047 util: fixed compile time "discards qualifiers" warning 2009-10-01 23:12:58 +02:00
Andrew Tridgell
58e5e1ea8d make the UID_WRAPPER skip checks at runtime
This fixes two issues pointed out by Andrew. It adds a runtime
uwrap_enabled() call that wraps the skips needed for uid emulation. It
also makes the skip in the directory_create_or_exist() function only
change the uid checking code, not the permissions code
2009-08-05 11:21:06 +10:00
Andrew Tridgell
fd43e0ee09 added a uid_wrapper library
This library intercepts seteuid and related calls, and simulates them
in a manner similar to the nss_wrapper and socket_wrapper
libraries. This allows us to enable the vfs_unixuid NTVFS module in
the build farm, which means we are more likely to catch errors in the
token manipulation.

The simulation is not complete, but it is enough for Samba4 for
now. The major areas of incompleteness are:

 - no emulation of setreuid, setresuid or saved uids. These would be
   needed for use in Samba3

 - no emulation of ruid changing. That would also be needed for Samba3

 - no attempt to emulate file ownership changing, so code that (for
   example) tests whether st.st_uid matches geteuid() needs special
   handling
2009-08-05 10:51:00 +10:00
Volker Lendecke
7c768ddab6 No explicit initialization necessary for a zero blob 2009-07-25 12:59:21 -04:00
Günther Deschner
27bb7ac5d1 lib-util: move set_blocking() call into own file.
Guenther
2009-06-10 21:25:57 +02:00
Stefan Metzmacher
b00204a461 lib/util: remove samba specific talloc_get_type_abort()
metze
2009-03-03 18:07:33 +01:00
Jelmer Vernooij
55903e6f91 Move next_token_talloc to util.c, as util_str.c is only compiled inside samba 4. 2009-03-01 16:19:38 +01:00