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

43783 Commits

Author SHA1 Message Date
Andreas Schneider
cd8f811247 s3-rpc_server: Remove obsolete make_internal_rpc_pipe().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 16:29:16 +01:00
Andreas Schneider
f69a490a87 s3-rpc_server: Remove obsolete FAKE_FILE_TYPE_NAMED_PIPE handling.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 16:28:58 +01:00
Andreas Schneider
b8e07323c9 s3-rpc_server: Use make_internal_rpc_pipe_socketpair().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 16:27:35 +01:00
Andreas Schneider
4498d07e73 s3-rpc_server: Pass the server event context to np_open().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 16:27:18 +01:00
Andreas Schneider
7daa4b94fa s3-rpc_server: Add make_internal_rpc_pipe_socketpair().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 16:17:03 +01:00
Andreas Schneider
327b0ddcd9 s3-smbd: Do not declare change_to_root_user() twice.
This is already in include/proto.h for smbd_shim.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:53:19 +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
Andreas Schneider
9e723f9d69 s3-rpc_server: Add named_pipe_client_init() function.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:51:47 +01:00
Andreas Schneider
921ef8f9eb s3-rpc_server: Make named_pipe_packet_process a shared functiion.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:51:08 +01:00
Andreas Schneider
1c069b1777 s3-rpc_server: Make make_server_pipes_struct a shared function.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:50:50 +01:00
Andreas Schneider
01524063cc s3-waf: Create a target for RPC_SOCK_HELPER.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:46:06 +01:00
Andreas Schneider
710ddf82ed s3-waf: Seperate rpc_server and rpc_service.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:45:39 +01:00
Andreas Schneider
df4c2df53b s3-waf: Reorder rpc_server wscript_build file.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:44:45 +01:00
Andreas Schneider
0733836b0e s3-rpc_server: Use new rpc named pipe functions.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:36:56 +01:00
Andreas Schneider
1e66a8e674 s3-rpc_server: Add make_internal_rpc_pipe().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:35:49 +01:00
Andreas Schneider
155a794e74 s3-rpc_server: Add make_external_rpc_pipe() function.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:34:48 +01:00
Andreas Schneider
b86b4d0db1 s3-rpc_server: Add npa_state_init() function.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-29 15:33:26 +01:00
Volker Lendecke
30e5a5c5bf rpc_server: Fix a memleak on error exit
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 Oct 28 10:20:35 CET 2013 on sn-devel-104
2013-10-28 10:20:35 +01:00
Volker Lendecke
21803653bb rpc_server: Remove rpc_ep_register_state->mem_ctx
We can use the state directly as a parent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-28 08:26:42 +01:00
Volker Lendecke
871e60297f rpc_server: Fix some uses of tevent_req_nomem
tevent_req_nomem is to be used in a sequence of async actions where we
have one main request. This is a completely independent loop without one
central tevent_req. tevent_req_nomem is used as a simple way to signal
an out of memory condition to the main request representing the async
sequence. If we don't have such a tevent_req, we need to directly check
for NULL.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-28 08:26:42 +01:00
Volker Lendecke
00132ab65c rpc_server: fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-28 08:26:42 +01:00
David Disseldorp
a13fda7472 smb2_ioctl: add support for FSCTL_SRV_COPYCHUNK_WRITE
FSCTL_SRV_COPYCHUNK can only be used when the client has the copy-chunk
target file open with FILE_WRITE_DATA and FILE_READ_DATA.
FSCTL_SRV_COPYCHUNK_WRITE requires only FILE_WRITE_DATA access on the
target, and is therefore suitable for cp --reflink, which opens the
target file O_WRONLY.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-25 11:41:19 -07:00
Volker Lendecke
ef4054eb88 Revert "smbd: Move oplock/sharemode ops into one place"
This reverts commit 7b70fa1873.

This is a change in behaviour which needs much further investigation
and testing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Oct 25 14:22:20 CEST 2013 on sn-devel-104
2013-10-25 14:22:20 +02:00
Volker Lendecke
4378db9819 Revert "smbd: Move oplock handling together"
This reverts commit e689b7d51e.

This is a change in behaviour which needs much further investigation
and testing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-25 12:33:30 +02:00
Volker Lendecke
e689b7d51e smbd: Move oplock handling together
Later on we will have all the oplock/sharemode operations in one routine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:22:08 +02:00
Volker Lendecke
7b70fa1873 smbd: Move oplock/sharemode ops into one place
This makes the is_stat_open special case in grant_fsp_oplock_type
redundant because in open_file_ntcreate further up we have already set
oplock_request to NO_OPLOCK for stat opens.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:22:05 +02:00
Volker Lendecke
184cc138b6 smbd: Remove separate oplock_type parameter from set_file_oplock
This avoids the question where it could happen that something else but
fsp->oplock_type might be useful as an argument here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:22:03 +02:00
Volker Lendecke
bd542281bc smbd: Unify parameters to set_oplock_type
Some lines above we set fsp->oplock_type = e->op_type. I don't see
how this might have changed. This change will unify both callers of
set_file_oplock. In the next step the second parameter to set_file_oplock
will be removed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:21:59 +02:00
Volker Lendecke
670da42bfb smbd: Make release_file_oplock static
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:21:56 +02:00
Volker Lendecke
31ab49f173 smbd: Use remove_oplock() in close_normal_file
remove_oplock is a wrapper around release_file_oplock. This streamlines
the exports of oplock.c a bit.

