summaryrefslogtreecommitdiffstats
path: root/source/smbd/filename.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix unix_convert() for "*" after changing map_nt_error_from_unix().Michael Adam2008-08-121-1/+1
| | | | | | | | | | | | | | | | | | | map_nt_error_from_unix() now assumes that it is called in an error path and returns an error even for a given errno == 0. The original behaviour of unix_convert() used the mapping of errno == 0 ==> NT_STATUS_OK to return success through an error path. I think this must have been an oversight, and unix_convert() worked only by coincidence (or because explicitly using the knowledge of the conceptually wrong working of map_nt_error_from_unix(). This patch puts this straight by not interpreting errno == 0 as an error condition and proceeding in that case. Jeremy - please check! Michael
* locking: combine get_delete_on_close_flag() and get_write_time() into ↵Stefan Metzmacher2008-04-071-5/+13
| | | | | | | | get_file_infos() This means we need to fetch the record only once. metze
* Couple of minor fixes for POSIX pathname processing in theJeremy Allison2008-01-191-8/+10
| | | | | | | | | | new stream code. (1) In smbd/filename, don't split the name at ':' if we know it's a posix path (this should be parameterized....). (2). When calling posix_mkdir, we get the flag FILE_FLAG_POSIX_SEMANTICS passed to open_directory(). I know for a posix client lp_posix_pathnames should be true (which is checked for in is_ntfs_stream_name() but we have an explicit flag here, so let's use it. Jeremy.
* Add streams supportVolker Lendecke2008-01-191-0/+121
| | | | | | | | | | This is the core of the streams support. The main change is that in files_struct there is now a base_fsp pointer that holds the main file open while a stream is open. This is necessary to get the rather strange delete semantics right: You can't delete the main file while a stream is open without FILE_SHARE_DELETE, and while a stream is open a successful unlink of the main file leads to DELETE_PENDING for all further access on the main file or any stream.
* Convert OpenDir to talloc, use talloc_tos()Volker Lendecke2008-01-121-3/+3
| | | | This cuts some mallocs on NtCreate&X
* If we detect a case insensitive filesystem makeJeremy Allison2007-12-221-4/+11
| | | | | | sure we don't search directories on name misses for non-mangled names. Jeremy
* Use filesystem capabilities to support case-insensitive filesystems.James Peach2007-12-221-0/+9
| | | | | | | | If we know the underlying filesystem is case-insensitive, then we know that it won't help to search for case variations of the requested name. Jeremy, please review (and revert if you disagree).
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-10/+10
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* r25167: Fix breakage from mangling rewrite. Use theJeremy Allison2007-10-101-1/+2
| | | | | | | new name if unmangling succeeded, not if it failed. Jerry - please re-test, this should fix your bug. Jeremy.
* r25138: More pstring elimination. Add a TALLOC_CTX parameterJeremy Allison2007-10-101-2/+2
| | | | | to unix_convert(). Jeremy.
* r25111: Move to talloced pathnames on most code paths.Jeremy Allison2007-10-101-2/+1
| | | | | | | | | There are now ony 17 pstrings left in reply.c, and these will be easy to remove (and I'll be doing that shortly). Had to fix an interesting bug in pull_ucs2_base_talloc() when a source string is not null terminated :-). Jeremy.
* r25009: Large patch discussed with Volker. Move unix_convert to a talloc-basedJeremy Allison2007-10-101-77/+112
| | | | | | interface. More development will come on top of this. Remove the "mangled map" parameter. Jeremy.
* r24811: Simple reformatting to fit the 80 columns rule.Jeremy Allison2007-10-101-63/+96
| | | | Jeremy.
* r24595: Fix Coverity ID 393Volker Lendecke2007-10-101-2/+1
| | | | In this error case we would have used "start" not having it initialized
* r24549: Fix unix_convert to return the already converted partVolker Lendecke2007-10-101-4/+10
| | | | | | | | | | This API will change anyway when moving away from pstrings. It took so long to fix, because that rename bug I just fixed gave make test failures that had nothing to do with this one. I have samba4 tests for both bugs, will check them in when the build farm has caught up
* r24497: Revert r24485 -- this needs more thoughtVolker Lendecke2007-10-101-1/+1
|
* r24485: Even in the failure case unix_convert must pass the already convertedVolker Lendecke2007-10-101-1/+1
| | | | part of the string to the caller.
* r24120: add a file_id_create() hook into the VFS layerStefan Metzmacher2007-10-101-1/+2
| | | | | | | it's needed for some cluster filesystems to overload this function. metze
* r23879: Fix two memleaks, found by the IBM checkerVolker Lendecke2007-10-101-2/+4
|
* r23878: Fix an error return, found by the IBM checkerVolker Lendecke2007-10-101-0/+1
|
* r23846: Belt-and-braces on the msdfs bug. Ensure ELOOP mapsJeremy Allison2007-10-101-6/+15
| | | | | correctly. Jeremy.
* r23844: Add patch series from Volker (after review and consultation).Jeremy Allison2007-10-101-99/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | 0001-Save-a-strdup-in-stat_cache_add.patch 0002-Use-ISDOT-and-ISDOTDOT.patch 0003-Move-fname_equal-around.patch 0004-unix_convert-pstring-dirpath-char.patch 0005-Ignore-.o-files.patch 0006-Get-rid-of-pstrings-inside-unix_convert.patch 0007-revert-pstring-unix_convert.patch 0008-Make-name-an-allocated-pstring-inside-unix_convert.patch 0009-Pass-explicit-pstring-to-mangle_check_cache.patch 0010-Don-t-overwrite-orig_path-unnecessarily.patch 0011-Defer-allocating-name.patch 0012-Make-sure-dirpath-is-always-correctly-allocated.patch 0013-Remove-one-pstring-dependency-in-unix_convert.patch 0014-Remove-more-name-pstring-dependencies.patch 0015-Hide-the-nasty-API-of-mangle_check_cache-in-mangle_c.patch 0016-name-does-not-need-to-be-pstring-size-anymore.patch 0017-Make-use-of-ISDOT-and-ISDOTDOT.patch 0018-Remove-pstring-from-stat_cache_lookup.patch 0019-Add-my-copyright.patch To remove pstrings from statcache and unix_convert. Jeremy.
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23761: Rename reduce_name to check_reduced_nameVolker Lendecke2007-10-101-2/+2
| | | | | The function name reduce_name is misleading, making the user believe it changes an argument.
* r23183: Check in a change made by Tridge:Volker Lendecke2007-10-101-1/+1
| | | | | | | | | | | | | This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker
* r20916: Add in the delete on close final fix - but only enabledJeremy Allison2007-10-101-0/+6
| | | | | with -DDEVELOPER. Jeremy.
* r20844: Somewhat radical change - this may break the build (I willJeremy Allison2007-10-101-12/+9
| | | | | | | | | | | | watch carefully - so I'm doing it in one transaction so I can roll back). Change check_name(), reduce_name() and dptr_create() to return NTSTATUS. This helps a lot in error path processing and especially in reduce_name() allows us to ditch the flaky and error-prone saving of errno and return errors directly. Jeremy.
* r20722: RAW-CHKPATH should now pass, build farm shouldJeremy Allison2007-10-101-4/+13
| | | | | go back to normal. Sorry about that. Jeremy.
* r20721: Fix the search unix_convert error returns. Only openJeremy Allison2007-10-101-25/+35
| | | | | to go... Jeremy.
* r20720: Fix the chkpath problem, still looking at findfirst.Jeremy Allison2007-10-101-1/+6
| | | | Jeremy.
* r20718: Sync up the filename path parsing changes from SAMBA_3_0_24.Jeremy Allison2007-10-101-41/+119
| | | | | | | The only difference between the two trees now w.r.t file serving are the changes to smbd/open.c in this branch I need to review. Jeremy.
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-10/+12
| | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy.
* r11945: Make us follow the newly documented pathname processing rules:Jeremy Allison2007-10-101-0/+13
| | | | | | | | | | | | "As a special case for directories with large numbers of files, if the case options are set as follows, "case sensitive = yes", "case preserve = no", "short preserve case = no" then the "default case" option will be applied and will modify all filenames sent from the client when accessing this share." This is needed as fixing the case preserve rules to only apply to new filenames broke the large directory fix. Glad we caught this before release. Thanks to jht for this one. Jeremy.
* r11861: Fix inspired by Thomas Neumann <t.neumann@iku-ag.de> to ensure thatJeremy Allison2007-10-101-10/+8
| | | | | | default case applies only to new files and correctly examines 8.3 and long names. Jeremy.
* r11346: Fix for bug found by Dina Fine. If in case sensitive mode thenJeremy Allison2007-10-101-1/+10
| | | | | | | | | the mangle cache is no good (3 letter extension could be wrong case - so don't demangle in this case - leave as mangled and allow the mangling of the directory entry read (which is done case insensitively) to match instead. This will lead to more false positive matches but we fail completely without it. Jeremy.
* r7893: Add in the extra parameters to opendir() to fix the large ↵Jeremy Allison2007-10-101-1/+1
| | | | | | | directory/insane app problem. Rev vfs version. Doesn't change the normal codepath. Jeremy.
* r7210: Fix my own mistakes up, sorry.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r7200: Don't use memset, use SET_STAT_INVALID (has the same effect).Jeremy Allison2007-10-101-3/+3
| | | | Jeremy.
* r6631: More typo's. Sorry.Jeremy Allison2007-10-101-2/+2
| | | | Jeremy.
* r6625: Remove another global variable left over from a long time ago (magic ↵Jeremy Allison2007-10-101-5/+5
| | | | | | char). Jeremy.
* r5792: Added new parameter "inherit owner". If set on a share, the created ↵Jeremy Allison2007-10-101-1/+1
| | | | | | | | | | | | | file/directory will be owned by the same uid as the containing directory. Doing this for directories in a race-free mannor has only been tested on Linux (it depends on being able to open a directory and then do a fchown on that file descriptor). If this functionality is not available then the code silently downgrades to not changing the ownership of a new directory. This new parameter (docs to follow) finally makes it possible to create "drop boxes" on Samba, which requires all files within a directory to be commonly owned. A HOWTO on how to use this will follow. Jeremy.
* r5183: Ensure we correctly set the per-connection "case_sensitive" setting.Jeremy Allison2007-10-101-4/+0
| | | | | | Rename dptrs_open to the more correct dirhandles_open. Remove old #if 1. Jeremy.
* r5160: First cut at refactoring of directory code to handle non-wildcardJeremy Allison2007-10-101-1/+1
| | | | | | directory match more efficiently. Passes RAW-SEARCH under valgrind but needs more testing (which I'll do later today :-). Jeremy.
* r5152: Restructure the directory handling code, stop using void * pointersJeremy Allison2007-10-101-1/+1
| | | | | | | | that just allow the wrong pointer to be assigned :-) and make the interface more consistent. Fix the FreeBSD directory problem. Last thing to do is to add the "singleton" directory concept from James Peach's code. Jeremy.
* r5063: Shamelessly steal the Samba4 logic (and some code :-) for directoryJeremy Allison2007-10-101-1/+3
| | | | | | | | | | evaluation. This stops us from reading the entire directory into memory at one go, and allows partial reads. It also keeps almost the same interface to the OpenDir/ReadDir etc. code (sorry James :-). Next I will optimise the findfirst with exact match code. This speeds up our interactive response for large directories, but not when a missing (ie. negative) findfirst is done. Jeremy
* r2152: Fix for bug #1674, move the symlinks checks into reduce_name().Jeremy Allison2007-10-101-17/+1
| | | | Jeremy.
* r2076: Removed old dir caching code - not being used now we have theJeremy Allison2007-10-101-15/+3
| | | | | | statcache anyway. New dir caching will be done on nanosecond timestamps. Jeremy.
* r1570: merging changes from 3.0.5Gerald Carter2007-10-101-2/+2
|
* r1115: Fix for #1427. Catch bad path errors at the right point. Ensure allJeremy Allison2007-10-101-3/+22
| | | | | our pathname parsing is consistent. Jeremy.