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

6822 Commits

Author SHA1 Message Date
Volker Lendecke
6fc65aaf95 lib: Fix rundown of open_socket_out()
Under valgrind I've seen the abort in async_connect_cleanup kick in. Yes, it's
good that we check these return codes!

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11316
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jun 30 20:24:37 CEST 2015 on sn-devel-104
2015-06-30 20:24:37 +02:00
Michael Adam
5c1ed7f18f ctdbd_conn: use the right error code from ctdbd_connect for debug and return
ctdbd_connect() explicitly returns the errno.
Using errno instead of ret misses some important
manually set return values and might use the
errno that is changed by close(fd).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jun 26 17:21:26 CEST 2015 on sn-devel-104
2015-06-26 17:21:26 +02:00
Michael Adam
3320a565fb ctdbd_conn: lower the debug level 0 for failing connection to ctdbd.
If e.g. samba fails to start because it can not open the
connection to ctdbd, we want to see some indication in the
logs about this.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-06-26 14:18:15 +02:00
Volker Lendecke
e6564bf663 lib: Fix CID 1128556 Dereference after null check
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-23 22:12:09 +02:00
Volker Lendecke
252f8137d3 lib: Fix CID 1272858 Copy-paste error
Coverity is wrong here, but it's a good idea to consolidate the close-loop

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-23 22:12:09 +02:00
Ralph Boehme
edf3b61465 s3:util: use pread/pwrite in transfer_file
read/write aren't overloaded in the streams VFS modules, using
pread/pwrite instead this makes it possible to use transfer_file() with
named streams.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11317

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-06-23 11:45:23 +02:00
Anoop C S
f3798a2b0d lib/sysquota_linux: Handle the quota flags properly
sys_set_vfs_quota() expects the quota flags i.e, qflags
to be updated in the dp structure for which the routines
sys_get_linux_gen_quota(), sys_get_linux_v2_quota() and
sys_get_linux_v1_quota() failed to do so in their
respective definitions. Th error was uncovered by
compiler warnings [-Wunused-but-set-variable] displayed
for qflags variables in the above mentioned functions
and this patch fixes the same.

Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Jun 20 03:11:19 CEST 2015 on sn-devel-104
2015-06-20 03:11:19 +02:00
Volker Lendecke
04c6879b9b ctdbd_conn: Fix a leak on talloc_tos()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-15 19:56:45 +02:00
Stefan Metzmacher
0d161e42d9 s3:lib/addrchange: make use of tdgram_* in addrchange_*()
This makes the cleanup handling easier to get right,
as we need to make sure any tevent_fd is removed before
closing a socket fd.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-06-12 17:08:17 +02:00
Stefan Metzmacher
257bc586c2 s3:lib/addrchange: look at the correct nl_pid in addrchange_done()
state->fromaddr is the address we got from recvfrom_send/recv.

state->addr is completely untouched after tevent_req_create().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-06-12 17:08:17 +02:00
Stefan Metzmacher
9d3444ad88 s3:lib/background: make sure we destroy a pending read_packet_send() before closing the pipe fd
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-06-12 17:08:17 +02:00
Volker Lendecke
6e473c526a messaging: Init server_id_db after clustering
server_id_db_init references our pid, which got changed by the clustering
initialization just a line above. So far names.tdb is just local, but
we should register our clustered id with vnn.pid instead of just the
pid nevertheless.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>

