1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

6511 Commits

Author SHA1 Message Date
Volker Lendecke
04297e8914 gencache: Fix a type-punned warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Dec 16 17:11:13 CET 2013 on sn-devel-104
2013-12-16 17:11:13 +01:00
Stefan Metzmacher
fd722494e7 s3:lib: avoid talloc_zero_array() in poll_one_fd()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-12-14 16:24:48 +01:00
Gregor Beck
ae6a13eecb s3: use directory_create_or_exist_strict() to create corepath
This simplifies the code and even works in testenv where the chown call
fails.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-11 17:54:16 +01:00
Andreas Schneider
8eef4ab79e s3-lib: Fix %G substitution for domain users in smbd
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10286
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Tue Dec 10 16:39:43 CET 2013 on sn-devel-104
2013-12-10 16:39:43 +01:00
Christian Ambach
a24c25bdde s3:lib/asys modify included headers
use the headers from libreplace, not the system ones

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-12-10 14:28:32 +01:00
Jeremy Allison
f799f63e43 CVE-2013-4408:s3:Ensure LookupRids() replies arrays are range checked.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Mon Dec  9 09:00:41 CET 2013 on sn-devel-104
2013-12-09 09:00:41 +01:00
Jeremy Allison
0dc6181894 CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-12-09 07:05:46 +01:00
Stefan Metzmacher
068dafc4d8 CVE-2013-4408:s3:ctdb_conn: add some length verification to ctdb_packet_more()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-09 07:05:46 +01:00
Stefan Metzmacher
6e293891ca CVE-2013-4408:s3:util_tsock: add some overflow detection to tstream_read_packet_done()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-09 07:05:45 +01:00
Volker Lendecke
97e8b56250 idmap_cache: Use gencache_parse
This avoids a few tallocs and brings down user CPU a bit more

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): Thu Dec  5 03:06:10 CET 2013 on sn-devel-104
2013-12-05 03:06:10 +01:00
Volker Lendecke
89013af15a idmap_cache: Use an fstring instead of talloc_asprintf
In a test doing one million uid2sid calls this brings down user CPU from
1.3 seconds to 0.9 seconds. And it saves a few code lines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 01:10:25 +01:00
Volker Lendecke
051fb91556 messaging3: Do not go through messages.tdb for self-sends
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 01:09:54 +01:00
Volker Lendecke
6b6920b029 smbd: Fix bug 10284
If we msg_read_send on a nonempty channel, we create one
tevent_immediate. If we directly receive another message and from
within the msg_read_send's tevent_req callback we immediately do
another msg_read_send, we end up with two tevent_immediate events for
msg_channel_trigger with just one incoming message. Test to follow.

This patch simplifies msg_channel.c by removing the explicit immediate
events. Instead, it relies on the implicit immediate event available
via tevent_req_defer_callback. For messages received from tdb with
a msg_read_send req pending, we directly finish that request without
putting the message on the queue.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10284
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-11-26 20:57:17 +01:00
Andreas Schneider
6366ebb79b s3-lib: Add grpname to talloc_sub_specified().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=2191

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-21 15:00:44 -08:00
David Disseldorp
c7762042ba debug: remove unused sys_adminlog
printing.c was the last user of this syslog wrapper.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Nov 20 10:19:32 CET 2013 on sn-devel-104
2013-11-20 10:19:32 +01:00
David Disseldorp
de42413365 messaging: use local talloc ctx instead of talloc_tos
messaging_tdb_send() allocates a stackframe and stores it in a local
variable, subsequent allocations should use the variable instead of
calling talloc_tos().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2013-11-20 08:16:33 +01:00
Volker Lendecke
2d91577f98 smbd: Fix a talloc hierarchy problem in msg_channel
When tearing down a watch_send with an open tevent_immediate, we
talloc_free the msg_channel while the tevent_immediate still references
it. Don't make the tevent_immediate outlive the msg_channel.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10250
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): Wed Nov 20 00:13:51 CET 2013 on sn-devel-104
2013-11-20 00:13:50 +01:00
Hans Leidekker
4503bdf560 netapi: Add support for info level 502 in NetShareAdd.
Signed-off-by: Hans Leidekker <hans@meelstraat.net>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Nov 19 21:48:17 CET 2013 on sn-devel-104
2013-11-19 21:48:17 +01:00
Jeremy Allison
fc611dd6e8 s3-lib: smbclient shows no error if deleting a directory with del failed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260

