1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/source3/lib
Volker Lendecke e73ccc06ef Rely on /dev/urandom
This removes quite a bit of code. All reasonable systems have /dev/urandom
these days. Linux, Solaris and the BSDs do.  In case we find a system
without /dev/urandom, we will have to go hunting in other libraries.

The main reason for this is speed: On Ubuntu 14.04 doing direct reads from
/dev/urandom is 2-3 times faster than our md4 based code. On virtualized
FreeBSD 10 the difference is even larger.

My first approach was to use fopen/fread. It was even faster, but less
than twice as fast. So I thought we could save the additional complexity
when having to deal with throwing away buffers when forking and the
additional memory footprint per process.

With this simple generate_random_buffer it will be easier to adapt new
syscalls to get randomness.

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): Tue Oct 13 04:25:39 CEST 2015 on sn-devel-104
2015-10-13 04:25:38 +02:00
..
ABI
asys asys: Allow multiple results to be received 2014-03-27 06:06:12 +01:00
dbwrap lib: Make ctdbd_control_local return 0/errno 2015-10-07 23:54:06 +02:00
eventlog lib: Remove tdb_compat 2015-03-17 11:30:52 +01:00
netapi libnetapi: Fix 241166 Fixing logically dead code 2015-03-26 17:30:27 +01:00
poll_funcs poll_funcs_tevent: Fix a valgrind error 2014-10-24 01:40:16 +02:00
pthreadpool pthreadpool: Slightly serialize jobs 2014-08-23 00:24:18 +02:00
smbconf Convert all uint32/16/8 to _t in a grab-bag of remaining files. 2015-05-14 22:16:56 +02:00
unix_msg lib: We can do ACCRIGHTS style fdpassing 2015-10-01 05:55:42 +02:00
access.c Update mailing list references to point at lists.samba.org 2015-02-10 07:08:28 +01:00
addrchange.c s3:lib/addrchange: make use of tdgram_* in addrchange_*() 2015-06-12 17:08:17 +02:00
addrchange.h
adt_tree.c
audit.c Change all uses of uint32/16/8 in proto.h to uint32_t/16_t/8_t. 2015-04-29 23:42:20 +02:00
avahi.c
background.c s3: Move call to prctl_set_comment to reinit_after_fork 2015-09-24 08:00:16 +02:00
background.h
cbuf.c
cbuf.h lib: Fix a typo 2014-02-20 22:58:58 +01:00
charcnv.c Change all uses of uint32/16/8 in proto.h to uint32_t/16_t/8_t. 2015-04-29 23:42:20 +02:00
cluster_support.c lib: Move lp_ctdbd_socket() to cluster_support.c 2015-10-03 00:01:11 +02:00
cluster_support.h lib: Move lp_ctdbd_socket() to cluster_support.c 2015-10-03 00:01:11 +02:00
conn_tdb.c smbd: Fix CID 1035365 Buffer not null terminated 2013-11-11 21:04:09 +01:00
conn_tdb.h smbd: Use fstring in conn_tdb.h 2013-11-11 21:04:09 +01:00
ctdb_dummy.c lib: Make messaging_ctdbd_init return 0/errno 2015-10-07 23:54:06 +02:00
ctdbd_conn.c lib: Move sys_rw* to lib/util 2015-10-13 01:23:07 +02:00
dmallocmsg.c
dumpcore.c lib: directory_create_or_exist() does not use "uid" parameter 2014-07-28 22:04:13 +02:00
errmap_unix.c lib: Add EMSGSIZE to map_nt_error_from_unix 2014-09-18 20:36:11 +02:00
events.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
file_id.c lib: Apply some const to pull_file_id_24 2013-09-06 13:40:05 +02:00
file_id.h lib: Apply some const to pull_file_id_24 2013-09-06 13:40:05 +02:00
filename_util.c smbd: Fix a typo 2015-05-26 17:40:54 +02:00
fncall.c pthreadpool: Allow multiple jobs to be received 2014-03-27 06:06:11 +01:00
fstring.c
g_lock.c g_lock: don't leak lock_path onto talloc tos 2014-11-03 23:46:05 +01:00
gencache.c lib: Fix a typo 2015-04-28 18:11:13 +02:00
id_cache.c lib/util: move memcache.[ch] to the toplevel 'samba-util' library 2014-07-18 15:43:33 +02:00
id_cache.h
idmap_cache.c s3:idmap_cache: remove unused idmap_cache_set_sid2[u|g]id() 2014-12-03 06:44:29 +01:00
idmap_cache.h s3:idmap_cache: remove unused idmap_cache_set_sid2[u|g]id() 2014-12-03 06:44:29 +01:00
interface.c s3:lib:interface: break an overly long line 2015-09-30 23:51:12 +02:00
ldap_debug_handler.c
ldap_escape.c
lsa.c lib: Fix talloc hierarchy in init_lsa_ref_domain_list 2015-02-27 22:53:06 +01:00
messages_ctdbd.c lib: Make messaging_send_iov_from return 0/errno 2015-10-07 23:54:06 +02:00
messages_dgm_ref.c source3/lib: include config.h before any glibc headers 2015-07-17 01:38:15 +02:00
messages_dgm_ref.h lib: Add messages_dgm_ref.[ch] 2015-02-13 23:32:07 +01:00
messages_dgm.c messages_dgm: Add messaging_dgm_get_unique 2015-09-30 23:51:13 +02:00
messages_dgm.h messages_dgm: Add messaging_dgm_get_unique 2015-09-30 23:51:13 +02:00
messages_util.c messaging: Define a binary format for message headers 2015-02-13 23:32:07 +01:00
messages_util.h messaging: Define a binary format for message headers 2015-02-13 23:32:07 +01:00
messages.c lib: Make messaging_send_iov_from return 0/errno 2015-10-07 23:54:06 +02:00
ms_fnmatch.c
msghdr.c lib: Support fd passing using the 4.3BSD way 2015-10-01 02:55:21 +02:00
msghdr.h lib: Add msghdr_prep_recv_fds 2015-01-06 00:33:10 +01:00
namearray.c
popt_common.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
privileges.c
privileges.h
readdir_attr.h s3:vfs: add SMB_VFS_READDIR_ATTR() 2014-12-04 22:11:07 +01:00
recvfile.c lib: Move sys_rw* to lib/util 2015-10-13 01:23:07 +02:00
sendfile.c Remove a few #ifdef EWOULDBLOCk 2014-09-18 20:36:11 +02:00
server_contexts.c
server_id_db_util.c lib: Use serverid_exists in server_id_db_check_exclusive 2015-09-30 23:51:13 +02:00
server_id_db_util.h lib: Add server_id_db_set_exclusive 2015-07-07 23:51:23 +02:00
server_mutex.c server_mutex: don't leak lock_path onto talloc tos 2014-11-03 23:46:05 +01:00
server_prefork_util.c
server_prefork_util.h
server_prefork.c
server_prefork.h
serverid.c lib: Remove ctdb_serverids_exist 2015-09-30 23:51:13 +02:00
sessionid_tdb.c s3: add suport for SMB3_10 and SMB3_11 protocols in smbstatus 2015-08-29 07:05:10 +02:00
sharesec.c sharesec: Remove error message for unmarshall_sec_desc failure 2015-07-06 20:19:12 +02:00
smbd_shim.c s3-smbd_shim: Add become_authenticated_pipe_user(). 2013-10-29 15:52:58 +01:00
smbd_shim.h s3-smbd_shim: Add become_authenticated_pipe_user(). 2013-10-29 15:52:58 +01:00
smbldap.c lib: Make sid_parse take a uint8_t 2015-08-26 21:41:12 +02:00
smbrun.c s3: lib: Signal handling - ensure smbrun and change password code save and restore existing SIGCHLD handlers. 2014-09-30 20:40:16 +02:00
sock_exec.c
srprs.c s3:lib: fix/simplify srprs_hex() 2014-11-25 07:25:44 +01:00
srprs.h
substitute_generic.c
substitute.c param: rename lp function and variable from "nis_home_map" to "nis_homedir" 2014-02-08 03:31:34 +01:00
sysacls.c lib: Fix indentation 2015-05-06 04:14:14 +02:00
sysquotas_4A.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
sysquotas_4B.c
sysquotas_linux.c lib/sysquota_linux: Handle the quota flags properly 2015-06-20 03:11:19 +02:00
sysquotas_nfs.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
sysquotas_xfs.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
sysquotas.c
system_smbd.c lib: Avoid a malloc/realloc in getgroups_unix_user 2015-03-11 16:11:08 +01:00
system.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
talloc_dict.c
tallocmsg.c lib: Use talloc_report_str 2015-02-13 23:32:07 +01:00
tdb_validate.c
tdb_validate.h lib: Remove tdb_compat 2015-03-17 11:30:52 +01:00
tevent_barrier.c Use tevent_req_simple_recv_unix in a few places 2014-11-10 06:09:04 +01:00
tevent_barrier.h
tevent_wait.c s3:tevent_wait: simplify the code by using tevent_req_defer_callback() 2015-05-19 16:37:52 +02:00
tevent_wait.h
time.c lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_time 2014-06-30 22:28:14 +02:00
tldap_util.c lib: Make sid_parse take a uint8_t 2015-08-26 21:41:12 +02:00
tldap.c s3: tldap: Ensure all asn1_XX returns are checked. 2014-09-26 00:51:16 +02:00
username.c lib/util: move memcache.[ch] to the toplevel 'samba-util' library 2014-07-18 15:43:33 +02:00
util_builtin.c Change all uses of uint32/16/8 in proto.h to uint32_t/16_t/8_t. 2015-04-29 23:42:20 +02:00
util_cluster.c lib: Make ctdbd_probe return 0/errno 2015-10-07 23:54:06 +02:00
util_cluster.h s3: add cluster_probe_ok() in a new module util_cluster. 2013-10-17 23:21:53 +02:00
util_cmdline.c s3-lib: Do not require a password with --use-ccache. 2014-12-02 19:23:05 +01:00
util_ea.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
util_ea.h s3:lib: Factor read_ea_list_entry() and read_nttrans_ea_list() out so they can be used by the SMB2 client code. 2013-08-15 09:07:06 +02:00
util_file.c lib: Move sys_rw* to lib/util 2015-10-13 01:23:07 +02:00
util_malloc.c
util_names.c s3: nmbd: Ensure NetBIOS names are only 15 characters stored. 2014-11-04 18:23:11 +01:00
util_nscd.c
util_nttoken.c
util_sd.c s3: lib: util: Ensure we read a hex number as %x, not %u. 2015-05-21 15:34:59 +02:00
util_sec.c s3-lib: Add root_mode() which can deal with uid_wrapper. 2014-04-17 14:56:06 +02:00
util_sid_passdb.c s3:util_sid: donate an empty line. 2015-03-16 20:26:50 +01:00
util_sid_passdb.h
util_sid.c lib: Make sid_linearize take a uint8_t 2015-08-27 00:40:58 +02:00
util_sock.c lib: Move sys_rw* to lib/util 2015-10-13 01:23:07 +02:00
util_str.c lib: Fix a typo 2015-05-06 15:37:14 +02:00
util_tdb.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
util_transfer_file.c lib: Move sys_rw* to lib/util 2015-10-13 01:23:07 +02:00
util_tsock.c CVE-2013-4408:s3:util_tsock: add some overflow detection to tstream_read_packet_done() 2013-12-09 07:05:45 +01:00
util_unixsids.c
util_wellknown.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
util.c Rely on /dev/urandom 2015-10-13 04:25:38 +02:00
version_test.c
version.c
winbind_util.c Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
winbind_util.h Convert all uint32/16/8 to _t in source3/lib. 2015-05-13 19:11:23 +02:00
wins_srv.c lib: Add a "mem_ctx" arg to gencache_get (unused so far) 2013-09-05 09:16:23 -07:00
xattr_tdb.c
xattr_tdb.h