summaryrefslogtreecommitdiffstats
path: root/source3/smbd/trans2.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug 7104 - "wide links" and "unix extensions" are incompatible.Jeremy Allison2010-02-151-37/+0
| | | | | | | | | | | | | | | | Change parameter "wide links" to default to "no". Ensure "wide links = no" if "unix extensions = yes" on a share. Fix man pages to refect this. Remove "within share" checks for a UNIX symlink set - even if widelinks = no. The server will not follow that link anyway. Correct DEBUG message in check_reduced_name() to add missing "\n" so it's really clear when a path is being denied as it's outside the enclosing share path. Jeremy. (cherry picked from commit 9e64c33b7757dd4528a9c8d31d0c0c159a33daf8)
* Second part of fix for 6875 - trans2 FIND_FIRST2 response --> FIND_FIRST2 ↵Jeremy Allison2009-12-231-10/+5
| | | | | | | | | Data -> Fille Attributes are returned as 0x220 for LANMAN2.1 dialect Ensure dos_mode can return FILE_ATTRIBUTE_NORMAL, then filter the returned attributes by protocol level. This makes us consistant in returning DOS attrs across all replies. Tested on OS/2 by Günter Kukkukk. Jeremy. (cherry picked from commit 22332e08ab5b406ca603576b29fcaf0c1f786708)
* Fix bug 6867 - trans2findnext returns reply_nterror(req, ntstatus) In a ↵Jeremy Allison2009-12-231-12/+16
| | | | | | directory with a lot of files. Jeremy. (cherry picked from commit a6e7be60322b981f9eb81f2b686d28223bd735bc)
* s3:smbd: Add a "hidden" parameter "share:fake_fscaps"Volker Lendecke2009-10-201-0/+3
| | | | | | | | | | | | | | | This is needed to support some special app I've just come across where I had to set the SPARSE_FILES bit (0x40) to make it work against Samba at all. There might be others to fake. This is definitely a "Don't touch if you don't know what you're doing" thing, so I decided to make this an undocumented parametric parameter. I know this sucks, so feel free to beat me up on this. But I don't think it will hurt. (cherry picked from commit a5cace128d1dcabd6cc90dda71a09dfa8ee8c6f6) Fix bug #6765. (cherry picked from commit af0c2b78f7b697fae0fae6f88a5c9922abc7c514)
* Fix bug 6529 - Offline files conflict with Vista and Office 2003. Jeremy.Jeremy Allison2009-10-201-58/+68
| | | | (cherry picked from commit e971428f137dcb42e8b735386d79f1b3a6effe34)
* Correctly implement SMB_INFO_STANDARD setfileinfo.Jeremy Allison2009-08-131-3/+3
| | | | | | | Fixes bug #6593. Jeremy. (cherry picked from commit c704e22806198a620d7e058c8d69c144ce096837)
* Fix bug #6520 time stamps - e.g. last mod time is not preserved when "unix ↵Jeremy Allison2009-07-021-3/+31
| | | | | | | | | | extensions=yes" are set - and using latest cifs vfs client Cancel out any pending "sticky" writes or "last write" changes when doing a UNIX info level set. Jeremy. (cherry picked from commit b971860e01a3e616b0dd21990c054c8f8356f513) (cherry picked from commit 3c8e5d5339ec246bca846aee48ecfba74c7d7c69)
* Fix bug #6487: Missing DFS call in trans2 mkdir call.Jeremy Allison2009-06-191-0/+15
| | | | (cherry picked from commit 1a0005e1c508cf3b170d1c7e43b94a47b2820506)
* Fix bug #6421 - POSIX read-only open fails on read-only shares.Jeremy Allison2009-06-021-5/+9
| | | | | | | | | | | The change to smbd/trans2.c opens up SETFILEINFO calls to POSIX_OPEN only. The change to first smbd/open.c closes 2 holes that would have been exposed by allowing POSIX_OPENS on readonly shares, and their ability to set arbitrary flags permutations. The O_CREAT -> O_CREAT|O_EXCL change removes an illegal combination (O_EXCL without O_CREAT) that previously was being passed down to the open syscall. Jeremy. (cherry picked from commit d49ae9c87d182f32702a0b6a1cc2a2038f31d81d)
* Ensure we return NT_STATUS_FILE_IS_A_DIRECTORY on a posix open on aJeremy Allison2009-05-261-1/+1
| | | | | | directory name. Jeremy. (cherry picked from commit 689664ad7acf13b07409abd4c2820dbe10255b68)
* s3: Always allocate memory in dptr_ReadDirNameAravind Srinivasan2009-05-261-4/+18
| | | | | | | | | This is a follow up to 69d61453df6019caef4e7960fa78c6a3c51f3d2a to adjust the API to allow the lower layers allocate memory. Now the memory can explicitly be freed rather than relying on talloc_tos(). Signed-off-by: Tim Prouty <tprouty@samba.org> (cherry picked from commit bfe7383d7f0349fec796d04772d42d566f7f083b)
* Ensure we never enter VFS_CREATE without having initializedJeremy Allison2009-04-151-0/+2
| | | | | | | | sbuf as invalid (if not already read via stat()). Still trying to find the build farm RAW-STREAM errors and it's happening in a openX call.... Jeremy. (cherry picked from commit 940c84fcc75085ee4f1180d4d2a8e718142e4eb6)
* Make test for open modes more robust against other bits.Jeremy Allison2009-02-251-1/+1
| | | | Jeremy.
* Fix bug in processing of open modes in POSIX open.Jeremy Allison2009-02-251-0/+2
| | | | | | | Was missing case of "If file exists open. If file doesn't exist error." Damn damn damn. CIFSFS client will have to have fallback cases for this error for a long time. Jeremy.
* Allow set attributes on a stream fnum to be redirected to the base filename.Jeremy Allison2009-02-241-2/+10
| | | | | Fixes the new RAW-STREAMS torture test. Jeremy.
* Add VFS ops for Windows BRL: Lock, Unlock and Cancel:Zack Kirsch2009-02-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS, BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically: * I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to *_default as the default implementations of the VFS ops. * The blocking_lock_record (BLR) is now passed into the brl_lock_windows and brl_cancel_windows paths. The Onefs implementation uses it - future implementations may find it useful too. * Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a lock_struct and call either the Posix or Windows lock function. These happen to be the same for the default implementation. * Added helper functions: increment_current_lock_count() and decrement_current_lock_count(). * Minor spelling correction in brl_timeout_fn: brl -> blr. * Changed blocking_lock_cancel() to return the BLR that it has cancelled. This allows us to assert its the lock that we wanted to cancel. If this assert ever fires, this path will need to take in the BLR to cancel, rather than choosing on its own. * Adds a small helper function: find_blocking_lock_record_by_id(). Used by the OneFS implementation, but could be useful for others.
* s3: Added SMB_VFS_INIT_SEARCH_OP to initialize data at the beginning of SMB ↵Steven Danneman2009-02-091-3/+9
| | | | | | | | search requests. By default this VFS call is a NOOP, but the onefs vfs module takes advantage of it to initialize direntry search caches at the beginning of each TRANS2_FIND_FIRST, TRANS2_FIND_NEXT, SMBffirst, SMBsearch, and SMBunique
* S3: New module interface for SMB message statistics gatheringtodd stecher2009-02-091-1/+4
| | | | | | | This changelist allows for the addition of custom performance monitoring modules through smb.conf. Entrypoints in the main message processing code have been added to capture the command, subop, ioctl, identity and message size statistics.
* s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty2009-01-291-39/+13
| | | | | This allows module implementors to customize what allocation size is returned to the client.
* Extend NTIMES to allow setting create_timetodd stecher2009-01-231-40/+59
| | | | | | | | | 1) Add in smb_file_time struct to clarify code and make room for createtime. 2) Get and set create time from SMB messages. 3) Fixup existing VFS modules + examples Some OS'es allow for the setting of the birthtime through kernel interfaces. This value is generically used for Windows createtime, but is not settable in the code today.
* s3: make better use of ccache by not including version.h in every C-file.Michael Adam2009-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | version.h changes rather frequently. Since it is included via includes.h, this means each C file will be a cache miss. This applies to the following situations: * When building a new package with a new Samba version * building in a git branch after calling mkversion.sh after a new commit (i.e. virtually always) This patch improves the situation in the following way: * remove inlude "version.h" from includes.h * Use samba_version_string() instead of SAMBA_VERSION_STRING in files that use no other macro from version.h instead of SAMBA_VERSION_STRING. * explicitly include "version.h" in those files that use more macros from "version.h" than just SAMBA_VERSION_STRING. Michael
* s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher2009-01-081-3/+1
| | | | | | The goal is to move all this variables into a big context structure. metze
* s3:smbd: make static const in mangle_hash2.c really static constStefan Metzmacher2009-01-081-1/+1
| | | | | | | | | | | | | const char *foo, means a non-const pointer to a const char. const char * const foo, means a const pointer to a const char. char * const foo, would mean a const pointer to a non-const char. metze
* Add iconv_convenience argument to size functions.Jelmer Vernooij2009-01-011-0/+2
|
* Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke2008-12-311-2/+1
|
* Use parent_dirname_talloc instead of parent_dirname in smb_unix_mknodVolker Lendecke2008-12-311-3/+7
|
* s3: Fix stream marshalling to return the correct streaminfo statusTim Prouty2008-12-231-10/+1
| | | | | | | | | | | | | | | | When there are enough streams on a file to fill up the max_data_count when responding to a trans2 streaminfo, samba is returning NT_STATUS_BUFFER_TOO_SMALL. Windows handles this by returning NT_STATUS_BUFFER_OVERFLOW while still sending as much of the data that it can fit into the buffer. When the windows client sees BUFFER_OVERFLOW, it retries the streaminfo with a larger buffer (2x). The windows client starts at 2K and will continue increasing the buffer size by two until it reaches 64K. If the streams don't fit in 64K the windows client seems to give up. This patch fixes marshall_stream_info to overfill the buffer by 1 stream so that send_trans2_replies can properly detect the overflow and return the correct status.
* Fix bug #5986 - Editing a stream is broken (rename problems).Jeremy Allison2008-12-191-10/+11
| | | | Jeremy.
* Fix bug #5937 - filenames with "*" char hide other filesJeremy Allison2008-12-041-6/+4
| | | | Jeremy.
* s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argumentTim Prouty2008-12-031-6/+6
| | | | | | This replaces the is_dos_path bool with a more future-proof argument. The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead of overridding the oplock_request.
* s3: Modify direct callers of open_file_ntcreate and open_directory to call ↵Tim Prouty2008-12-031-61/+98
| | | | SMB_VFS_CREATE_FILE
* s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILETim Prouty2008-12-031-0/+1
| | | | | Now unix paths can be differentiated from windows paths so the underlying create_file implementations can convert paths correctly.
* s3: Add SMB_VFS_CREATE_FILE to the vfs layerTim Prouty2008-12-031-16/+17
| | | | Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
* s3:smbd: write times should be set on the base file instead of the stream nameStefan Metzmacher2008-12-011-1/+9
| | | | metze
* s3:smbd: return DELETE_PENDING on path based operations on streams, when the ↵Stefan Metzmacher2008-12-011-0/+40
| | | | | | main file was deleted. metze
* s3:smbd: construct the correct newname for stream renamesStefan Metzmacher2008-12-011-16/+32
| | | | | | | | The Windows Explorer creates temporary streams and renames them later via SFILEINFO_RENAME_INFO. The newname comes in as ":Stream:$DATA". metze
* Fix a debug message, append the correct \nVolker Lendecke2008-12-011-1/+1
|
* Remove inbuf references from the trans2ioctl codeVolker Lendecke2008-11-281-4/+4
|
* Consolidate the buffer checks for the reply_trans style functionsVolker Lendecke2008-11-281-57/+18
| | | | | | | | This is the one where I found the problem that led to 3.2.5. So if there is one checkin in the last year that I would like others to review and *understand*, it is this one :-) Volker
* Remove an unused variableVolker Lendecke2008-11-281-2/+0
|
* Fix the offset checks in the trans routinesVolker Lendecke2008-11-271-3/+3
| | | | | | | | | This fixes a potential crash bug, a client can make us read memory we should not read. Luckily I got the disp checks right... Volker (cherry picked from commit 64a1d80851da5b05e70ec6c96f6e9bd473748369) (cherry picked from commit f04c5650a3aeca23591ddc781c4b297caaf9bb3f)
* Do not write into inbuf for the transs requestVolker Lendecke2008-11-081-6/+6
| | | | | Instead, fix up the outbuf in send_xx_reply. In those routines, we know what we are returning.
* Fix a const warningVolker Lendecke2008-11-041-1/+1
|
* Remove some inbuf references by adding "cmd" to smb_requestVolker Lendecke2008-11-021-3/+3
|
* Use "vwv" in trans parsingVolker Lendecke2008-11-021-21/+21
|
* Remove a bunch of direct inbuf references by adding "vwv" to smb_requestVolker Lendecke2008-11-021-5/+5
|
* Get closer to passing S4 RAW-ACLs.Jeremy Allison2008-10-311-3/+6
| | | | Jeremy.
* Cope with bad trans2mkdir requests from System i QNTC IBM SMB client.Jeremy Allison2008-10-161-3/+4
| | | | | | | | If total_data == 4 Windows doesn't care what values are placed in that field, it just ignores them. The System i QNTC IBM SMB client puts bad values here, so ignore them. Jeremy.
* Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij2008-10-141-57/+57
|
* Use "struct files_struct" for pipes instead of smb_np_structVolker Lendecke2008-10-131-3/+3
|