Move dir_check_ftype() to util.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-11-14 19:29:00 +01:00
Volker Lendecke
0e19812782 smbd: Fix CID 1035365 Buffer not null terminated
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-11-11 21:04:09 +01:00
Volker Lendecke
2a73a4985e smbd: Fix CID 1035366 Buffer not null terminated
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-11-11 21:04:09 +01:00
Volker Lendecke
a60f513e89 smbd: Use fstring in conn_tdb.c
It might be legacy, but as long as we have it, we can make use of it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-11-11 21:04:09 +01:00
Volker Lendecke
3b8c3e5dde smbd: Use fstring in conn_tdb.h
It might be legacy, but as long as we have it, we can make use of it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-11-11 21:04:09 +01:00
Volker Lendecke
70dbb893cf netapi: Fix CID 1127344 Uninitialized scalar variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-11-11 21:04:08 +01:00
Andreas Schneider
13d840ad2f s3-smbd_shim: Add become_authenticated_pipe_user().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:52:58 +01:00
Michael Adam
972c831812 s3: add cluster_probe_ok() in a new module util_cluster.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-17 23:21:53 +02:00
Volker Lendecke
fbee5795ab smbd/winbindd: Do an early check if ctdbd is functional
This will avoid panic calls when smbd and winbind is started in cluster
mode before ctdb is functional. It still logs something sane at debug
level 0, but it does not panic and core anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 23:20:45 +02:00
Volker Lendecke
20d3f308e2 ctdbd_conn: Remove one call to cluster_fatal
This is during startup of a ctdb connection, thus it is not as important
as in other cases to immediately exit to free up resources

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 23:19:36 +02:00
Volker Lendecke
7dff7db566 ctdbd_conn: Remove one call to cluster_fatal
This is during startup of a ctdb connection, thus it is not as important
as in other cases to immediately exit to free up resources

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 23:19:36 +02:00
Volker Lendecke
d730a61c1e ctdbd_conn: Lift the cluster_fatal call in get_cluster_vnn
We have to report a proper error when ctdbd is not around

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 23:19:36 +02:00
Gregor Beck
a9331e482c s3:lib/netapi: do not use rpc_pipe_np_smb_conn()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:48 +13:00
Hans Leidekker
a4c3553b5a Add NetWkstaGetInfo.
Modified to include common.h entry for netapitest_wksta function by Kai
Blin <kai@samba.org>

Signed-off-by: Hans Leidekker <hans@meelstraat.net>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 16 07:00:45 CEST 2013 on sn-devel-104
2013-10-16 07:00:45 +02:00
Michael Adam
58cb40d50b build: get rid of vars=locals() in source3/lib/netapi/examples/wscript_build
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Sep 25 00:51:31 CEST 2013 on sn-devel-104
2013-09-25 00:51:31 +02:00
Michael Adam
658fbefef7 libsmbconf:registry: add "state directory" to the list of forbidden parameters
At the time when the registry configuration was introduced,
the registry database file was placed in the "lock directory".
So the "lock directory" was added to the list of parameters
that may not be changed in the registry configuration
(because the next config reload would then load a different
 registry and drop all the original seetings).

Later, "state directory" and "cache directory" were introduced,
both defaulting to "lock directory". And the registry's location
was changed to "state directory".

It slipped my attention that the forbidden parameters for the
should have been adapted at the time.

So this patch adds "state directory" to the list.
It keeps the lock directory, to catch the case
where the state directory is not explicitly set, hence
defaulting to the "lock directory".

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-09-24 07:44:29 +02:00
Michael Adam
429ab4ed02 libsmbconf:registry: clarify the appearance of "includes" in forbidden_names
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-09-24 07:44:28 +02:00
Michael Adam
76a008cd18 libsmbconf:registry: reorganize the validity check and canonicalization of the input in "setparm"
- first check that the name is an smbconf parameter
- then check that the parameter is allowed in the registry config
- then check that a global parameter is not to be set in a service section
- then canonicalize the parameter and value name, thereby checking that the
  value has valid format

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-09-24 07:44:28 +02:00
Michael Adam
c1be069be9 libsmbconf:registry: publish smbconf_reg_parameter_is_valid()
So that this does not need to be duplicated..

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-09-24 07:44:28 +02:00
Michael Adam
4a65969e11 libsmbconf:registry: rework smbconf_reg_parameter_forbidden(), renaming it.
The logic is inverted, the lp_parameter_is_invalid call of
smbconf_reg_valname_valid() is included, and the function
is renamed to smbconf_reg_parameter_is_valid().

