summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-1824-161/+181
| | | | | | | | | | 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>
* s3: Make us survive smb2.lock.rw-shared with aio enabledVolker Lendecke2012-07-131-1/+1
| | | | | | | | | | | | schedule_aio_smb2_write can return NT_STATUS_FILE_LOCK_CONFLICT. This is a valid error code that smb2.lock.rw-shared expects and checks for. The code before this patch maps this to NT_STATUS_FILE_CLOSED, masking the real, correct error message. Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 13 21:53:51 CEST 2012 on sn-devel-104
* s3-auth Remove unused global_machine_account_needs_changingAndrew Bartlett2012-07-131-5/+0
| | | | | | | | | | | | | | This boolean was only set if the old machine account store (with an MD4 hash in it) was returned. We have not set that password type for years. If this call ever worked, it would store a plaintext password, so we could only ever be here if we had set a password using a version of Samba so old as not to store plaintext, and then never honered the flag anyway. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Jul 13 07:52:40 CEST 2012 on sn-devel-104
* Set fsp->initial_allocation_size before calling open_file_ntcreate().Jeremy Allison2012-07-121-0/+5
| | | | | Allows an SMB_VFS_OPEN() vfs module to do something interesting with the request.
* Make sure we reset fsp->initial_allocation_size to zero if we didn't create ↵Jeremy Allison2012-07-121-0/+2
| | | | | | | the file. This will become important as we set fsp->initial_allocation_size before create.
* Add an optimization to pthread aio writes to also do fsync if requested.Jeremy Allison2012-07-122-0/+10
| | | | | Should help by ensuring complete writes done in sub-thread, not in the main thread.
* s3: Make us survive base-delaywrite with aio enabledVolker Lendecke2012-07-121-0/+4
| | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jul 12 21:28:19 CEST 2012 on sn-devel-104
* s3: Factor out "mark_file_modified"Volker Lendecke2012-07-122-25/+43
| | | | | | This is in preparation of making us survive base-delaywrite with async I/O activated Signed-off-by: Jeremy Allison <jra@samba.org>
* Cope with a (non-security) open race we've had for ever as NTCreateX isn't ↵Jeremy Allison2012-07-101-0/+25
| | | | | | | | | | | | | | | | 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
* Now we have a guaranteed indication of a file being created, use it to set ↵Jeremy Allison2012-07-101-12/+8
| | | | the create disposition correctly.
* Add function fd_open_atomic() which uses O_CREAT|O_EXCL to return a ↵Jeremy Allison2012-07-101-4/+107
| | | | guaranteed indication of creation of a new file.
* Simplify the logic in open_file() some more.Jeremy Allison2012-07-101-48/+36
| | | | | | | | | | 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
* Simplify the logic in open_file().Jeremy Allison2012-07-091-22/+15
| | | | | | 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.
* Make check_same_stat() and check_same_dev_ino() common functions.Jeremy Allison2012-07-092-31/+0
|
* Factor out check_same_dev_ino() from check_same_stat() so it can be called ↵Jeremy Allison2012-07-091-2/+15
| | | | separately.
* s3: evaluate MNT_QUOTA and MNT_RDONLY in statvfs also on darwinBjörn Jacke2012-07-051-1/+1
|
* s3: if we know a file is immutable, report it to be readonlyBjörn Jacke2012-07-041-0/+6
| | | | on *BSD we get the immutable flag via st_flags, we should use that if possible.
* s3-smbd: Remove deprecated 'share modes' option.Andreas Schneider2012-07-031-4/+0
|
* s3: Fix Coverity ID 709217 Dereference after null checkVolker Lendecke2012-07-031-2/+10
| | | | | | | | | | A few lines before we did check for x != NULL. I think this might fix a potential remote crash. Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Jul 3 15:30:17 CEST 2012 on sn-devel-104
* s3: Fix Coverity ID 709218 Uninitialized pointer readVolker Lendecke2012-07-031-0/+5
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbd: Include smbXsrv.h before vfs.h (in smbd.h) so that the smbXsrv ↵Michael Adam2012-07-031-1/+1
| | | | | | | | structures are available This is currently needed for files_struct and connection_struct that contain backlinks to smbXsrv_open and smbXsrv_tcon, respectively. Finally, these backlinks to the smb level structures should be removed.
* s3:smbd:smb2: fix prototype of make_connection_smb2() to use smbXsrv_tconMichael Adam2012-07-031-2/+1
| | | | instead of internal smbXsrv_tcon0.
* s3:smbd: include smbXsrv.h before smbd/proto.h to have the smbXsrv_ structs ↵Michael Adam2012-07-031-0/+1
| | | | available
* s3:smbd:smb2: change smbXsrv_tcon0 to smbXsrv_tcon in ↵Michael Adam2012-07-031-1/+1
| | | | | | | smbd_smb2_request_check_tcon() smbXsrv_tcon0 is the internal name for the (current) version0 of the structure. Externally, only smbXsrv_tcon should be used.
* s3:smbd:smb2: change smbXsrv_session0 to smbXsrv_session in struct user_struct.Michael Adam2012-07-031-1/+1
| | | | | smbXsrv_session0 is the internal name of (current) version 0 of the structure. Externally, only smbXsrv_session should be used.
* Don't allow asynchronous creates to be canceled in SMB2.Jeremy Allison2012-06-303-3/+20
| | | | | Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jun 30 04:10:02 CEST 2012 on sn-devel-104
* Make schedule_deferred_open_message_smb() return an indication of success.Jeremy Allison2012-06-302-5/+6
|
* Make schedule_deferred_open_message_smb2() return an indication of success.Jeremy Allison2012-06-302-7/+9
|
* Allow for async opens.Jeremy Allison2012-06-301-4/+35
| | | | | 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.
* Add new bool field async_open to struct deferred_open_record. Not used yet.Jeremy Allison2012-06-301-0/+4
|
* Fix defer_open() fuction in the open code path to cope with a NULL lck ↵Jeremy Allison2012-06-301-11/+16
| | | | parameter.
* Add uint64_t mid field to the files_struct.Jeremy Allison2012-06-301-0/+1
| | | | Ensure it is initialized so we know what mid created this file.
* s3:smbd: make use of smbXsrv_open for smb1/2/3Stefan Metzmacher2012-06-299-141/+73
| | | | | | | | | | | | This makes sure we generate unique persistent file ids, which are stored in smbXsrv_open_global.tdb. Pair-Programmed-With: Michael Adam <obnox@samba.org> metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jun 29 21:01:11 CEST 2012 on sn-devel-104
* s3:smbd: add smbXsrv_open* infrastructureStefan Metzmacher2012-06-293-0/+1099
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
* s3: fix the logic in bsd_statvfsBjörn Jacke2012-06-291-1/+1
|
* s3:smb2_server: remove max_charge check in ↵Stefan Metzmacher2012-06-291-16/+0
| | | | | | | | | | smbd_smb2_request_verify_creditcharge() The client can send any credit charge value, it's ok to send more than needed. metze Signed-off-by: Michael Adam <obnox@samba.org>
* s3: merge bsd_statvfs and darwin_statvfsBjörn Jacke2012-06-291-53/+31
|
* Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.Jeremy Allison2012-06-281-1/+2
| | | | | | Will allow thread-specific credentials to be added by modifying the central definitions. Deliberately left the setXX[ug]id() call in popt as this is not used in Samba.
* s3:smb2_server: make the logic in smbd_smb2_request_verify_creditcharge() ↵Stefan Metzmacher2012-06-291-11/+23
| | | | | | | | | simpler We just need a max_charge variable to make the algorithm independent of multi_credit support. metze
* s3:smb2_server: simplify smbd_smb2_request_verify_creditcharge() a bit.Stefan Metzmacher2012-06-291-6/+1
| | | | | | | A credit charge of 0 is really not a special case, it just means the same as 1. metze
* s3:smb2_negprot: support SMB2_CAP_LARGE_MTU on everything but port 139Stefan Metzmacher2012-06-291-5/+8
| | | | | | | In future we'll have other transports like RDMA. This makes NBT (tcp port 139) special instead of port 445. metze
* s3:smb2_server: grant extra credits for multi-credit requestsStefan Metzmacher2012-06-291-2/+10
| | | | metze
* s3:smb2_server: implement credit granting similar to windowsStefan Metzmacher2012-06-292-19/+53
| | | | | | This makes it much easier to compare traces. metze
* s3:smb2_server: make sure sequence numbers don't wrap at UINT64_MAXStefan Metzmacher2012-06-291-2/+17
| | | | metze
* s3:smb2_server: make sure we don't grant more credits than we allowStefan Metzmacher2012-06-292-35/+92
| | | | | | | | | If the client hasn't consumed the lowest seqnum, but the distance between lowest and highest seqnum has reached max credits. In that case we should stop granting credits. metze
* s3:smb2_server: check the credit_charge against the already granted creditsStefan Metzmacher2012-06-291-7/+12
| | | | metze
* s3:smb2_server: split out a smb2_validate_sequence_number() functionStefan Metzmacher2012-06-291-40/+77
| | | | metze
* s3:smb2_server: clear sequence window if we got the lowest sequence idStefan Metzmacher2012-06-291-2/+2
| | | | | | Otherwise we'll never consume sequence id '0'. metze
* s3:smb2_server: fix calculation of the next bitmap_offsetStefan Metzmacher2012-06-291-1/+1
| | | | metze
* s3:smb2_server: remove unused and confusing ↵Stefan Metzmacher2012-06-291-7/+4
| | | | | | DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR metze