Autobuild-User(master): José A. Rivera <jarrpa@samba.org>
Autobuild-Date(master): Fri Jun 12 02:27:41 CEST 2015 on sn-devel-104
2015-06-12 02:27:40 +02:00
Volker Lendecke
a4db3b30c5 messaging: Move parsing of ctdb_req_message to ctdbd_conn.c
This way we can remove the ctdb-specific includes from messages_ctdbd.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-05 17:51:13 +02:00
Volker Lendecke
3073a2ee7e ctdbd_conn: Fix CID 1301580 Explicit null dereferenced
Coverity does not really tell me which code path it sees where we could leave
hdr==NULL, but this check does not hurt.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri May 29 19:49:30 CEST 2015 on sn-devel-104
2015-05-29 19:49:29 +02:00
Volker Lendecke
a4cc7d4746 messages_ctdb: Use message_hdr_[get/put]
This also avoids the message copy when sending to ctdb by
using ctdbd_messaging_send_iov

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu May 28 14:00:29 CEST 2015 on sn-devel-104
2015-05-28 14:00:28 +02:00
Volker Lendecke
abc7b2f179 messaging: Remove an unused variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
32d4419105 ctdbd_conn: Introduce ctdbd_messaging_send_iov()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
2416984b40 messaging: Make messaging_dispatch_rec static
It's not needed in ctdbd_conn.c anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
25fab3ebe9 messaging: With dgm_ref, don't destroy the dgm ctx
Since we use messaging_dgm_ref, we must rely on that to destroy the dgm
context when the last reference goes.

This is a real bugfix in case we have multiple messaging contexts.

I'm not sure if we should move towards just one single messaging context
per process, just like we have it for the dgm context.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
9406d09fec ctdbd_conn: ctdb_handle_message does not need msg_ctx
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
1052d3164c ctdbd_conn: Move ndr marshalling to messages_ctdb.c
The inter-node message format belongs into messages_ctdb, not into the
generic ctdb connection layer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
7ce9f3f3f5 ctdbd_conn: simplify ctdbd_register_ips
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
d669bd8243 ctdbd_conn: Move ctdbd_register_reconfigure to a callback
Move functionality out of ctdbd_conn to its right place into smbd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
a37398b9de ctdbd_conn: Move message handling out of ctdbd_conn.c
This also removes the deferred message handling. It's no longer required,
because the messaging_send_iov_from always goes through the kernel which
takes at least one round through tevent.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
24eb3659e3 ctdbd_conn: Call back when we get a msg
This activates the callbacks just added

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
467fee4d5a ctdbd_conn: Add callback args to register_with_ctdbd
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
4d0572a2a4 ctdbd_conn: Add callback fields for registered serverids
The idea is to move message handling out of ctdbd_conn

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
cc51e85f0a messaging: Register a tevent context for secondary dgm refs
When a secondary messaging context is initialized, we need to register
its tevent context with the lower level dgm context. Seen when using
smbstatus with clustering.