Use the new function everywhere in smbconf registry backend.
And remove corresponding reverse function smbconf_reg_valname_valid().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-09-24 07:44:28 +02:00
Michael Adam
5fd4fd7c01 afs: implement afs_syscall() always, returning -1 if FAKE_KASERVER is not defined.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-09-23 20:49:02 +02:00
Michael Adam
771b7779b0 afs: format afs_syscall() properly
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-09-23 20:26:47 +02:00
Günther Deschner
a94e278883 s3-rpc: use table->name directly in DEBUG contexts.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-09-20 13:07:10 +02:00
Volker Lendecke
b8100af384 gencache: Avoid a duplicate call to string_term_tdb_data
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Sep  9 17:02:28 CEST 2013 on sn-devel-104
2013-09-09 17:02:28 +02:00
Volker Lendecke
7f9bdabda5 smbd: Use talloc_pooled_object in cp_smb_filename
Requires new talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-08 11:34:07 +02:00
Volker Lendecke
f4e40494c0 lib: Apply some const to pull_file_id_24
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06 13:40:05 +02:00
Volker Lendecke
d3c689fc5c lib: Use "mem_ctx" arg in gencache_get
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep  5 20:09:21 CEST 2013 on sn-devel-104
2013-09-05 20:09:21 +02:00
Volker Lendecke
8a7246ac2c lib: Add a "mem_ctx" arg to gencache_get (unused so far)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-05 09:16:23 -07:00
Volker Lendecke
f630360b7f gencache: Fix SAFE_FREE vs data_blob_free
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-05 09:16:22 -07:00
Volker Lendecke
1173fed916 lib: Add "mem_ctx" to gencache_get_data_blob
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-05 09:16:22 -07:00
Volker Lendecke
1cae59ce11 dbwrap_ctdb: Treat empty records as non-existing
This is a patch implementing the workaround Christian mentioned in
https://bugzilla.samba.org/show_bug.cgi?id=10008#c5

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10008
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-08-28 23:37:08 +02:00
Jeremy Allison
9423d5afb7 Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / winbind
Don't use talloc_tos() in something that can be linked to in pam_winbindd.so

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Sat Aug 24 02:28:28 CEST 2013 on sn-devel-104
2013-08-24 02:28:28 +02:00
Volker Lendecke
0a42493763 libctdb: Avoid an explicit memset
Give the compiler a chance to use better code. Saves a few bytes of text.

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 Aug 16 01:51:55 CEST 2013 on sn-devel-104
2013-08-16 01:51:55 +02:00
Jeremy Allison
c80349e0fa s3:lib: Factor read_ea_list_entry() and read_nttrans_ea_list() out so they can be used by the SMB2 client code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-08-15 09:07:06 +02:00
Stefan Metzmacher
7e455e9ed2 s3:lib/netapi: make use of lp_cli_maxprotocol()
https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:05 +02:00
Stefan Metzmacher
9188ee4ab1 s3:lib: remove unused interpret_protocol()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:05 +02:00
Volker Lendecke
68e6e7e8e8 lib: Remove unused "get_peer_name"
Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:52 +12: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
Günther Deschner
9813fe2b04 s3-rpc_cli: pass down ndr_interface_table to cli_rpc_pipe_open_noauth().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:30:00 +02:00
Günther Deschner
0ce2178f2f s3-libnetapi: pass down ndr_interface_table to pipe_cm() and friends.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:29:59 +02:00
Günther Deschner
77f7f2a976 s3-libnetapi: pass down ndr_interface_table to libnetapi_open_pipe().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:29:59 +02:00
Günther Deschner
fa37bbd9d0 s3-libnetapi: pass down ndr_interface_table to libnetapi_get_binding_handle().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:29:59 +02:00
Christian Ambach
ba40d0d9d3 s3:lib/system fix build on AIX 7
AIX uses struct stat64 with struct timespec64, so direct assignment does
not work any more.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Signed-off-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Aug  2 09:47:43 CEST 2013 on sn-devel-104
2013-08-02 09:47:43 +02:00
Jeremy Allison
1766f9e387 Add ea_list_has_invalid_name() function.
Invalid character list probed from Windows Server 2012.

Bug 9992: Windows error 0x800700FE when copying files with xattr names containing ":"

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-07-19 17:52:32 +10:00
Stefan Metzmacher
c52e61f7ba s3-lib: hide incomplete smbXsrv_tcon_global records
Part of fix for bug #10003

