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

553 Commits

Author SHA1 Message Date
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
Volker Lendecke
190b5432f0 s3: Make map_open_params_to_ntcreate() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
0102c6e2bc s3: Make is_executable() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
6d67d41444 s3: We only need base_name in map_open_params_to_ntcreate 2011-07-29 16:43:17 +02:00
Andrew Bartlett
9289537993 s3-auth Use struct auth_user_info_unix for unix_name and sanitized_username
This is closer to the layout of struct auth_session_info in auth.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Stefan Metzmacher
896f105ed4 s3:smbd: check the share level access mask in smbd_calculate_access_mask()
I think we should reject invalid access early,
before we might create new files.

Also smbd_check_open_rights() is only called if the file existed.

metze
2011-07-11 21:33:20 +02:00
Stefan Metzmacher
ce66d4e4a8 s3:smbd: make smbd_calculate_access_mask() non-static
metze
2011-07-11 21:23:08 +02:00
Volker Lendecke
4deca5d728 s3: Fix bug 8102
We can't allow open with access that has been denied via the share
security descriptor

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

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul  5 16:21:54 CEST 2011 on sn-devel-104
2011-07-05 16:21:53 +02:00
Jeremy Allison
5d7d52ceea Fix bug #8254 - "acl check permissions = no" does not work in all cases
Move lp_acl_check_permissions() into can_delete_file_in_directory()
where it makes sense. Remove ACL check when requesting DELETE_ACCESS
when lp_acl_check_permissions is false.

Thanks to John Janosik @ IBM for noticing this.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jun 24 01:18:11 CEST 2011 on sn-devel-104
2011-06-24 01:18:11 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Jeremy Allison
19213b83d6 Ensure when creating a directory, if we make any changes due to inheritance parameters, we update the stat returned.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jun  9 00:46:39 CEST 2011 on sn-devel-104
2011-06-09 00:46:38 +02:00
Jeremy Allison
c6bc1eeb7b Part 4 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
We don't need to check mode bits as well as dev/ino to
ensure we're in the same place.
2011-06-08 14:26:02 -07:00
Jeremy Allison
5fb27814ad Part 3 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
When changing ownership on a new file make sure we
must have a valid stat struct before making the inheritance
calls (as they may look at it), and if we make changes we
must have a valid stat struct after them.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun  8 03:07:04 CEST 2011 on sn-devel-104
2011-06-08 03:07:04 +02:00
Jeremy Allison
40c54a736d Part 2 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
When changing ownership on a new file make sure we
also change the returned stat struct to have the correct uid.
2011-06-07 16:48:14 -07:00
Jeremy Allison
cabed2fb17 Part 1 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
When changing ownership on a new directory make sure we
also change the returned stat struct to have the correct uid.
2011-06-07 16:42:02 -07:00
Jeremy Allison
febde0de54 Move fd_close on error path to be identical to all other error paths.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun  1 22:30:03 CEST 2011 on sn-devel-104
2011-06-01 22:30:03 +02:00
Jeremy Allison
61e8c5949a TALLOC_FREE already checks for null. 2011-06-01 12:12:26 -07:00
Jeremy Allison
5a2b5b6cfe Fix bug #8175 - smbd deadlock.
Force the open operation (which is the expensive one anyway) to
acquire and release locks in a way compatible with the more common
do_lock check.

Jeremy.
2011-06-01 12:11:53 -07:00
Jeremy Allison
8cf14c21b3 Fix the SMB2 showstopper, found by an extended torture test from Volker.
In the oplock refactoring, the algorithm underwent an unnoticed change.
In 3.5.x stat_opens were silently (i.e. no explicit code had comments
explaining this) ignored when looking for oplock breaks and share mode
violations. After the refactoring, the function find_oplock_types()
no longer ignored stat_open entries in the share mode table when looking
for batch and exclusive oplocks. This patch adds two changes to find_oplock_types()
to ignore the case where the incoming open request is a stat open being
tested against existing opens, and also when the incoming open request
is a non-stat open being tested against existing stat opens. Neither
of these cause an oplock break or share mode violation. Thanks a *lot*
to Volker, who persevered in reproducing this problem.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon May 16 22:38:20 CEST 2011 on sn-devel-104
2011-05-16 22:38:20 +02:00
Jeremy Allison
fe21bdc43c Ensure we always write the correct incoming mid into the share mode
table entries.
2011-05-16 10:41:51 -07:00
Andrew Bartlett
0520da2bbe s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
0eca33bbf6 s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00