The TALLOC_FREE(r->tevent_handle) in the destructor might not be
necessary, but I want to free the tevent reference before
the context goes away.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
586a959480 ctdbd_conn: Use read_data()
This is a much smaller dependency than read_data_ntstatus

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
062bc17393 smbd: Fix a typo
Change-Id: Ifb947ab7b5af473d5f03c0ccd352735bb8c4ded9
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>

Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Tue May 26 17:40:54 CEST 2015 on sn-devel-104
2015-05-26 17:40:54 +02:00
Jeremy Allison
e9f08528af s3: lib: util: Ensure we read a hex number as %x, not %u.
Based on a patch from Zoe O'Connell <zoe@metail.com>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11068

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 21 15:34:59 CEST 2015 on sn-devel-104
2015-05-21 15:34:59 +02:00
Stefan Metzmacher
4e1cc54c22 s3:tevent_wait: simplify the code by using tevent_req_defer_callback()
This way a user of this could also use tevent_req_error() or wrappers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue May 19 16:37:52 CEST 2015 on sn-devel-104
2015-05-19 16:37:52 +02:00
Richard Sharpe
12df833563 Convert the few instances of int32 there were to int32_t.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat May 16 03:09:12 CEST 2015 on sn-devel-104
2015-05-16 03:09:12 +02:00
Richard Sharpe
57568f1900 Convert all uint32/16/8 to _t in a grab-bag of remaining files.
I still need to fix the rpc stuff, but we are almost there.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 14 22:16:56 CEST 2015 on sn-devel-104
2015-05-14 22:16:56 +02:00
Richard Sharpe
dffe228283 Convert all uint32/16/8 to _t in source3/lib.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-13 19:11:23 +02:00
Volker Lendecke
7ceded5ed7 lib: Make sid_binstring_hex use TALLOC
talloc_tos() is better than plain malloc...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-13 01:44:20 +02:00
Volker Lendecke
b7c53a7de1 lib: Simplify sid_binstring_hex()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-13 01:44:20 +02:00
David Holder
6e08bfb444 Add IPv6 support for determining FQDN during ADS join.
Signed-off-by: David Holder <david.holder@erion.co.uk>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 12 23:35:32 CEST 2015 on sn-devel-104
2015-05-12 23:35:32 +02:00
Amitay Isaacs
4f4e6ebace ctdb-daemon: Remove older data structure that supports only IPv4 addresses
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-12 01:32:11 +02:00
Volker Lendecke
a590ac60ef libsmbconf:registry: Ignore keyless smb.conf regvalues
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-07 07:58:15 +02:00
Volker Lendecke
607301a843 lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-05-06 15:37:14 +02:00
Volker Lendecke
f9056de9bf lib: Fix indentation
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 04:14:14 +02:00
Volker Lendecke
729475425b lib: Fix whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 04:14:14 +02:00
Richard Sharpe
2224796fc3 Change all uses of uint32/16/8 in proto.h to uint32_t/16_t/8_t.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-29 23:42:20 +02:00
Volker Lendecke
78f43ed5a7 lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-28 18:11:13 +02:00
Volker Lendecke
db5b766903 lib: Remove procid_str_static
Replace all callers with direct calls to server_id_str_buf without
talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-28 18:11:13 +02:00
Christof Schmitt
9e10ddd00e util_sd: Make server conncection optional
If cli is not set, only attempt numeric conversions.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25 00:04:24 +02:00
Christof Schmitt
42c46ab642 smbcacls: Move sec_desc_print to common file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25 00:04:24 +02:00
Christof Schmitt
541ddde872 smbcacls: Move print_ace and parse_ace to common file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25 00:04:24 +02:00
Christof Schmitt
a519b3e6c6 smbcacls: Move StringToSid to common file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25 00:04:24 +02:00
Christof Schmitt
7eeca44f03 smbcacls: Move SidToString to common file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25 00:04:23 +02:00
Youzhong Yang
74e684db80 s3-unix_msg: remove socket file after closing socket fd
This is needed on Solaris.

It fixes https://bugzilla.samba.org/show_bug.cgi?id=11217

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr 22 03:43:30 CEST 2015 on sn-devel-104
2015-04-22 03:43:30 +02:00
Ralph Boehme
6b1f757f83 s3:lib: use talloc_get_type_abort
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Apr 21 22:14:07 CEST 2015 on sn-devel-104
2015-04-21 22:14:07 +02:00
Volker Lendecke
86f04bfc24 lib: Fix CID 1107218 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-04-21 19:37:16 +02:00
Anoop C S
b0a9a69bcc libnetapi: Fix 241166 Fixing logically dead code
Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 26 17:30:27 CET 2015 on sn-devel-104
2015-03-26 17:30:27 +01:00
Volker Lendecke
c7cc3adca2 lib: Fix CID 1273009 Dereference after null check
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-26 14:54:20 +01:00
Volker Lendecke
c51300ad89 lib: load_case_tables() -> smb_init_locale()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-24 00:00:20 +01:00
Volker Lendecke
06a727e8f8 lib: Remove load_case_tables_library()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-24 00:00:20 +01:00
Anoop C S
73f951e98f libnetapi: Fix CID 1272947 Fix logically dead code
Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-23 16:04:19 +01:00
Noel Power
57e3ebaf80 fix failing fd passing message by passing needed buffer size
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-03-19 18:02:13 +01:00
Volker Lendecke
f686db87a4 source3: Replace ccan hash calls with tdb_jenkins_hash
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
Volker Lendecke
de811f14af lib: Remove tdb_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
Volker Lendecke
cf368cbdc5 lib: Remove tdb_fetch_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
Volker Lendecke
f199e0ebfc lib: Remove tdb_errorstr_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
Volker Lendecke
47795aef9d lib: Remove tdb_open_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:51 +01:00
Michael Adam
bd4b22effe s3:util_sid: donate an empty line.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-16 20:26:50 +01:00
Volker Lendecke
2b3a2b0674 lib: Avoid a malloc/realloc in getgroups_unix_user
This avoids a malloc/free in the most common case of a user with just a few
group memberships

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-11 16:11:08 +01:00
Volker Lendecke
4cbc9369fb lib: Fix whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-11 16:11:07 +01:00
David Disseldorp
47f15b14ae system: add hole punch support to sys_fallocate()
If Samba is configured with FALLOC_FL_PUNCH_HOLE support, then allow
sys_fallocate() to propogate the flag to syscall invocation.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-09 21:27:07 +01:00
David Disseldorp
12c0b6bf40 s3/vfs: change fallocate mode flags from enum->uint32_t
The Linux fallocate syscall offers a mode parameter which can take the
following flags:
FALLOC_FL_KEEP_SIZE
FALLOC_FL_PUNCH_HOLE (since 2.6.38)
FALLOC_FL_COLLAPSE_RANGE (since 3.15)
FALLOC_FL_ZERO_RANGE (since 3.14)