Pair-programmed-with: Björn Baumbach <bb@sernet.de>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-09 14:20:08 -07:00
Björn Baumbach
53aa069b97 s3-lib: fix segf while reading incomplete session info (bug #10003)
Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-09 14:19:51 -07:00
Christian Ambach
245b5ffdde s3:lib add mapping for ETXTBSY
add ETXTBSY to the errno->STATUS conversion table.
It will be mapped to STATUS_SHARING_VIOLATION

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-06-25 12:54:00 +02:00
Christian Ambach
56df37d332 s3:lib/util_sid_passdb make use of pdb_is_responsible_for_* functions
ask passdb to determine if sid/object should be handled by passdb or not

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Christian Ambach <ambi@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2013-06-21 10:44:20 +02:00
Jeremy Allison
5c4772ec1d Re-add umask(0) code removed by commit 3a7c2777ee
Without the umask code the pipe permissions are affected by the
umask of the calling process. As only smbd currently sets its
umask to zero (nmbd and winbindd should do the same) this causes
the winbindd pipe to be unavailable to the nss library code unless
winbindd is run from an init process that explicitly sets umask
to zero. When testing from the command line this can be hard to
track down :-).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 18 04:31:27 CEST 2013 on sn-devel-104
2013-06-18 04:31:27 +02:00
Jeremy Allison
fcc43cfbe3 Fix xx_path() - return check from mkdir() is incorrect.
This is very old code, but mkdir() fails with -1, not 0.
Only print the error message is mkdir failed with anything
other than EEXIST.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-06-18 02:41:10 +02:00
Volker Lendecke
cf86f3e81b gencache: Simplify gencache_init a bit
Use the implicit cleanup facility CLEAR_IF_FIRST provides

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-06-14 20:30:33 +02:00
Volker Lendecke
4cd0e38fe0 lib: Remove an unused variable
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 Jun 11 21:52:09 CEST 2013 on sn-devel-104
2013-06-11 21:52:09 +02:00
Christian Ambach
b2380081e2 s3:lib/ctdb_packet use sys_send in packet_fd_write
use the signal safe variant here to prevent spurious errors when running
with CTDB and a signal comes in

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Jun  3 20:01:22 CEST 2013 on sn-devel-104
2013-06-03 20:01:21 +02:00
Andrew Bartlett
c5bde69568 Remove lib/netapi autoconf build system, this is now build with waf
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-28 12:17:11 +10:00
Kai Blin
61a2ad3c02 swat: Remove swat.
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Sat May 18 16:32:38 CEST 2013 on sn-devel-104
2013-05-18 16:32:38 +02:00
Christian Ambach
c29447f2b8 s3:lib/ctdb_conn make sure we are root before connecting to CTDB
CTDB socket is only reachable for root, make sure we are root when trying to connect to it

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Fri May 17 13:16:37 CEST 2013 on sn-devel-104
2013-05-17 13:16:37 +02:00
Volker Lendecke
d67e614a07 lib: Add before/after hooks to async_connect
This will facilitiate [un]become_root for smbd to connect safely to ctdbd.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-17 11:22:45 +02:00
Christian Ambach
9910b8050c s3:lib/dbwrap add missing curly braces
violation of README.Coding

Signed-off-by: Christian Ambach <ambi@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-16 23:22:19 +02:00
Volker Lendecke
09d3f577c8 lib: Fix CID 241650 Sizeof not portable
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): Sun May 12 17:44:55 CEST 2013 on sn-devel-104
2013-05-12 17:44:55 +02:00
Volker Lendecke
7027c6aca9 pthreadpool: Fix CID 710828 Sizeof not portable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-05-12 15:56:32 +02:00
Christian Ambach
24ce31a33f s3:lib fix wrong usage of PRIu64 in sscanf
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-05-06 16:33:38 +02:00
Volker Lendecke
e13021e3af dbwrap: Allow dbwrap_record_watch_recv to not lock the record
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:23 -07:00
Jeremy Allison
1b46db7b24 Ensure drain_socket() operates on a blocking socket.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
2013-04-19 14:11:23 -07:00
Gregor Beck
037f57e12f util_tdb: add function tdb_data_string()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:11 +02:00
Volker Lendecke
406450d44e smbd: Remove NTSTATUS based create_synthetic_smb_fname
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): Thu Apr 18 02:52:40 CEST 2013 on sn-devel-104
2013-04-18 02:52:40 +02:00
Volker Lendecke
9b499996c4 lib: Make create_synthetic_smb_fname_split use synthetic_smb_fname_split
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
8087e701cc lib: Add synthetic_smb_fname_split
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
133cde3093 lib: Remove unused copy_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
5774989336 lib: Make create_synthetic_smb_fname use synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
766f04cebd lib: Add synthetic_smb_fname
The interface of create_synthetic_smb_fname is just silly

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:57 -07:00
Volker Lendecke
f50dedb8fb smbd: Make copy_smb_filename static
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:57 -07:00
Volker Lendecke
8de3c04de3 lib: Convert copy_smb_filename to use cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:54 -07:00
Volker Lendecke
e1f4942a07 lib: Add cp_smb_filename
The interface of copy_smb_filename is just silly ;-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:54 -07:00
Jeremy Allison
7a4dd84595 Remove dependency on detection of HAVE_DIRFD for use of fdopendir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Apr 12 16:21:10 CEST 2013 on sn-devel-104
2013-04-12 16:21:09 +02:00
Stefan Metzmacher
821171e422 s3:lib/server_mutex: open mutex.tdb with CLEAR_IF_FIRST
/var/lock/samba is typically on tpmfs.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-03 09:53:08 +02:00
Stefan Metzmacher
54529fd354 s3:lib/gencache: place gencache.tdb into /var/cache/samba
/var/lock/samba is located on tmpfs on newer systems,
but we want to keep things like the server affinity cache
across reboots.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-03 09:53:08 +02:00
Volker Lendecke
c2b26a43ff dbwrap-ctdb: Avoid a talloc_stackframe()
We have only a single allocation in this routine, so I think we can live
without a stackframe.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26 11:19:59 +01:00
Volker Lendecke
d147194466 ctdb-conn: remove ctdbd_fetch
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26 11:19:29 +01:00
Volker Lendecke
1409895d9e dbwrap-ctdb: Use ctdbd_parse in db_ctdb_parse_record
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26 11:19:19 +01:00
Volker Lendecke
abe4046643 ctdb-conn: Add ctdbd_parse
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26 11:19:02 +01:00
Volker Lendecke
bbb4068c93 dbwrap: Use tdb_null in db_ctdb_delete
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Mar 25 19:42:30 CET 2013 on sn-devel-104
2013-03-25 19:42:30 +01:00
Andrew Bartlett
bf7da085b1 s3-lib/server_prefork: Cast pid_t result to unsigned int for GNU/Solaris build
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-15 10:38:40 -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
Ralph Wuerthner
0796a17aa6 s3:lib/charcnv fix typo in pull_ascii_base_talloc()
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Tue Mar  5 15:56:56 CET 2013 on sn-devel-104
2013-03-05 15:56:56 +01:00
Stefan Metzmacher
d9a69e6dbf s3:lib/events: make use of tevent_common_loop_timer_delay()
This is critical as we also use tevent_common_add_timer().
And if the common code does internal changes, it may affects
both tevent_common_add_timer() and tevent_common_loop_timer_delay()
together!

