summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
AgeCommit message (Collapse)AuthorFilesLines
2009-05-24TALLOC_FREE happily lives with a NULL ptr. Tim, please check!Volker Lendecke1-6/+2
Thanks, Volker
2009-05-20s3: Change unix_convert (and its callers) to use struct smb_filenameTim Prouty1-36/+54
This is the first of a series of patches that change path based operations to operate on a struct smb_filename instead of a char *. This same concept already exists in source4. My goals for this series of patches are to eventually: 1) Solve the stream vs. posix filename that contains a colon ambiguity that currently exists. 2) Make unix_convert the only function that parses the stream name. 3) Clean up the unix_convert API. 4) Change all path based vfs operation to take a struct smb_filename. 5) Make is_ntfs_stream_name() a constant operation that can simply check the state of struct smb_filename rather than re-parse the filename. 6) Eliminate the need for split_ntfs_stream_name() to exist. My strategy is to start from the inside at unix_convert() and work my way out through the vfs layer, call by call. This first patch does just that, by changing unix_convert and all of its callers to operate on struct smb_filename. Since this is such a large change, I plan on pushing the patches in phases, where each phase keeps full compatibility and passes make test. The API of unix_convert has been simplified from: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, bool allow_wcard_last_component, char **pp_conv_path, char **pp_saved_last_component, SMB_STRUCT_STAT *pst) to: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, struct smb_filename *smb_fname, uint32_t ucf_flags) Currently the smb_filename struct looks like: struct smb_filename { char *base_name; char *stream_name; char *original_lcomp; SMB_STRUCT_STAT st; }; One key point here is the decision to break up the base_name and stream_name. I have introduced a helper function called get_full_smb_filename() that takes an smb_filename struct and allocates the full_name. I changed the callers of unix_convert() to subsequently call get_full_smb_filename() for the time being, but I plan to eventually eliminate get_full_smb_filename().
2009-03-25Ensure we never enter VFS_CREATE without having initializedJeremy Allison1-0/+4
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.
2009-03-23s3:smbd: use new simplified snb_signing code in the serverStefan Metzmacher1-1/+2
We keep the seqnum/mid mapping in the smb_request structure. This also moves one global variable into the smbd_server_connection struct. metze
2009-03-06s3:signing: the seqnum should only be decremented by 1 for ntcancel requestsStefan Metzmacher1-1/+1
[MS-SMB] 3.3.5.1 Receiving Any Message says that the seqnum is incremented by only for ntcancel requests for any other request it's by incremented by 2, even if it doesn't expect a response. metze
2009-02-19s3: Add extid to the dev/inode pairTim Prouty1-0/+2
This extends the file_id struct to add an additional generic uint64_t field: extid. For backwards compatibility with dev/inodes stored in xattr_tdbs and acl_tdbs, the ext id is ignored for these databases. This patch should cause no functional change on systems that don't use SMB_VFS_FILE_ID_CREATE to set the extid. Existing code that uses the smb_share_mode library will need to be updated to be compatibile with the new extid.
2009-02-09S3: New module interface for SMB message statistics gatheringtodd stecher1-1/+7
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.
2009-01-29s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty1-2/+2
This allows module implementors to customize what allocation size is returned to the client.
2009-01-20Remove some smb fsp knowledge from rpc_server/Volker Lendecke1-1/+1
np_open/read/write don't have to know about files_struct
2009-01-11s3: Differentiate between posix files with colons and actual streamsTim Prouty1-2/+34
It is possible for a posix file created locally or over nfs to have a ":" in the name. Since ":" is a reserved character in windows, filenames containing a colon must be mangled in a directory listing. Right now files containing colons will not even be displayed in directory listings if streams modules are in use. During the directory listing the file will be detected as a stream because of the colon, but the streams module will fail to find the stream since it doesn't exist. This fix adds a step to is_ntfs_stream_name that stats the filename to differentiate between actual streams and files containing colons. While this is an improvement, it isn't perfect. Consider the case where there is a file on disk called "a.txt:s1" and also a file called "a.txt" that has a stream called "s1". This patch will always preference "a.txt:s1" over a.txt's s1 stream. The real issue is that at the vfs level, the vfs modules have no way to tell between a demangled name with a colon and an actual stream. A more invasive, but better, long-term fix would be to add all paths that come over the wire into a struct containing metadata about the path. This metadata could include a flag to indicate whether the path came over the wire with a colon ":" (guaranteeing that the client is requesting a stream). Passing this struct down to the lower levels, including all path-based vfs calls, would allow the above case to be handled correctly in all cases.
2009-01-08s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher1-4/+3
The goal is to move all this variables into a big context structure. metze
2009-01-05Fix call to ndr_size_dom_sid, missing parameter.Jeremy Allison1-1/+1
Jeremy.
2009-01-05Merge branch 'master' of ssh://git.samba.org/data/git/sambaJelmer Vernooij1-7/+7
2009-01-04s3: Allow renames of streams via NTRENAME and fix stream error codes on renameTim Prouty1-7/+7
The test_streams_rename2 test in RAW-STREAMS verifies these changes
2009-01-01Add iconv_convenience argument to size functions.Jelmer Vernooij1-1/+1
2008-12-31Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke1-1/+1
2008-12-31Use parent_dirname_talloc instead of parent_dirname in copy_internalsVolker Lendecke1-2/+6
2008-12-03s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argumentTim Prouty1-4/+4
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.
2008-12-03s3: Modify direct callers of open_file_ntcreate and open_directory to call ↵Tim Prouty1-16/+38
SMB_VFS_CREATE_FILE
2008-12-03s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILETim Prouty1-0/+2
Now unix paths can be differentiated from windows paths so the underlying create_file implementations can convert paths correctly.
2008-12-03s3: Add SMB_VFS_CREATE_FILE to the vfs layerTim Prouty1-8/+34
Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
2008-11-30Set PRESENT flag when returning NULL [SD]ACL like Windows does.Steven Danneman1-1/+9
This could also be handled inside each ACL VFS module, by setting the PRESENT flag when a NULL [SD]ACL is created.
2008-11-28Remove "conn" parameter from np_open, smb_request contains itVolker Lendecke1-1/+1
2008-11-28Consolidate the buffer checks for the reply_trans style functionsVolker Lendecke1-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
2008-11-28Remove the variable "size" from reply_nttransVolker Lendecke1-10/+13
This converts the range checks for the setup[] array to rely on req->wct being set correctly in init_smb_request. As that already verifies the vwv array to be in the range of the smb_request inbuf, we don't have to do overflow checks here anymore. Jeremy, please check thoroughly! :-) Thanks, Volker
2008-11-27Fix the offset checks in the trans routinesVolker Lendecke1-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)
2008-11-23Fix to allow setting of NULL DACL/SACLSteven Danneman1-11/+2
This is a modification of Jeremy's 7522ef15aca2429ef57c75d8297dd8121e79c9da commit. If no DACL/SACL is present in the packet, the SEC_INFO field should still be passed down as is to the VFS layer to signal the creation of a NULL DACL/SACL. As seen in metze RAW-ACL test_nttrans_create_null_dacl(), a NULL DACL is set regardless of the SEC_DESC_DACL_PRESENT bit being set.
2008-11-12Fix build breakTim Prouty1-1/+1
2008-11-12Pretty print out SD's on get/set.Jeremy Allison1-0/+10
Jeremy.
2008-11-08Do not write into inbuf for the transs requestVolker Lendecke1-6/+5
Instead, fix up the outbuf in send_xx_reply. In those routines, we know what we are returning.
2008-11-08Remove a direct inbuf reference from reply_nttrans()Volker Lendecke1-2/+1
2008-11-08Converting notify.c to store a request, not an inbufVolker Lendecke1-1/+2
2008-11-06Final fix to make us pass NULL SD test in RAW-ACLs. Not sure if this is 100% ↵Jeremy Allison1-0/+3
right. Only inheritance left to fix. Jeremy.
2008-11-02Use "vwv" in trans parsingVolker Lendecke1-35/+30
2008-11-02Remove a bunch of direct inbuf references by adding "vwv" to smb_requestVolker Lendecke1-2/+2
2008-11-02Simplify params of srvstr_pull_buf_talloc()Volker Lendecke1-2/+1
Now that "req" is available everywhere, use it. Rename srvstr_pull_buf_talloc() to srvstr_pull_req()
2008-11-02Add srvstr_get_path_req[_wcard]Volker Lendecke1-8/+6
2008-11-01Remove a bunch of direct inbuf references by adding "buf" to smb_requestVolker Lendecke1-4/+4
2008-10-25Move the is_known_pipename check into np_openVolker Lendecke1-10/+5
2008-10-22Fix a debug message in send_nt_replies()Volker Lendecke1-3/+6
2008-10-14Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij1-25/+25
2008-10-13Use "struct files_struct" for pipes instead of smb_np_structVolker Lendecke1-11/+6
2008-10-13Pass struct smb_request to file_freeVolker Lendecke1-3/+3
on the way to get rid of chain_fsp
2008-10-13Pass struct smb_request to file_fspVolker Lendecke1-7/+7
The goal is to get rid of the chain_fsp global variable
2008-10-11Fix a "nexted extern declaration" warningVolker Lendecke1-1/+1
2008-10-08For the vfs_acl_xattr.c module, make sure we map GENERIC file and directory bitsJeremy Allison1-0/+5
to specific bits every time a security descriptor is set. The S4 torture suite proves that generic bits are not returned when querying an ACL set using them (ie. only the specific bits are stored on disk). Jeremy.
2008-09-09Add some debug to reply_nttransVolker Lendecke1-0/+11
(This used to be commit 23e9fed28cf9998534b3c55f4b20a562da507552)
2008-09-08Fix calculation of useable_space for trans2 and nttrans repliesVolker Lendecke1-12/+10
When alignment was in place, we pretended to send more data/params according to the param_offset/param_length and data_offset/data_length parameters than would actually fit into the SMB according to the NBSS length field. (This used to be commit ef3c132b8455c6fe4d0bb9f0be881040a806a4ed)
2008-08-20smbd: fix the handling of create_options to pass RAW-OPENStefan Metzmacher1-0/+12
Some of the bits generate INVALID_PARAMETER and some bits are ignored when they come from a client, that's why we need to use bits from the ignored range for our internal usage. metze (This used to be commit 7b4c8a4e39f310eb450918fa841b0ea1b4af19f7)
2008-07-19Introduce is_known_pipenameVolker Lendecke1-35/+1
This scans the list of pipes registered via rpc_pipe_register_commands instead of using static tables. (This used to be commit 283e6039989adea1c8921b3600b410cb67b6492a)