summaryrefslogtreecommitdiffstats
path: root/source3/smbd/open.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: Pass sconn explicitly to open_was_deferredVolker Lendecke2011-08-021-1/+1
|
* s3: Explicitly pass sconn to remove_deferred_open_message_smbVolker Lendecke2011-08-021-1/+1
|
* s3: Make map_open_params_to_ntcreate() available in lib/Volker Lendecke2011-07-291-147/+0
|
* s3: Make is_executable() available in lib/Volker Lendecke2011-07-291-17/+0
|
* s3: We only need base_name in map_open_params_to_ntcreateVolker Lendecke2011-07-291-4/+4
|
* s3-auth Use struct auth_user_info_unix for unix_name and sanitized_usernameAndrew Bartlett2011-07-201-1/+1
| | | | | | | | This is closer to the layout of struct auth_session_info in auth.idl Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3:smbd: check the share level access mask in smbd_calculate_access_mask()Stefan Metzmacher2011-07-111-0/+17
| | | | | | | | | 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
* s3:smbd: make smbd_calculate_access_mask() non-staticStefan Metzmacher2011-07-111-14/+15
| | | | metze
* s3: Fix bug 8102Volker Lendecke2011-07-051-0/+8
| | | | | | | | | | 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
* Fix bug #8254 - "acl check permissions = no" does not work in all casesJeremy Allison2011-06-241-2/+11
| | | | | | | | | | | 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
* s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett2011-06-091-2/+2
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
* Ensure when creating a directory, if we make any changes due to inheritance ↵Jeremy Allison2011-06-091-0/+12
| | | | | | | 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
* Part 4 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison2011-06-081-3/+2
| | | | | | | 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.
* Part 3 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison2011-06-081-17/+43
| | | | | | | | | | | | 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
* Part 2 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison2011-06-071-0/+2
| | | | | | | 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.
* Part 1 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison2011-06-071-0/+2
| | | | | | | 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.
* Move fd_close on error path to be identical to all other error paths.Jeremy Allison2011-06-011-2/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Jun 1 22:30:03 CEST 2011 on sn-devel-104
* TALLOC_FREE already checks for null.Jeremy Allison2011-06-011-3/+1
|
* Fix bug #8175 - smbd deadlock.Jeremy Allison2011-06-011-27/+71
| | | | | | | | 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.
* Fix the SMB2 showstopper, found by an extended torture test from Volker.Jeremy Allison2011-05-161-3/+25
| | | | | | | | | | | | | | | | | 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
* Ensure we always write the correct incoming mid into the share modeJeremy Allison2011-05-161-2/+4
| | | | table entries.
* s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCHAndrew Bartlett2011-04-291-3/+3
| | | | | | This means we use just one constant for this file attribute. Andrew Bartlett
* s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIRAndrew Bartlett2011-04-291-2/+2
| | | | | | This means we use just one constant for this file attribute. Andrew Bartlett
* Ensure vfs_chown_fsp() is safe against races.Jeremy Allison2011-04-151-1/+1
|
* Ensure change_dir_owner_to_parent() can't be raced.Jeremy Allison2011-04-141-1/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Apr 14 23:39:55 CEST 2011 on sn-devel-104
* Optimization for change_file_owner_to_parent() and change_dir_owner_to_parent()Jeremy Allison2011-04-141-0/+21
| | | | Don't do the chown if the owner is already correct.
* Don't print "success" message after error message in ↵Jeremy Allison2011-04-131-9/+8
| | | | change_file_owner_to_parent(). Remove "goto" in change_dir_owner_to_parent().
* Subtle change. Microsoft SMB2 tests return different access mask than for ↵Jeremy Allison2011-04-081-1/+12
| | | | SMB1 with raw.acls.
* s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner2011-03-301-1/+0
| | | | Guenther
* s3-messages: only include messages.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-auth: smbd needs auth.hGünther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3:smbd: access checks should not depend on share mode flagsStefan Metzmacher2011-03-211-1/+0
| | | | metze
* s3: Fix some nonempty blank linesVolker Lendecke2011-02-271-10/+9
|
* Ensure we don't return an incorrect access mask.Jeremy Allison2011-02-251-1/+2
| | | | | | | | | | From the Microsoft test suite @ Connectathon: Test Case: TestSuite_ScenarioNo009GrantedAccessTestS0 File created with access = 0x7 (Read, Write, Delete) Query Info on file returns 0x87 (Read, Write, Delete, Read Attributes) Jeremy.
* Batch oplocks conflict with exclusive as well as themselves.Jeremy Allison2011-02-241-1/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Feb 24 21:44:50 CET 2011 on sn-devel-104
* Remember to free the second temporary string.Jeremy Allison2011-02-241-0/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Feb 24 04:17:49 CET 2011 on sn-devel-104
* Fix bug 7950 - Samba 3.5.x fails BASE-CREATEX_SHAREMODES_DIR smbtorture4 testJeremy Allison2011-02-231-6/+16
| | | | | | We need to revalidate the pathname once re-constructed from a root fsp. Jeremy.
* s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_infoAndrew Bartlett2011-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | These variables, of type struct auth_serversupplied_info were poorly named when added into 2001, and in good consistant practice, this has extended all over the codebase in the years since. The structure is also not ideal for it's current purpose. Originally intended to convey the results of the authentication modules, it really describes all the essential attributes of a session. This rename will reduce the volume of a future patch to replaced these with a struct auth_session_info, with auth_serversupplied_info confined to the lower levels of the auth subsystem, and then eliminated. (The new structure will be the output of create_local_token(), and the change in struct definition will ensure that this is always run, populating local groups and privileges). Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Oops. Need to test for if(!NT_STATUS_IS_OK(..)) for error.Jeremy Allison2011-02-091-1/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Feb 9 22:06:05 CET 2011 on sn-devel-104
* Move to opening an fd on directory opens. Get more careful about symlink races.Jeremy Allison2011-02-091-1/+37
|
* Remove unneeded stat call.Jeremy Allison2011-02-091-9/+4
|
* Pass fsp to dptr_CloseDir(). Cope with setting the fd if we're closing an fd ↵Jeremy Allison2011-02-081-0/+3
| | | | that opendir knows about.
* If possible (O_DIRECTORY exists) open an fd for a directory open.Jeremy Allison2011-02-081-0/+15
| | | | | | | | | | | Start of the move towards handle-based code for directory access. Currently makes fstat/fchown code work for directories rather than falling back to pathnames. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Feb 8 06:34:41 CET 2011 on sn-devel-104
* Fix leak in error path.Jeremy Allison2011-02-071-0/+1
|
* Move the "oplock file with byte range locks" check to the correct place, ↵Jeremy Allison2011-02-051-0/+15
| | | | | | | where we're making oplock decisions. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Feb 5 01:18:14 CET 2011 on sn-devel-104
* Based on a conversation with Volker, refactor some of the oplock code to ↵Jeremy Allison2011-02-021-71/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | make it comprehensible. delay_for_oplocks() did 4 things. 1). Validation of existing oplock types. 2). Check for compatibility with batch oplocks (pass 1). 3). Check for compatibility with exclusive oplocks (pass 2). 4). Set the correct oplock type from the requested value. Refactor into 4 separate functions: 1). find_oplock_types() - does validation of oplock types and returns pointers to specific values. 2). delay_for_batch_oplocks() - the pass 1 phase above. 3). delay_for_exclusive_oplocks() - the pass 2 phase above 4). grant_fsp_oplock_type() - Set the correct oplock type from the requested value. Now separated out this code should be much easier to understand and modify. This also fixes an erroneous SMB_ASSERT which was hidden by the previous complexity of the single delay_for_oplocks() code. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Feb 2 01:52:21 CET 2011 on sn-devel-104
* Fix bug #7928 - Samba problems with kernel oplocks option set to "no"Pavel Shilovsky2011-01-311-1/+4
| | | | | We should not grant levelII oplocks on a file with existing byte range locks.
* Fix bug #7863 - Unlink may unlink wrong file when hardlinks are involved.Jeremy Allison2011-01-251-4/+8
| | | | | | Do this by keeping a linked list of delete on close tokens, one for each filename that identifies a path to the dev/inode. Use the jenkins hash of the pathname to identify the correct token.