Without this we rely on a specific behavior and version of
tevent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01 11:58:20 -08:00
Stefan Metzmacher
64d98c5323 s3:lib/events: make use of samba_tevent_set_debug()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-28 12:13:10 +01:00
Stefan Metzmacher
2fb69f51c4 s3:lib/events: add missing TEVENT_TRACE_BEFORE/AFTER_WAIT handling
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-28 12:05:36 +01:00
Andreas Schneider
f4761c90fa s3-tldap: Make sure we don't deref a null pointer.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:12 +01:00
Andreas Schneider
2b890679a6 messages: Use uint8_t type.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:12 +01:00
Stefan Metzmacher
95eeb9f08b s3:lib: s/event_add_timed/tevent_add_timer
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:48:04 +01:00
Stefan Metzmacher
cdb97fd9ec s3:lib: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:48:01 +01:00
Stefan Metzmacher
c0858030ba s3:lib: s/struct fd_event/struct tevent_fd
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:48:00 +01:00
Stefan Metzmacher
59b8f803d7 s3:lib: s/struct timed_event/struct tevent_timer
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:58 +01:00
Stefan Metzmacher
804b18f38e s3:lib/events: s/EVENT_FD/TEVENT_FD
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:55 +01:00
Stefan Metzmacher
935a40f4f2 s3:lib: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:54 +01:00
Stefan Metzmacher
f3915cf0ec s3:lib: make use of samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:47 +01:00
Christian Ambach
e7f66f37a6 s3:lib/afs fix the build
Fix Bug 9644 - Compile of source3/lib/afs.c fails

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-02-19 17:31:32 +01:00
Michael Adam
f211b57dd2 gencache: fix an extra newline in a DEBUG message in gencache_set_data_blob()
by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:11 +01:00
Michael Adam
86d78dfa83 gencache: fix an extra newline in a DEBUG message in gencache_iterate_fn()
by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:10 +01:00
Michael Adam
f7525abf3b gencache: fix an extra newline in a DEBUG message in gencache_iterate_blobs_fn()
by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:09 +01:00
Michael Adam
4d3928a8f4 gencache: unify a DEBUG message in gencache_set_data_blob()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:06 +01:00
Michael Adam
56ee82e8a0 gencache: unify a DEBUG message in gencache_iterate_fn()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:05 +01:00
Michael Adam
ddf2aa3340 gencache: unify a DEBUG message in gencache_iterate_blobs_fn()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:04 +01:00
Michael Adam
7e36b1b8cb gencache: unify a DEBUG message in gencache_del()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:03 +01:00
Michael Adam
ff65500f2b s3:dbrwap_ctdb: ZERO_STRUCT(rec) just to be sure in traverse_persistent_callback_read()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04 17:14:22 +01:00
Michael Adam
3949854549 s3:dbwrap_ctdb: ZERO_STRUCT(rec) just to be sure in traverse_read_callback()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04 17:14:22 +01:00
Stefan Metzmacher
a09f3a3551 s3:dbwrap_ctdb: add "db_context" to "db_record"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Stefan Metzmacher
25bdab9c61 s3:dbwrap_ctdb: setup result->name in db_open_ctdb()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Volker Lendecke
fa064140ed smbd: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-01-30 16:37:43 +01:00
Volker Lendecke
da35cd7bd2 Avoid a very small memleak on talloc_tos()
"fname" did leak on talloc_tos(). Not really a bad memleak, but as I
just came across it I thought I might just fix it

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 25 00:54:01 CET 2013 on sn-devel-104
2013-01-25 00:54:01 +01:00
Jeremy Allison
497febfe36 Fix bug #9586 - smbd[29175]: disk_free: sys_popen() failed" message logged in /var/log/message many times.
Ensure when reading lines from an interruptible
pipe source we ignore EINTR.

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

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan 24 10:45:48 CET 2013 on sn-devel-104
2013-01-24 10:45:48 +01:00
Volker Lendecke
aea49ed37a dbwrap: Use INCOMPATIBLE_HASH for dbwrap_watchers.tdb
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-11 17:10:48 +01:00
Andreas Schneider
3a7c2777ee s3-lib: Use new strict directory create function in create_pipe_sock().
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jan  9 10:55:23 CET 2013 on sn-devel-104
2013-01-09 10:55:23 +01:00
Andreas Schneider
b1548fd944 s3-prefork: Directly fail if tevent_req_is_unix_error() fails.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Dec 21 15:38:19 CET 2012 on sn-devel-104
2012-12-21 15:38:17 +01:00
Andreas Schneider
9c273d5ca1 s3-lib: Cleanup transfer_file_internal() a bit.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:56:01 +01:00
Andreas Schneider
3f899daa9e s3-lib: Make it clear that we want to fall trough here.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:56:01 +01:00
Andreas Schneider
96de3e7364 s3-netapi: Add missing break in NetUserSetInfo_r().
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:56:01 +01:00
Andreas Schneider
3bd8c7dec6 s3-lib: Fix push_ucs2() for-loop.
ret is a bool and size is what we are looking for here, else the
statement can never be true.

