summaryrefslogtreecommitdiff
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
* s3: rename talloc_sub_advanced() to talloc_sub_full()Ralph Boehme2019-11-072-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have the following substitution functions: talloc_sub_basic() talloc_sub_advanced() talloc_sub_basic() currently substitutes a subset of talloc_sub_advanced(). We'll need a function X that only substitutes what talloc_sub_advanced() substitutes *without* what talloc_sub_basic() does. To get there rename talloc_sub_advanced() to talloc_sub_full(). A subsequent commit will then bring back talloc_sub_advanced() as described above. Examples with fictional replacement letters A and B. Currently: talloc_sub_basic: A talloc_sub_advanced: AB New: talloc_sub_basic: A talloc_sub_advanced: B talloc_sub_full: AB BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Use file_id_str_buf() in rename_open_files()Volker Lendecke2019-11-061-7/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in contend_level2_oplocks_begin_default()Volker Lendecke2019-11-061-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in process_kernel_oplock_break()Volker Lendecke2019-11-061-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in process_oplock_break_message()Volker Lendecke2019-11-061-7/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in initial_break_processing()Volker Lendecke2019-11-061-9/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in downgrade_lease()Volker Lendecke2019-11-061-8/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in downgrade_oplock()Volker Lendecke2019-11-061-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in set_file_oplock()Volker Lendecke2019-11-061-2/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in set_file_oplock()Volker Lendecke2019-11-061-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove #define serverid_equal server_id_equalVolker Lendecke2019-11-063-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: SMB1 UNIX extensions - remove dead code.Jeremy Allison2019-11-061-13/+0
| | | | | | | | | | We no longer set delete_on_fail on return from mknod. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 6 19:31:00 UTC 2019 on sn-devel-184
* s3: smbd: SMB1 UNIX extensions - POSIX mknod should just create the object, ↵Jeremy Allison2019-11-061-34/+1
| | | | | | | not change attributes after. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: SMB1 UNIX extensions - only allow size change on regular file.Jeremy Allison2019-11-061-8/+10
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* 3: smbd: SMB1 UNIX extensions - For POSIX mknod we can only create ↵Jeremy Allison2019-11-061-0/+5
| | | | | | | | | blk/chr/fifo/sock objects. Fail requests to create other object types. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: SMB1 UNIX extensions - Ensure POSIX mknod is root-only.Jeremy Allison2019-11-061-0/+7
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* source3/smbd/reply.c: typo fixesBjörn Jacke2019-10-311-3/+3
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* s3:smb2_server: add message mid to SMB2 request done log messageRalph Boehme2019-10-301-2/+7
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 30 18:42:35 UTC 2019 on sn-devel-184
* s3:smb2_server: modernize a debug statementRalph Boehme2019-10-301-5/+6
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Save 520 bytes of writable memory from every smbdVolker Lendecke2019-10-231-3/+3
| | | | | | | | | | Move what can be const from the "data" to the "text" segment Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Oct 23 02:37:12 UTC 2019 on sn-devel-184
* smbd: Remove an unused #define from mangle_hash2.cVolker Lendecke2019-10-231-5/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* smbd: Mark #else/#endif with the if-#defineVolker Lendecke2019-10-231-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* s3:smbd: Add header inclusion guards in globals.hSamuel Cabrero2019-10-181-0/+5
| | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: VFS: Complete the removal of SMB_VFS_CHOWN()Jeremy Allison2019-10-151-9/+0
| | | | | | | | | | No longer used anywhere. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 15 20:07:51 UTC 2019 on sn-devel-184
* s3: pysmbd: Change py_smbd_chown() to use SMB_VFS_FCHOWN() internally.Jeremy Allison2019-10-151-13/+33
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s3: smbd: Remove vfs_chown_fsp().Jeremy Allison2019-10-152-122/+0
| | | | | | | | | No longer used. This gets rid of another case where we were playing directory changing games that are eliminated by just using a file handle. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s3: smbd: set_nt_acl(). Now we know we always have a valid file handle, ↵Jeremy Allison2019-10-151-5/+14
| | | | | | | always use VFS_FCHOWN. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s3: VFS: Complete the removal of SMB_VFS_RMDIR()Jeremy Allison2019-10-101-7/+0
| | | | | | | | | | All users now use SMB_VFS_UNLINKAT(..., AT_REMOVEDIR). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Oct 10 07:26:43 UTC 2019 on sn-devel-184
* s3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in rmdir cases.Jeremy Allison2019-10-101-4/+14
| | | | | | | | | Use conn->cwd_fsp as current fsp. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change recursive_rmdir() to call SMB_VFS_UNLINKAT() in rmdir case.Jeremy Allison2019-10-101-1/+5
| | | | | | | | | Use conn->cwd_fsp as current fsp. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Use SMB_VFS_FCNTL to set fd flags in open_file()Anoop C S2019-10-083-1/+33
| | | | | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Oct 8 09:57:19 UTC 2019 on sn-devel-184
* s3: VFS: Add SMB_VFS_FCNTLAnoop C S2019-10-081-0/+15
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Fix the SMB2 server to pass SMB2-PATH-SLASH.Jeremy Allison2019-10-021-0/+45
| | | | | | | | | | | | | | | | | | | | [MS-FSA] 2.1.5.1 Server Requests an Open of a File Windows pathname specific processing. Always disallow trailing /, and also \\ on FILE_NON_DIRECTORY_FILE. We need to check this before the generic pathname parser as the generic pathname parser removes any trailing '/' and '\\'. Currently this is SMB2 only, but we could also add this check to the SMB1 NTCreateX calls if ultimately neded. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Oct 2 09:31:40 UTC 2019 on sn-devel-184
* s3:smbd: use is_named_stream() in a a few placesRalph Boehme2019-10-021-7/+2
| | | | | | | | This simplifies (and corrects) things in the VFS as there the caller is only interested in whether a name is pointing to a real named stream most of the times. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: add a comment explaining the File-ID semantics when a file is createdRalph Boehme2019-10-021-0/+9
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: ensure a created stream picks up the File-ID from the basefileRalph Boehme2019-10-021-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: when storing DOS attribute call dos_mode() beforehandRalph Boehme2019-10-021-0/+1
| | | | | | | | | | This is required to ensure File-ID info is populated with the correct on-disk value, before calling file_set_dosmode() which will update the on-disk value. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: change the place where we call dos_mode() when processing SMB2_CREATERalph Boehme2019-10-021-2/+3
| | | | | | | | | | | This is needed for ordinary file or directory opens so the QFID create context response gets the correct File-ID value via dos_mode() from the DOS attributes xattr. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: VFS: Complete the replacement of SMB_VFS_UNLINK() -> SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-7/+0
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Sep 26 18:40:53 UTC 2019 on sn-devel-184
* s3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in 2 places.Jeremy Allison2019-09-261-3/+12
| | | | | | | | | Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change recursive_rmdir() to call SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-2/+9
| | | | | | | | | Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change close_remove_share_mode() to call SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-1/+6
| | | | | | | | | Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change delete_all_streams() to call SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-1/+4
| | | | | | | | | Use conn->cwd_fsp as current fsp. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change smb_set_file_unix_basic() to call SMB_VFS_UNLINKAT() in 3 ↵Jeremy Allison2019-09-261-3/+12
| | | | | | | | | | | | places. Use conn->cwd_fsp as current fsp. This is horrible code and must be removed. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: pysmbd: Change py_smbd_unlink() to call SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-1/+4
| | | | | | | | | Use conn->cwd_fsp as current fsp. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change remove_msdfs_link() to call SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-1/+6
| | | | | | | | | Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change create_msdfs_link() to call SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-1/+5
| | | | | | | | | Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Add SMB_VFS_UNLINKAT().Jeremy Allison2019-09-261-0/+12
| | | | | | | | | | Currently identical to SMB_VFS_UNLINK(). Next, add to all VFS modules that implement unlink and eventually remove unlink. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: Add an error return END_PROFILE callVolker Lendecke2019-09-231-0/+1
| | | | | | | | | | All other return; statements in reply_tcon_and_X have this 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): Mon Sep 23 17:06:25 UTC 2019 on sn-devel-184
* smbd: Don't always walk the share mode array in open_mode_check()Volker Lendecke2019-09-181-17/+200
| | | | | | | | | | | | | | | | | | share_mode_data->flags contains the "most restrictive" share mode of the whole array. This is maintained lazily: Whenever set_share_mode() is called, d->flags is updated if the new share mode got more restrictive. It is not updated when a file is closed, as this would mean we would have to walk the whole array, making sure that the closed handle was indeed the only most restrictive one. Instead, we walk the share mode array only when a conflict happens: Then we need to know "the truth" and recalculate it by walking the share mode array. 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 Sep 18 00:07:13 UTC 2019 on sn-devel-184