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

874 Commits

Author SHA1 Message Date
Volker Lendecke
a793ac016d smbd: Pull mtime handling into open_file_ntcreate
This is a performance improvement for heavily contended files, in
particular in a cluster. The separate call to get_file_infos makes us
pull the locking.tdb record twice per open. For a contended file this
can be a performance penalty, this gets the # of record accesses for
the open/close cycle down from 3 to 2.

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 Nov 23 00:40:49 CET 2013 on sn-devel-104
2013-11-23 00:40:49 +01:00
David Disseldorp
9a3d4d484e smbd/open: disable compression with FILE_NO_COMPRESSION
Files and directories created with FILE_NO_COMPRESSION should not
inherit the compression attribute from their parent directory.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 08:56:45 -08:00
Jeremy Allison
60f922bf1b Fix bug #10229 - No access check verification on stream files.
https://bugzilla.samba.org/show_bug.cgi?id=10229

We need to check if the requested access mask
could be used to open the underlying file (if
it existed), as we're passing in zero for the
access mask to the base filename.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-11-04 12:10:18 -08: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
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
a1fcd71f9a smbd: Simplify open_file_ntcreate
Only one call to delay_for_oplocks left. Metze showed me the new logic:
BATCH is broken if we have a sharing violation. Exclusive is broken
otherwise. That's it.

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): Wed Oct 16 02:51:53 CEST 2013 on sn-devel-104
2013-10-16 02:51:53 +02:00
Volker Lendecke
4c0cf9fade smbd: Remove "file_existed" handling from open_mode_check
No clue what this does. In open_directory, "dir_existed" is not used after
open_mode_check. In open_file_ntcreate it's used, but I can't think of a case
right now where we would find a formerly nonexisting file to exist suddenly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-16 00:50:13 +02:00
Volker Lendecke
4263d16f13 smbd: Decouple grant_fsp_oplock_type from oplock validation
This makes grant_fsp_oplock_type independent from the values computed
in validate_oplock_types. It *might* make oplock calculation a bit
slower for heavily shared files, as we are walking the share mode array
twice. But we are doing so much stuff in open that I doubt the difference
is measurable. It clears up the code for me however, and I think that's
worth it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-16 00:45:43 +02:00
Volker Lendecke
00d84ad192 smbd: Reduce the complexity of open_file_ntcreate
This removes two variables in open_file_ntcreate based on the observation
that for exclusive and batch oplocks there can only be one entry. So
in these cases we don't need to keep pointers from find_oplock_types to
delay_for_oplocks. We can just reference the only share mode entry around.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-16 00:33:47 +02:00
Volker Lendecke
4d85f91a5b smbd: Make find_oplock_types return bool
smb_panic() does not take a printf style argument. This improves debug
output by easily printing the index that we fell over. Also, doing
smb_panic deep down is bad style IMHO.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:44:37 +02:00
Volker Lendecke
0f71730d1b smbd: Make loop index type match loop limit
share_mode_data.num_share_modes is a uint32.

48 bytes less in .o text size for -O3 :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:43:30 +02:00
Volker Lendecke
388bf3643d smbd: Unify delay_for_*_oplocks
This is the same code in both routines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:42:41 +02:00
Volker Lendecke
c33015c069 smbd: Simplify find_oplock_types a bit
Define a variable to dereference lck->data just once. Believe it or not,
this saves a few bytes .o with -O3 :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:38:27 +02:00
Volker Lendecke
fcafaf6022 smbd: Remove FAKE_LEVEL_II_OPLOCK
FAKE_LEVEL_II_OPLOCK was an indicator to break level2 oplock holders
on write.  This information is now being held in brlock.tdb, which makes
the FAKE_LEVEL_II_OPLOCK type unnecessary.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Volker Lendecke
dd0e4c47e5 smbd: Remove unused create_options from open_mode_check
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Oct 13 14:35:26 CEST 2013 on sn-devel-104
2013-10-13 14:35:26 +02:00
Volker Lendecke
4c82e8358a smbd: Remove name_hash param from open_mode_check
This came from delete_on_close handling which was factored out.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-13 12:43:32 +02:00
Volker Lendecke
7a6d240b7f smbd: Fix the extended *.oplock.doc1 tests
We need to check for DELETE_PENDING before the first oplock break

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 12 01:56:18 CEST 2013 on sn-devel-104
2013-10-12 01:56:18 +02:00
Volker Lendecke
02393156de smbd: Fix an error path in open_directory
In open_file_ntcreate we do the del_share_mode on error. We should do
it here as well.

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 Oct  9 01:58:55 CEST 2013 on sn-devel-104
2013-10-09 01:58:55 +02:00
Volker Lendecke
e0e5f67da5 smbd: Convert set_share_mode to return bool for success
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-08 14:42:25 -07:00
Volker Lendecke
41857bd0f7 smbd: Fix confusing comments
The brlock-check is done in grant_fsp_oplock_type

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06 13:54:33 +02:00
Volker Lendecke
6bcfc1a9da smbd: Add brl_num_locks access function 2013-09-11 08:27:11 +02:00
Michael Adam
1e29d73066 s3:smbd: ease file server upgrades from 3.6 and earlier with "acl allow execute aways"
3.6 and earlier allowed open for execution when execute permissions are
not present on a file. This has been fixed in Samba 4.0.