Jeremy please check!

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:56:00 +01:00
Andreas Schneider
7f8c8d80ef s3-tldap: Fix dead code in tldap_sasl_bind_send().
dn can't be NULL cause it is set to "" in that case.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:56:00 +01:00
Andreas Schneider
6fd4724fb9 s3-eventlog: Make sure the eventlog directory exists.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:55:59 +01:00
Andreas Schneider
74fb61d496 s3-lib: Don't close the listener twice if we goto failed.
Found by Coverity.

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
07385a851f s3-ctdb: Make sure addr.sun_path is null terminated.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Andreas Schneider
e5deaa2968 s3-lib: Remove unsused variable from sys_get_nfs_quota().
testpath is the same a few lines later.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Andreas Schneider
f1fe877d07 s3-netapi: Initialize group_handle of NetGroupSetUsers_r().
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:33 +01:00
Andreas Schneider
7d20934693 s4-netapi: Initialize group_handle of NetGroupGetUsers_r().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:33 +01:00
Andreas Schneider
d020c51978 s3-netapi: Initialize group_handle of NetUserSetGroups_r.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:33 +01:00
Andreas Schneider
33d1d52508 s3-netapi: Fix zeroing policy handles in NetLocalGroupAdd_r().
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:32 +01:00
Andreas Schneider
3c79f85b6e util: Use new samba_getpass() function.
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-12-03 14:35:08 +01:00
Michael Adam
671f534e5e s3:passdb: add sid_check_object_is_for_passdb()
Variant of sid_check_is_for_passdb() that only checks for objects
in the various domains, not for the domain sids themselves.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03 08:48:30 +01:00
Michael Adam
fecdf48aaf s3:lib: add utility function sid_check_is_for_passdb()
This function checks whether the given sid should be treated
by passdb (e.g. for id mapping).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03 08:48:29 +01:00
Stefan Metzmacher
234f9365b9 s3:popt_common: Fix password processing.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Nov 30 14:01:08 CET 2012 on sn-devel-104
2012-11-30 14:01:07 +01:00
Volker Lendecke
2f38a77a2d dbwrap: Do not rely on dbwrap_record_get_value to return a talloc object
db_tdb_fetch_locked returns the value as part of a larger talloc object
that also contains the key.  This means we can not realloc, but have to
freshly alloc.

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

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Nov 29 20:21:51 CET 2012 on sn-devel-104
2012-11-29 20:21:50 +01:00
Volker Lendecke
343ce16e0b s3: Remove db_ctdb_fetch
Note that this also makes the request for read only copies
much more explicity visible in the code.

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:18:49 +01:00
Volker Lendecke
6b8a37f5ca s3: Directly parse local existing records in db_ctdb_parse_record
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:10:13 +01:00
Volker Lendecke
9dd047d67e s3: Factor out db_ctdb_can_use_local_hdr from db_ctdb_can_use_local_copy
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:08:06 +01:00
Volker Lendecke
55d75a3fbe s3: Remove unused code for fetching persistent ctdb records
The only entry point here is parse_record, and this catches the persistent
case with a direct parse now

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:07:26 +01:00
Volker Lendecke
7b43362a9e s3: Avoid db_ctdb_fetch for persistent databases
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:05:25 +01:00
Volker Lendecke
93219f92bb s3: Factor out parse_newest_in_marshall_buffer from pull_newest_from_marshall_buffer
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:03:59 +01:00
Volker Lendecke
850d5de967 s3: reduce db_ctdb_marshall_loop_next to specialized db_ctdb_marshall_buf_parse
now that the db_ctdb_marshall_loop_next_key has been factored out.

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:00:02 +01:00
Volker Lendecke
a742b6edd5 s3: Factor out db_ctdb_marshall_loop_next_key from db_ctdb_marshall_loop_next
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:55:19 +01:00
Volker Lendecke
664b170b13 s3: Slightly simplify db_ctdb_marshall_loop_next
Both callers give a key argument

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:52:34 +01:00
Volker Lendecke
af608cdd8c s3: Use db_ctdb_ltdb_parse in db_ctdb_fetch_db_seqnum_from_db
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:52:02 +01:00
Volker Lendecke
7127344863 s3: Use db_ctdb_ltdb_parse in db_ctdb_ltdb_fetch
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:50:36 +01:00
Volker Lendecke
560ed93147 s3: Add db_ctdb_ltdb_parse
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:43:02 +01:00
Volker Lendecke
6e0259d8ec s3: Slightly simplify db_ctdb_transaction_commit
Avoid an unnecessary "else".

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:42:20 +01:00
Volker Lendecke
b206b52748 s3: Remove header==NULL code from db_ctdb_marshall_record
The only call chain (via db_ctdb_marshall_add) has header != NULL

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:41:46 +01:00
Volker Lendecke
00e2d83fa4 s3: Open gencache_notrans with TDB_NOSYNC
We are doing CLEAR_IF_FIRST here, and we are doing the transactions only to
protect gencache_stabilize against concurrent writers. tdb's transaction.c
says:

  - if TDB_NOSYNC is passed to flags in tdb_open then transactions are
    still available, but no fsync/msync calls are made.  This means we
    are still proof against a process dying during transaction commit,
    but not against machine reboot.