The flags are not exclusive, e.g. FALLOC_FL_PUNCH_HOLE must be specified
alongside FALLOC_FL_KEEP_SIZE.

Samba currently takes a vfs_fallocate_mode enum parameter for the VFS
fallocate hook, taking either an EXTEND_SIZE or KEEP_SIZE value. This
commit changes the fallocate hook such that it accepts a uint32_t flags
parameter, in preparation for PUNCH_HOLE and ZERO_RANGE support.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-09 21:27:07 +01:00
David Disseldorp
3787119eb8 lib/system: remove useless HAVE_LINUX_FALLOCATE64 logic
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-09 21:27:07 +01:00
Volker Lendecke
11a71d5621 lib: Fix CID 1273292 Uninitialized pointer read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-04 14:46:07 +01:00
Volker Lendecke
f5c8e489ad lib: Fix CID 1273056 Negative array index read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-04 14:46:07 +01:00
Volker Lendecke
6fdbf8de87 lib: Fix CID 1128561 Pointer to local outside scope
This is not strictly a bug, but it is confusing enough to justify a small patch
I guess.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-04 14:46:07 +01:00
Volker Lendecke
569c8700d6 Fix whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-04 14:46:07 +01:00
Volker Lendecke
4dd7c84167 lib: Fix CID 1128552 Buffer not null terminated
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-04 14:46:07 +01:00
Volker Lendecke
38628b1e32 Fix the O3 developer build
Different gcc versions complain at different places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar  3 13:14:53 CET 2015 on sn-devel-104
2015-03-03 13:14:53 +01:00
Volker Lendecke
c6577f3043 lib: Fix talloc hierarchy in init_lsa_ref_domain_list
The sid is copied, so the name should also be copied.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-02-27 22:53:06 +01:00
Volker Lendecke
a610336886 lib: Move "iov_buf.[ch]" to lib/util
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-02-24 17:52:08 +01:00
Volker Lendecke
8bc5b7369d lib: Use talloc_report_str
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:07 +01:00
Volker Lendecke
08ff9e80de messaging4: Use messages_dgm
This replaces the transport mechanism in source4 with calls to the
messages_dgm code. It is supposed to enable "smbcontrol samba pool-usage"
as an example without having to rewrite smbcontrol using the source4
based messaging subsystem.