This patch changes smbd to skip the execute bit from the ACL check
in the open code if "acl allow execute always = yes", hence
re-establishing the old behaviour in this case.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-09-10 23:33:12 +02:00
Volker Lendecke
392889c8bc smbd: Slightly simplify send_break_message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06 13:41:59 +02:00
Volker Lendecke
4ecf8b4db6 smbd: Remove a silly "? true : false"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06 13:40:58 +02:00
Volker Lendecke
1bf10ad806 smbd: Remove two confusing TALLOC_FREE calls
We don't have lck allocated yet at these points. Remove the TALLOC_FREE
calls that triggered me looking for the get_share_mode_lock calls.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06 13:39:16 +02:00
Volker Lendecke
196da5925b smbd: Remove FORCE_OPLOCK_BREAK_TO_NONE
This flag existed to break an exclusive or batch oplock in just one
instead of two steps down to "no oplock" when we did an allocation or file
size change.  Running raw.oplock against W2k12 differs in this respect
from W2k3: W2k12 takes two steps (via level2) to break to none. This
removes the special flag that we only had for compatibility with systems
older than W2k12...

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 Sep  6 00:47:07 CEST 2013 on sn-devel-104
2013-09-06 00:47:07 +02:00
Volker Lendecke
94b320527e smbd: Simplify find_oplock_types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03 17:13:52 +02:00
Jeremy Allison
4111fcfd4f Only do the 1 second delay for sharing violations for SMB1, not SMB2.
Match Windows behavior.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2013-05-07 17:58:45 +02:00
Volker Lendecke
8283fd0e00 smbd: Do not fetch the record in defer_open_done
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 Apr 27 02:06:10 CEST 2013 on sn-devel-104
2013-04-27 02:06:10 +02:00
Volker Lendecke
a7e803485d smbd: We don't use DEFERRED_OPEN_ENTRY anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:22 -07:00
Volker Lendecke
afe9446985 smbd: Use dbwrap_record_watch_send for defer_open
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:21 -07:00
Volker Lendecke
cc0b8351a4 smbd: Convert create_file_unixpath to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:03 -07:00
Volker Lendecke
421eeef732 smbd: Convert open_streams_for_delete to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:02 -07:00
Volker Lendecke
66beff7dd0 smbd: Convert msg_file_was_renamed to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:02 -07:00
Volker Lendecke
39c5a77b0a smbd: Convert change_dir_owner_to_parent to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:01 -07:00
Volker Lendecke
d003f2ff80 smbd: Convert change_dir_owner_to_parent to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:01 -07:00
Volker Lendecke
c9a220bdaf smbd: Convert change_file_owner_to_parent to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:01 -07:00
Volker Lendecke
0f9eb25183 smbd: Fix an error return in change_dir_owner_to_parent
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>

Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Mon Apr 15 18:05:06 CEST 2013 on sn-devel-104
2013-04-15 18:05:06 +02:00
Stefan Metzmacher
8fbe39d513 s3:smbd/open: fall back to Builtin_Administrators if SYSTEM doesn't map to a group
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-12-02 18:32:36 +01:00
Stefan Metzmacher
139232656a s3:smbd/open: try the primary sid (user) as group_sid if the token has just one sid
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-12-02 18:32:04 +01:00
Stefan Metzmacher
0a3396b536 s3:smbd/open: use Builtin_Administrators as owner of files (if possible)
We do this if the idmap layer resolves Builtin_Administrators
as ID_TYPE_BOTH and if the current token has the
Builtin_Administrators SID or it's SYSTEM.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-12-02 18:31:00 +01:00
Stefan Metzmacher
b3eb78c4f7 s4:smbd/open: add missing TALLOC_FREE(frame) to inherit_new_acl()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-28 12:21:42 +01:00
Jeremy Allison
4985332b95 Add comments explaining exactly *why* we don't check FILE_READ_ATTRIBUTES when evaluating file/directory ACE's.
If we can access the path to this file, by
default we have FILE_READ_ATTRIBUTES from the
containing directory. See the section.
"Algorithm to Check Access to an Existing File"
in MS-FSA.pdf.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-19 13:16:09 +01:00
Michael Adam
b557f34c80 s3:smbd: fix brace placements in validate_my_share_entries() for readability
according to coding guidelines

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 17 14:37:58 CEST 2012 on sn-devel-104
2012-10-17 14:37:58 +02:00
Andrew Bartlett
c8ade07760 smbd: Add mem_ctx to {f,}get_nt_acl VFS call
This makes it clear which context the returned SD is allocated on, as
a number of callers do not want it on talloc_tos().