For gencache_notrans.tdb this is exactly what we want and avoids some expensive
disk syncs.

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 28 03:13:56 CET 2012 on sn-devel-104
2012-11-28 03:13:56 +01:00
Volker Lendecke
ee5db0efa5 s3: Avoid some transaction_commit on gencache.tdb
Commits are expensive, and in some scenarios we are overwriting existing values
again and again.

Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-27 16:08:47 -08:00
Volker Lendecke
994eec4d58 s3: Fix Coverity ID 741407 -- resource leak
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Nov 26 19:20:05 CET 2012 on sn-devel-104
2012-11-26 19:20:05 +01:00
Andrew Bartlett
f22e15d9d5 build: Do not install testing binaries
These binaries are for developer or selftest use, and are not
supported for installation onto the system.  The autoconf build does
not install these binaries, and so neither should the waf build.

Andrew Bartlett

Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov 22 12:00:36 CET 2012 on sn-devel-104
2012-11-22 12:00:36 +01:00
Volker Lendecke
611675fb37 s3: Fix some blank line endings
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Nov 20 19:18:33 CET 2012 on sn-devel-104
2012-11-20 19:18:33 +01:00
Andreas Schneider
c51abb35df s3fs-popt: Add function to burn the commandline password.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-08 10:14:41 -08:00
Björn Baumbach
541bde605e s3:ctdb library: fix the build against older ctdb versions
by checking if we have the ctdb_protocol.h and including ctdb_private.h otherwise.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-02 13:47:34 +01:00
Volker Lendecke
4dfded000c s3: Use file_id_string in file_id_string_tos
Reviewed by Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 30 00:05:34 CET 2012 on sn-devel-104
2012-10-30 00:05:34 +01:00
Volker Lendecke
e44b231f58 s3: Fix some nonempty line endings
Reviewed by Jeremy Allison <jra@samba.org>
2012-10-29 22:23:08 +01:00
Stefan Metzmacher
a144911958 s3:lib: remove unused connections_fetch_entry*() and connections_init()
metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:03 +02:00
Gregor Beck
0ccbf89bda s3:lib/conn_tdb: implement connections_forall_read() based on smbXsrv_*_global_traverse()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:02 +02:00
Gregor Beck
b74ed25a99 s3:lib: remove function connections_forall()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:02 +02:00
Gregor Beck
ac5c8909a9 s3:lib: remove unused sessionid_*() functions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:01 +02:00
Gregor Beck
f2714318ae s3:lib: implement sessionid_traverse_read with smb2srv_session_traverse_read
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:00 +02:00
Gregor Beck
d5c273919d s3:lib: remove unused function connections_traverse()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:59 +02:00
Stefan Metzmacher
8a1c7a0a66 s3:smbd: add exit_server to the smbd_shim hooks
This is in preparation of moving sessionid_tdb and conn_tdb
to smbd exclusively.

metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:58 +02:00
Michael Adam
781db9d1e5 s3: fix comment header description for smbd_shim
This was copy'n'pasted from "RPC pipe client"...

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:58 +02:00
Andrew Bartlett
1722074a9b vfs: Remove irixacl module (all the fucntions in it are unimplemented) 2012-10-11 14:52:27 +11:00
Andrew Bartlett
a0588fdea8 vfs: Fix alternative posix and no-op sys acl implementations to take a mem_ctx
These were missed with the initial conversion to use a talloc context.

Andrew Bartlett
2012-10-11 14:45:03 +11:00
Andrew Bartlett
9158974540 smbd: Add mem_ctx to sys_acl_init() and all callers
This changes from allocation on NULL to allocation on the supplied
memory context.

Currently that supplied context is talloc_tos() at the the final consumer of
the ACL.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Gregor Beck
bfafb0ce83 s3:dbwrap_ctdb: set errno = ENOSYS if clustering is not supported
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Sep 21 18:05:56 CEST 2012 on sn-devel-104
2012-09-21 18:05:56 +02:00
Volker Lendecke
f6e33eb890 s3: Use SBVAL in put_long_date_timespec
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 19 01:16:25 CEST 2012 on sn-devel-104
2012-09-19 01:16:25 +02:00
Volker Lendecke
2bbde78ce4 s3: Fix some nonempty line endings
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep 18 22:39:07 CEST 2012 on sn-devel-104
2012-09-18 22:39:07 +02:00
Björn Jacke
0b57d1c075 quota: add supprt for gfs2
gfs2 uses the same generic quota interface as xfs and it has the same base
block/quota block size ratio and seems to work nice with the xfs quota module.

(People using gfs should be aware that quota reporting is lagging quite a bit
on gfs.  If you copy a file on a gfs volume the quota values are being updated
with a delay of 30s here with kernel 3.5. This reporting can lead to data
corruption if a client thinks he can write but actually he suddently can't.)
2012-09-18 14:30:25 +02:00
Björn Jacke
b53c5bcf5b quota: also log which fs type we found
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sat Sep 15 02:18:16 CEST 2012 on sn-devel-104
2012-09-15 02:18:16 +02:00
Andrew Bartlett
6638d10366 smbd: Remove pre-allocation of ACL array in sys_acl_init()
Instead, this is just handled with realloc in sys_acl_create_entry()

This allows us to remove the size element from the SMB_ACL_T.

Andrew Bartlett
2012-09-12 05:26:16 +02:00
Andrew Bartlett
ac804f0d7f smbd-posix_acls: Use a IDL union to store the ACL entry
This is a clearer, long-term-stable structure we can hash without
risking it changing.

Andrew Bartlett
2012-09-12 05:26:16 +02:00
Björn Jacke
2ea0f6c00d s3:quota-nfs: add RQ_PATHLEN define for systems that don't have it
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sun Sep  9 17:44:51 CEST 2012 on sn-devel-104
2012-09-09 17:44:51 +02:00
Björn Jacke
79df06ed00 s3:quota-nfs: another build fix for the old Unix world 2012-09-09 15:59:42 +02:00
Björn Jacke
c853b68229 s3:quota: don't add the string '"' into the argument list
this is not used to quote or anything else. This is mainly
causing work for the script writer who has to remove the
quote stings again :-)

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sat Sep  8 03:13:13 CEST 2012 on sn-devel-104
2012-09-08 03:13:13 +02:00
Gregor Beck
0f284beb67 s3:lib: use includes.h with cbuf and srprs
hopefully fixes build on hpux

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-07 23:39:45 +02:00
Björn Jacke
abf98e3289 s3:sysquota_nfs: fix build on Tru64 et alii
the old Unix world put the struct rquota directly into the getquota_rslt
struct, the new Unix world puts a getquota_rslt_u union in between and they
decided to rename the status struct member.
2012-09-07 17:56:08 +02:00
Björn Jacke
ee2d6ae148 s3:quota: clean up and consolidate the xfs quota checks and defines
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Sep  7 15:59:46 CEST 2012 on sn-devel-104
2012-09-07 15:59:46 +02:00
Björn Jacke
3810ee4e87 s3:sysquota_xfs: fix logic so that we actually use this module on Linux 2012-09-07 14:15:57 +02:00
Björn Jacke
d1623ec025 s3:sysquota_xfs: check and include the right fs header file for xfs quotas 2012-09-07 14:15:57 +02:00
Alexander Bokovoy
b317f75ea6 s3-smbldap: make smbldap public library and maintain its ABI
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Sep  7 14:14:30 CEST 2012 on sn-devel-104
2012-09-07 14:14:30 +02:00