This moves the source3 based names.tdb (which is unused so far) to the
lock directory, source4 does not have a cache directory.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:07 +01:00
Volker Lendecke
5681cca42c messaging3: Use message_hdr_[put|get]
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:07 +01:00
Volker Lendecke
d80193ca36 messaging: Define a binary format for message headers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:07 +01:00
Volker Lendecke
f4cd1eb424 messaging3: Use messaging_dgm_ref
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:07 +01:00
Volker Lendecke
0108c2921d lib: Add messages_dgm_ref.[ch]
We only have one messaging_dgm context per process. But we will use this from
two completely independent messaging subsystems which are independently
initialized. We need to coordinate creation and destruction, do this via
talloc.

I know this looks like a step back, but when in the future we have really just
one messaging subsystem, this can go again. My immediate goal is to make
source3 and source4 transport-compatible, and this looks like a quick way
towards that goal.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:07 +01:00
Volker Lendecke
bc986ffed2 messages_dgm: Add a few #includes
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:06 +01:00
Volker Lendecke
69f9ff7d82 unix_msg: remove cookie from unix_msg_init
"pid" and "sock" are sufficient I guess as randomizers to distinguish messages.
In theory, a pid could be recycled very quickly, which might mix up in-flight
messages. But once a few messages have passed, "cookie" would be incremented as
another indicator of a fresh message.

Why? Remove messages_dgm dependency on samba-util

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:06 +01:00
Volker Lendecke
a3efb70c87 messages_dgm: Move directory handling up
When we want to use messages_dgm in source4, we need to find better
places for the lock and socket directories. Source4 does not have the
concept of a cache directory. So I chose "private dir"/sock and "lock
dir"/msg as subdirectories.

This moves directory creation from messages_dgm.c to messages.c,
source4/lib/messaging will have its own way of doing this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:06 +01:00
Volker Lendecke
293a602b33 messages_dgm: Only pass "unique" to messaging_dgm_init
We have only one context per pid, so messaging_dgm_init can do getpid()
itself.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-02-13 23:32:06 +01:00
Volker Lendecke
627a98d095 lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-02-10 23:35:08 +01:00
Andrew Bartlett
c8c2c850d4 Update mailing list references to point at lists.samba.org
The mailing lists are on lists.samba.org, but there are many references that use the shorthand of samba.org

Some references to samba@ have been changed to samba-technical@ where this make more sense.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Feb 10 07:08:28 CET 2015 on sn-devel-104
2015-02-10 07:08:28 +01:00
Michael Adam
600b40db9d gencache: don't fail gencache_stabilize if there were records to delete.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-02-09 23:10:11 +01:00
Andreas Schneider
da2611adef s3-util: Fix authentication with long hostnames.
If the hostname is longer than MAX_NETBIOSNAME_LEN we fail to correctly
check the hostname.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11008

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jan 12 23:10:30 CET 2015 on sn-devel-104
2015-01-12 23:10:30 +01:00
Volker Lendecke
6c76c5ef93 smbd: Make talloc_report of smb_filename more readable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-11 18:12:10 +01:00
Volker Lendecke
f58545dbc2 lib: Simplify iov_buf
According to

https://www.securecoding.cert.org/confluence/display/seccode/INT30-C.+Ensure+that+unsigned+integer+operations+do+not+wrap

we only need to check against one operand.

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 Jan  9 23:42:49 CET 2015 on sn-devel-104
2015-01-09 23:42:49 +01:00
Volker Lendecke
0e26e0f6f6 unix_msg: Fix 80-line formatting
This is pretty fresh code, so hope this change does not fall under the "no
reformatting" rule yet

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-09 21:21:07 +01:00
Ralph Boehme
3b1cb9385a fixup: check for NULL pointers
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-07 01:32:07 +01:00
Volker Lendecke
8caa866b08 lib: Use msghdr_prep_recv_fds in unix_msg
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-06 00:33:10 +01:00
Volker Lendecke
37af87e75e lib: Add msghdr_prep_recv_fds
This will prepare a msghdr for receiving fd's. Same pattern as before: First
get the buffer size, then fill in msghdr.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-06 00:33:10 +01:00
Volker Lendecke
2beae2bfbc lib: Use msghdr_extract_fds in unix_msg
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-06 00:33:09 +01:00