As the ACL transformation allocates and then no longer needs a great
deal of memory, a talloc_stackframe() call is used to contain the
memory that is not returned further up the stack.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Jeremy Allison
3f5a3b60e2 Revert "When creating a new file/directory, we need to obey the create mask/directory mask parameters."
This reverts commit c251a6b044.

Remove this as we're planning to remove the security mask,
directory security mask parameters and only use create mask/directory mask.
2012-10-04 09:52:38 -07:00
Jeremy Allison
c251a6b044 When creating a new file/directory, we need to obey the create mask/directory mask parameters.
Currently we call FSET_NT_ACL to inherit any ACLs on create. However
FSET_NT_ACL uses the security mask/directory security mask parameters
instead of the create mask/directory mask parameters.

Swap them temporarily when creating to ensure the correct masks
are applied.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct  2 22:27:17 CEST 2012 on sn-devel-104
2012-10-02 22:27:17 +02:00
Volker Lendecke
e576bf5310 s3: Fix opening a file under kernel oplocks
With the prior code we assumed that we do not have kernel oplocks around
when we open a file because we handled samba-internal oplock breaks
before the open attempt.

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Sep 29 19:29:36 CEST 2012 on sn-devel-104
2012-09-29 19:29:36 +02:00
Volker Lendecke
e00df42a37 s3: Remove a SMB_ASSERT
With the simplified logic this became unnecessary
2012-09-29 08:42:50 -07:00
Volker Lendecke
8b7e75b358 s3: Close the now opened file descriptor in error paths 2012-09-29 08:42:50 -07:00
Volker Lendecke
64c4940039 s3: No code change, just re-indent
Look at this with "git diff -b" if you don't believe me :-)
2012-09-29 08:42:50 -07:00
Volker Lendecke
173e808ed4 s3: Remove share mode handling before we open the file
This is a significant behaviour change: We do not open the file under
the share mode lock anymore. This might lead to more open calls in case
of oplock breaks or sharing violations, but those are slow error paths
and as such might be not too performance sensitive. The benefit of this
patch is a significant reduction of complexity of open_file_ntcreate()
2012-09-29 08:42:49 -07:00
Volker Lendecke
590d3138be s3: Fix fcb_or_dos_open after logic change
With the new behaviour, we call fcb_or_dos_open after open_file(). It
is open_file() that sets up the fsp so that fcb_or_dos_open can find it
in the list of fsps. Avoid finding the fsp we are just setting up.
2012-09-29 08:42:49 -07:00
Volker Lendecke
8be0f4d30f s3: Copy share mode handling from before to after open_file
This is a 1:1 copy&paste of the oplock/sharemode code that we do before
an existing file is opened. It is a prerequiste for a patch that removes
all of that handling before we open the file.
2012-09-29 08:42:49 -07:00
Volker Lendecke
4666dec416 s3: Fix rejecting mkdir on read-only shares
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-27 01:07:08 +02:00
Volker Lendecke
36ec31336f s3: Slightly simplify open_file()
The "else" is not necessary. In the if-branch we just returned.

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 26 18:08:03 CEST 2012 on sn-devel-104
2012-09-26 18:08:03 +02:00
Volker Lendecke
1fa730deba s3: Slightly simplify calculate_open_access_flags 2012-09-26 16:29:28 +02:00
Volker Lendecke
cc58a19565 s3: Slightly simplify calculate_open_access_flags 2012-09-26 16:29:28 +02:00
Volker Lendecke
7600fd8b0c s3: Factor out calculate_open_access_flags
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 26 00:22:56 CEST 2012 on sn-devel-104
2012-09-26 00:22:56 +02:00
Volker Lendecke
11af163df8 s3: Fix a typo 2012-09-25 22:41:51 +02:00
Volker Lendecke
c034ff7b15 s3: Slightly simplify is_stat_open
The "access_bits" clause is redundant. is_stat_open says that exactly
at least one of the stat_open_bits must be set and none else.

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep 25 20:05:06 CEST 2012 on sn-devel-104
2012-09-25 20:05:06 +02:00
Volker Lendecke
34f2d18984 s3: Make is_stat_open() a bit more readable 2012-09-25 09:23:28 -07:00
Volker Lendecke
456f821626 s3: Fix indentation of if-expressions
To me this makes open_file_ntcreate a little easier to understand

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep 25 10:08:15 CEST 2012 on sn-devel-104
2012-09-25 10:08:15 +02:00
Jeremy Allison
aef862c7b0 Fix bug #9189 - SMB2 Create doesn't return correct MAX ACCESS access mask in blob.
If we aren't already granted DELETE access, check if we have
DELETE_CHILD in the containing directory.
2012-09-25 03:07:50 +02:00
Stefan Metzmacher
7a493fd867 s3:smbd: release the share mode lock before calling exit_server() (bug #9191)
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Sep 21 22:36:57 CEST 2012 on sn-devel-104
2012-09-21 22:36:57 +02:00
Jeremy Allison
8de46eac65 Add 'bool use_privs' to smbd_calculate_access_mask().
Replaces blanket root allow if set. Set to 'false' for
all current callers.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep 15 00:37:49 CEST 2012 on sn-devel-104
2012-09-15 00:37:49 +02:00
Jeremy Allison
6d82976597 Fix bad string in debug message (remove it). 2012-09-14 22:54:29 +02:00
Jeremy Allison
aa0a7cf51a Add bool use_privs parameter to smbd_check_access_rights()
If this is set we should use it in preference to blindly assuming
root can do anything. Currently set to 'false' in (most) callers.
2012-09-14 22:54:29 +02:00
Volker Lendecke
ab709544f4 s3: delete requests are not special
The only difference between batch and exclusive oplocks is the time of
the check: Batch is checked before the share mode check, exclusive after.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-10 14:58:51 -07:00
Michael Adam
ba011c1de0 s3:smbd: make fd_open() public 2012-09-08 19:42:55 +02:00
Michael Adam
f5a6b7b301 s3:smbd: don't set kernel flock if "kernel share modes = no"
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Sep  8 13:05:05 CEST 2012 on sn-devel-104
2012-09-08 13:05:05 +02:00
Stefan Metzmacher
eb1a05f783 s3:smbd: add disconnected checks to the open code.
(delay_for_batch_oplocks, open_mode_check, and delay_for_exclusive_oplocks)

Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-08 03:39:06 +02:00
Jeremy Allison
d7fb237810 Remove an unncessary FTRUNCATE call in the open path. We can rely on O_TRUC.
Suggested by Volker.
2012-09-05 20:43:31 +02:00
Volker Lendecke
084978f3d0 s3: Slightly simplify fd_open_atomic
Replace an if-statement by a direct assignment

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep  5 01:56:46 CEST 2012 on sn-devel-104
2012-09-05 01:56:46 +02:00
Volker Lendecke
d95d32606b s3: Put a comment into the right place
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:15:00 -07:00
Volker Lendecke
63279e374a s3: Factor out disposition_to_open_flags
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:15:00 -07:00
Volker Lendecke
f67a6c463c s3: Factor out calculation of clear_ads
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:15:00 -07:00
Volker Lendecke
0d869327ed s3: Slightly simplify open_file_ntcreate
We have not set flags2 before, so do direct assignment and not |=

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:15:00 -07:00
Volker Lendecke
93e10db3dd s3: Make "open_match_attributes" static
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:15:00 -07:00
Volker Lendecke
d5f845c0d3 s3: Make an if statement a bit easier to read
Fix indentation a bit

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep  1 07:07:12 CEST 2012 on sn-devel-104
2012-09-01 07:07:12 +02:00
Jeremy Allison
46455642a7 Change the S3 fileserver over to se_file_access_check().
Don't set the priv_open_requested yet until the open-for-backup
request is correctly passed in.
2012-08-31 20:29:13 -07:00
Jeremy Allison
795920cf4a Change the other two places where we set a security descriptor given by the client to got through set_sd(),
the canonicalize sd function.
2012-08-30 10:08:50 -07:00
Volker Lendecke
d2eb26cfbd s3: Make request_timed_out() static
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-07-31 11:40:22 +02:00
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Jeremy Allison
a7c63ac1b7 Set fsp->initial_allocation_size before calling open_file_ntcreate().
Allows an SMB_VFS_OPEN() vfs module to do something interesting with
the request.
2012-07-12 22:46:07 +02:00
Jeremy Allison
775014bd9c Make sure we reset fsp->initial_allocation_size to zero if we didn't create the file.
This will become important as we set fsp->initial_allocation_size before
create.
2012-07-12 22:46:07 +02:00
Jeremy Allison
6d903bf189 Cope with a (non-security) open race we've had for ever as NTCreateX isn't atomic on POSIX.
On open without create, the file did exist, but some
other (local or NFS) process either renamed/unlinked
and re-created the file with different dev/ino after
we walked the path, but before we did the open. We
could retry the open but it's a rare enough case it's
easier to just fail the open to prevent creating any
problems in the open file db having the wrong dev/ino
key.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 10 21:57:33 CEST 2012 on sn-devel-104
2012-07-10 21:57:33 +02:00
Jeremy Allison
69a3e947b6 Now we have a guaranteed indication of a file being created, use it to set the create disposition correctly. 2012-07-10 09:39:36 -07:00
Jeremy Allison
02d42be258 Add function fd_open_atomic() which uses O_CREAT|O_EXCL to return a guaranteed indication of creation of a new file. 2012-07-10 09:39:29 -07:00
Jeremy Allison
3aa186f1d4 Simplify the logic in open_file() some more.
Move the inheritance work into the if block
where we created the file. We can never have
created the file (and thus need no inheritance)
for a stat-open.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 10 03:30:22 CEST 2012 on sn-devel-104
2012-07-10 03:30:22 +02:00
Jeremy Allison
3a705e5f3d Simplify the logic in open_file().
Move the fstat call into the block which opens a file descriptor.
Remove the stat() call in the stat-open case. We already failed
the open if !file_existed.
2012-07-09 16:20:45 -07:00
Jeremy Allison
9d5e026bde Make check_same_stat() and check_same_dev_ino() common functions. 2012-07-09 12:26:56 -07:00
Jeremy Allison
1f37ed7a52 Factor out check_same_dev_ino() from check_same_stat() so it can be called separately. 2012-07-09 11:35:20 -07:00
Andreas Schneider
d0878b3b81 s3-smbd: Remove deprecated 'share modes' option. 2012-07-03 21:56:49 +02:00
Jeremy Allison
5679ba1018 Don't allow asynchronous creates to be canceled in SMB2.
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 30 04:10:02 CEST 2012 on sn-devel-104
2012-06-30 04:10:02 +02:00
Jeremy Allison
b004121d9b Allow for async opens.
If the SMB_VFS_OPEN() function returns -1, EINTR -> NT_STATUS_RETRY,
then queue the open up to be completed when the async open completes.
2012-06-30 02:23:39 +02:00
Jeremy Allison
d1e1aa552d Add new bool field async_open to struct deferred_open_record. Not used yet. 2012-06-30 02:23:39 +02:00
Jeremy Allison
0362dcbd09 Fix defer_open() fuction in the open code path to cope with a NULL lck parameter. 2012-06-30 02:23:39 +02:00
Volker Lendecke
754b925ccd s3: Fix a typo
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 25 17:13:59 CEST 2012 on sn-devel-104
2012-06-25 17:13:59 +02:00
Michael Adam
73b200064f s3:util: rename procid_equal() to serverid_equal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:32 +02:00
Volker Lendecke
985dbedf27 s3: Slightly simplify grant_fsp_oplock_type
The "else" is not necessary, we did a return in the if-branch

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-06-15 21:07:55 -07:00
Michael Adam
cdfc301da9 s3:smbd: change open.c to use fsp_fnum_dbg() for fsp->fnum logging.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:14 +02:00
Björn Jacke
f97ca7d643 s3: fix build on systems without O_NOFOLLOW 2012-06-10 21:38:08 +02:00
Björn Jacke
f75f1d6233 s3: handle non-POSIX compliant Tru64, NetBSD and FreeBSD errno on O_NOFOLLOW symlink open calls
or should we leave the NetBSD and FreeBSD platforms just broken? Actually these
two *want* to have broken platforms as they use different errno's than POSIX
demands *interntionally*. The POSIX errno ELOOP for O_NOFOLLOW open calls on
symlinks is clear and unambiguous. See http://gnats.netbsd.org/43154 for the
interesting NetBSD discussion on that.

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sun Jun 10 16:10:02 CEST 2012 on sn-devel-104
2012-06-10 16:10:01 +02:00
Michael Adam
8a338c65a1 s3:smbd: change set_file_oplock() to return NTSTATUS
Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  8 23:20:20 CEST 2012 on sn-devel-104
2012-06-08 23:20:20 +02:00
Volker Lendecke
088ca00b92 s3: Replace an if with a boolean short circuit
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:20 +02:00
Volker Lendecke
a3b4a5d779 s3: Assigning ?True:False to a bool is a bit pointless
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:20 +02:00
Volker Lendecke
4aea0c1fa1 s3: Remove unnecessary ()
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:19 +02:00
Stefan Metzmacher
c535668f7b s3:smbd: let fcb_or_dos_open() take a uint64_t vuid
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
37bfadf4a3 s3:include: change files_struct->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
145fe2ac4c s3:smbd: fcb_or_dos_open() can be static
metze
2012-06-06 10:18:37 +02:00
Jeremy Allison
4accd2396e Fix bug #8972 - Directory group write permission bit is set if unix extensions are enabled
We can't manipulate file_attributes if it's a posix call. I'll look
at adding a test for this asap.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jun  5 04:26:11 CEST 2012 on sn-devel-104
2012-06-05 04:26:10 +02:00
Stefan Metzmacher
85e6dcf49c s3:smbd/open: avoid procid_is_me()
metze
2012-06-03 17:23:27 +02:00
Jeremy Allison
50fdb32a4d Ensure we only return NT_STATUS_DELETE_PENDING if the share modes are valid.
Ensure we only return *file_existed = true if there were valid share modes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
1b15d8b3da s3: Check for serverid_exists in find_oplock_types
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
fdcca54ca3 s3: Check for serverid_exists in open_mode_check
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:37 -07:00
Volker Lendecke
f5ca3f11e4 s3: Revert the serverid changes, they need more work
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
2012-05-18 13:12:14 +02:00
Volker Lendecke
49237b0cef s3: Check for serverid_exists in find_oplock_types
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
4962ab2aa8 s3: Check for serverid_exists in open_mode_check
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:21 -07:00
Volker Lendecke
7ae716663a s3: Remove an unused parameter from check_parent_access() 2012-05-04 18:44:29 +02:00
Volker Lendecke
d12fa60ef8 s3: In mkdir_internal, don't retrieve parent_dir from check_parent_access
We have already created that ourselves a few lines above
2012-05-04 18:44:29 +02:00
Volker Lendecke
e1bf9ccffd s3: Fix a typo 2012-05-04 15:02:41 +02:00
Volker Lendecke
7af3dfd3af s3: Remove a pointless else branch
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sun Feb 19 23:14:15 CET 2012 on sn-devel-104
2012-02-19 23:14:15 +01:00
Volker Lendecke
f217faef1a s3: get_share_mode_lock_fresh->get_share_mode_lock
get_share_mode_lock_fresh is just a confusing name

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sun Feb 19 19:16:41 CET 2012 on sn-devel-104
2012-02-19 19:16:41 +01:00
Volker Lendecke
e5c8484073 s3: get_share_mode_lock->get_existing_share_mode_lock 2012-02-19 17:44:26 +01:00
Volker Lendecke
740d4d7550 s3: files_struct->mode is only written, remove it
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Feb 14 19:14:29 CET 2012 on sn-devel-104
2012-02-14 19:14:29 +01:00
Volker Lendecke
a93cdacd16 s3: Simplify an if-statement
is_ntfs_default_stream_smb_fname already contains all checks that
the variable "stream_name" gives us here.
2012-01-31 23:30:09 +01:00
Volker Lendecke
2b1d7ac060 s3: Unify stream testing in open_directory
The second if-statement could never have kicked in, assuming the
SMB_ASSERT above was right.

Jeremy, please check!

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jan 31 20:15:36 CET 2012 on sn-devel-104
2012-01-31 20:15:36 +01:00
Volker Lendecke
549a31963e s3: Re-indent an && sequence for better understanding 2012-01-31 18:38:15 +01:00
Richard Sharpe
3191040c3d Another fix for bug #8556 - ACL permissions ignored when SMBsetatr is requested.
Prevent systems with "store dos attributes = yes" from overriding
FILE_WRITE_ATTRIBUITES.
2012-01-23 12:50:25 -08:00
Volker Lendecke
b9e806050f Revert "Fix bug #8175 - smbd deadlock."
This reverts commit 5a2b5b6cfe.
2012-01-18 14:48:04 +01:00
Volker Lendecke
cfebba96bd s3: Put an indirection layer into share_mode_lock
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12 23:59:22 +01:00
Volker Lendecke
9cf6d735d4 s3: Introduce get_share_mode_lock_fresh()
This slightly simplifies the code path for all callers which assume
that a share mode exists already. Only the callers in open_file_ntcreate
and open_directory will ever create new share modes.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12 23:59:22 +01:00
Volker Lendecke
bed281dad7 s3: Remove the unused "file_existed" parameter from smbd_calculate_access_mask
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jan  3 15:16:50 CET 2012 on sn-devel-104
2012-01-03 15:16:49 +01:00
Volker Lendecke
c01f02a4b9 s3: Avoid "file_existed" in smbd_calculate_maximum_allowed_access
We access the file by name anyway, so we can just try to access it. The file
system will for sure tell us if the file does not exist.
2012-01-03 13:38:02 +01:00
Volker Lendecke
49a520217c s3: Remove some else{} branches in smbd_calculate_maximum_allowed_access 2012-01-03 13:38:01 +01:00
Volker Lendecke
8cadd19a91 s3: Directly use *p_access_mask in smbd_calculate_maximum_allowed_access 2012-01-03 13:38:01 +01:00
Volker Lendecke
a5a4b581b7 s3: Factor out smbd_calculate_maximum_allowed_access 2012-01-03 13:38:00 +01:00
Jeremy Allison
c23f1ee0c9 Allow an object to be deleted from a directory if the caller has DELETE_CHILD access
even if we don't have access to read the ACL on the object. Fixes bug #8673 - NT ACL issue.
Different fix needed for 3.6.x.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 20 22:13:51 CET 2011 on sn-devel-104
2011-12-20 22:13:51 +01:00
Jeremy Allison
b939144071 check_name() not needed in mkdir.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec 17 02:44:55 CET 2011 on sn-devel-104
2011-12-17 02:44:55 +01:00
Jeremy Allison
1dfa3ee986 Ensure VALID_STAT before accessing fields. 2011-12-17 01:10:41 +01:00
Stefan Metzmacher
704cf10645 s3:smbd: avoid using sconn_server_id()
metze
2011-12-16 13:19:32 +01:00
Volker Lendecke
7000bb6933 s3: Add some const to find_oplock_types
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Dec 16 09:10:07 CET 2011 on sn-devel-104
2011-12-16 09:10:06 +01:00
Volker Lendecke
2349c027c1 s3: Make open_file_ntcreate a bit easier to read
Move the declaration of "id" closer to its use
2011-12-16 07:34:48 +01:00
Volker Lendecke
ce30a7ae7b s3: Make open_file_ntcreate a bit easier to read
Move the calculation of "new_file_created" closer to its use
2011-12-16 07:34:48 +01:00
Volker Lendecke
98f7ba52e3 s3: Make open_file_ntcreate a bit easier to read
Remove a negation where it's not necessary
2011-12-16 07:34:48 +01:00
Volker Lendecke
432ea5f5c6 s3: Slightly simplify delay_for_exclusive_oplocks 2011-12-16 07:34:48 +01:00
Volker Lendecke
b3d8ecaf52 s3: Slightly simplify delay_for_batch_oplocks 2011-12-16 07:34:47 +01:00
Jeremy Allison
c5cbe481a7 Third part of fix for bug #8663 - deleting a symlink fails if the symlink target is outside of the share.
smbd_check_access_rights() - we can always delete a symlink.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Dec 16 03:32:15 CET 2011 on sn-devel-104
2011-12-16 03:32:15 +01:00
Jeremy Allison
8eca223123 First part of fix for bug #8663 - deleting a symlink fails if the symlink target is outside of the share.
Remove two unneeded check_name() calls. They have already been done
in order to get here.
2011-12-15 16:31:51 -08:00
Volker Lendecke
c889c8d705 s3: Slightly simplify the logic in defer_open
Doing 3 &&ed conditions in a single if-statement is easier to understand to me
than continuing out separately.
2011-12-14 17:34:21 +01:00
Volker Lendecke
f7e84f2809 s3: Remove UNUSED_SHARE_MODE_ENTRY 2011-12-14 17:34:21 +01:00
Stefan Metzmacher
940f21e5c6 s3:smbd/open: use talloc_get_type_abort() as private_data can't be NULL
metze
2011-12-14 12:00:07 +01:00
Volker Lendecke
2d2d72e479 s3: Remove an else{} in remove_deferred_open_entry 2011-12-13 17:27:26 +01:00
Stefan Metzmacher
e09c675596 s3:smbd/open: pass smbd_server_connection as private_data to msg_file_was_renamed()
metze
2011-12-13 12:36:35 +01:00
Volker Lendecke
1c46fb5c3e s3: Use autogenerated open_files.idl 2011-12-02 22:43:05 +01:00
Jeremy Allison
de3ab9bd05 Move setting the inherited ACL into the main open code path. Next will
remove it from the ACL modules.
2011-11-22 12:33:27 -08:00
Jeremy Allison
6795432f27 Move the "set SD" code into provided SD and "inherit acls" branches. 2011-11-22 11:53:51 -08:00
Jeremy Allison
7b275c551b Only add the SD if it's not a new stream file. 2011-11-22 10:37:56 -08:00
Jeremy Allison
12514bf008 Move the add security descriptor code to *after* all the other meta-data is
updated. We may be adding an SD that restricts our own access.
2011-11-22 10:28:52 -08:00
Jeremy Allison
bbcb589ef5 No longer do the pre-check on DELETE_ACCESS - we're correctly checking the ACL every time now. 2011-11-04 15:56:15 -07:00
Jeremy Allison
b988a3233f Remove can_access_file_acl(). We no longer need this duplicate code (hurrah!). 2011-11-04 15:55:11 -07:00
Jeremy Allison
60b741415d Remove can_access_file_data() - make it use the standard smbd_check_access_rights() instead. 2011-11-04 15:45:13 -07:00
Jeremy Allison
4851219333 Add const to the smb_filename argument of smbd_check_access_rights(). 2011-11-04 15:39:55 -07:00
Jeremy Allison
a30f84a21c Expose smbd_check_access_rights() to other modules. 2011-11-04 14:37:26 -07:00
Jeremy Allison
32edc1d047 Rename smbd_check_open_rights() to smbd_check_access_rights() as we're going to remove the static from this. 2011-11-04 14:28:08 -07:00
Jeremy Allison
0c886eeb89 Replace smb1_file_se_access_check() with just se_access_check(). 2011-11-04 14:21:35 -07:00
Jeremy Allison
55b9ba79f8 Move root check out of smb1_file_se_access_check() in preparation for deleting this function. 2011-11-04 14:16:51 -07:00
Jeremy Allison
07edf6c65e smb1_file_se_access_check() is now static to smbd/open.c 2011-11-04 14:16:37 -07:00
Jeremy Allison
1fab17de94 Revert "Change function signature of check_parent_access() to take char * instead of struct smb_filename."
This reverts commit a11c0a41a3.

Not needed.
2011-11-04 14:15:47 -07:00
Jeremy Allison
a11c0a41a3 Change function signature of check_parent_access() to take char * instead of struct smb_filename.
Expose it so it can be called from directory code.
2011-11-01 16:38:14 -07:00
Jeremy Allison
3bd6513884 Remove the order dependency in parent_override_delete(), just check for & not ==. 2011-10-28 12:16:42 -07:00
Jeremy Allison
8a65e2c747 Remove unused "struct security_descriptor" parameter from check_parent_access() 2011-10-28 12:16:42 -07:00
Jeremy Allison
ea195b6cd2 Finally do all the open checks inside open_file(). Checks inside
vfs_acl_common can now be removed.
2011-10-28 12:16:42 -07:00
Jeremy Allison
8a3070a7c9 Simplify smbd_check_open_rights() and move all the special casing inside it. 2011-10-28 12:16:42 -07:00
Jeremy Allison
18df3aedb9 Move parent_override_delete() to before I need to use it. 2011-10-28 12:16:42 -07:00
Jeremy Allison
1619de3080 Make smbd_check_open_rights() static. 2011-10-28 12:16:42 -07:00
Jeremy Allison
62ccae3229 Factor out the code checking if a parent should override DELETE_ACCESS into a function.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Oct 26 23:15:05 CEST 2011 on sn-devel-104
2011-10-26 23:15:05 +02:00
Jeremy Allison
4ec2c2a5e8 Remove another level of indentation - deal with !NT_STATUS_OK individually. 2011-10-26 12:29:19 -07:00
Jeremy Allison
4b9bdee167 Add early return on stat open without O_CREAT if file doesn't exist.
Reduces one level of indentation.
2011-10-26 12:08:51 -07:00
Jeremy Allison
30fb5e9969 Refactor to create check_parent_access() which can be called for file creation too.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Oct 20 20:29:22 CEST 2011 on sn-devel-104
2011-10-20 20:29:22 +02:00
Jeremy Allison
ff8fa5aa2b Make mkdir_internal() check the parent ACL for SEC_DIR_ADD_SUBDIR rights. 2011-10-20 09:07:46 -07:00
Jeremy Allison
f64f91f96f Fix error return to be NT_STATUS_NOT_A_DIRECTORY. 2011-10-20 00:58:29 +02:00
Jeremy Allison
7b4edc11e3 Make use of the "dir_exists" we already have on directory open. 2011-10-20 00:58:29 +02:00
Frank Lahm
c3bdcab516 First part of fix for bug #8419 - Make VFS op "streaminfo" stackable.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Oct 17 21:39:32 CEST 2011 on sn-devel-104
2011-10-17 21:39:32 +02:00
Frank Lahm
7a0b5d6fc5 Add support for VFS op streaminfo chaining in all relevant VFS modules.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Oct 14 03:26:06 CEST 2011 on sn-devel-104
2011-10-14 03:26:06 +02:00
Jeremy Allison
f93fd128eb Fix bug #8507 - smbd doesn't correctly honor the "force create mode" bits from a cifsfs create.
Don't manipulate the new_dos_attributes bits until we know it's not a POSIX open.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Oct  5 01:19:17 CEST 2011 on sn-devel-104
2011-10-05 01:19:17 +02:00
Volker Lendecke
f9d183f931 s3: Pass sconn explicitly to open_was_deferred 2011-08-02 19:18:08 +02:00
Volker Lendecke
04253dfd9f s3: Explicitly pass sconn to remove_deferred_open_message_smb 2011-08-02 19:18:08 +02:00