Reason for this patch: In a later patch I will add functionality to
remove_oplock that is required in close_normal_file as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:21:52 +02:00
Jeremy Allison
14813e7443 Fix bug 10196 - RW Deny for a specific user is not overriding RW Allow for a group.
When the ID returned is ID_TYPE_BOTH we must *always* add it as both
a user and a group, not just in the owning case. Otherwise DENY
entries are not correctly processed.

Confirmed by the reporter as fixing the problem.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-10-24 14:20:04 +02:00
Volker Lendecke
76e7d8f97f smbd: Remove MSG_SMB_ASYNC_LEVEL2_BREAK
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 12:12:17 +02:00
Volker Lendecke
d9a1d54b79 smbd: Use MSG_SMB_BREAK_REQUEST for async l2 breaks
Now that we transmit the level we want to break to via the msg.op_type
we can unify MSG_SMB_BREAK_REQUEST and MSG_SMB_ASYNC_LEVEL2_BREAK and
thus simplify the code a bit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 12:11:53 +02:00
Volker Lendecke
6c3b41cfc2 smbd: Fix breaking level2 on OVERWRITE create_disposition
This is shown by the new raw.oplock.level_ii_1 test

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 12:05:43 +02:00
Volker Lendecke
20669d4a75 smbd: Fix raw.batch.exclusive[59]
The level we have to break to depend on the breakers create_disposition:
If we overwrite, we have to break to none.

This patch overloads the "op_type" field in the break message we send
across to the smbd holding the oplock with the oplock level we want to
break to. Because it depends on the create_disposition in the breaking
open, only the breaker can make that decision. We might want to use
a different mechanism for this in the future, but for now using the
op_type field seems acceptable to me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:58:56 +02:00
Volker Lendecke
ccc808e0d7 smbd: Remove unused "mid" from delay_for_oplock
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:57:05 +02:00
Volker Lendecke
4c8bdf7878 smbd: Don't send op_mid in a BREAK message
The callee doesn't use this anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:56:21 +02:00
Volker Lendecke
de95b9d11d smbd: Simplify send_break_message
We don't need an fsp here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:55:33 +02:00
Volker Lendecke
cb27921274 smbd: Remove unused "oplock_request" arg from send_break_message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:51:43 +02:00
Volker Lendecke
9890a6a36d smbd: validate oplock types even for internal and stat opens
There's no reason why we should not do this. This has turned into a pure
internal consistency check that should apply fine every time.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:47:19 +02:00
Volker Lendecke
f892bdb204 smbd: Fix bug 10216
While refactoring find_oplock_types to validate_oplock_types I forgot
that stat opens will end up in locking.tdb. So even with a batch oplock
around we can have more than one entry. This means the consistency check
in validate_oplock_types was wrong and too strict.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-23 11:44:37 +02:00
Volker Lendecke
71c8cd19cf winbind3: Fix CID 241468 Resource leak
We were leaking centry in this error case

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-21 16:34:40 -07:00
Michael Adam
d286b17d46 idmap_autorid: fix traversal of ranges to correctly exclude mapping records.
When listing all ranges with "net idmap get ranges", the database records
of the form "S-1-5-10" --> "GID 100016" were treated here as rangee mapings,
resulting in an faulty printout like this: "RANGE 541346119: S-1-5-10".

This patch fixes this by adding a filter that checks the size of the
value datablob.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 21 19:48:40 CEST 2013 on sn-devel-104
2013-10-21 19:48:40 +02:00
Andreas Schneider
5ea154bf25 s3-rpc_server: Refactor lsasd_create_sockets().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 21 12:49:44 CEST 2013 on sn-devel-104
2013-10-21 12:49:44 +02:00
Volker Lendecke
b58df3d2bc lsasd: Fix CID 1107233 Double close
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-21 08:55:31 +00:00
Volker Lendecke
28cdd1c46f winbind3: Fix CID 1107229 Uninitialized pointer read
The first "goto done" would TALLOC_FREE the uninitialized "value"

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): Sat Oct 19 03:43:04 CEST 2013 on sn-devel-104
2013-10-19 03:43:04 +02:00
Michael Adam
01966190ac s3:nmbd: do a very early cluster probe when starting nmbd.
Just as for smbd and winbindd

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

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Oct 18 01:17:14 CEST 2013 on sn-devel-104
2013-10-18 01:17:14 +02:00
Michael Adam
5eae612c72 s3:winbindd: use cluster_probe_ok()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-17 23:22:50 +02:00
Michael Adam
0c21676bed s3:smbd: use new function cluster_probe_ok()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-17 23:22:29 +02: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