summaryrefslogtreecommitdiffstats
path: root/source/smbd/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* Make sure to always set errno on error path in OpenDir (and hence ↵Michael Adam2008-08-121-0/+1
| | | | | | scan_directory). Michael
* smbd/dir.c: remove unneeded stat buf parameter from user_can_read_file()Michael Adam2008-06-181-4/+2
| | | | | | This is not needed anymore since user_can_access_file_acl() ist used. Michael
* file_access: remove unneeded stat buf parameter from can_access_file_acl().Michael Adam2008-06-171-1/+1
| | | | | | This is a security descriptor level function only. Michael
* Remove unused "extern struct current_user" from dir.cVolker Lendecke2008-06-151-2/+0
|
* Remove the "stat_open()" function, flag, and all associated code. It was onlyJeremy Allison2008-05-021-66/+2
| | | | | | | being (correctly) used in the can_read/can_write checks for hide unreadable/unwritable and this is more properly done using the functions in smbd/file_access.c. Preparing to do NT access checks on all file access. Jeremy.
* smbd: make it possible to disable get_file_infos() on searchesStefan Metzmacher2008-04-071-7/+11
| | | | metze
* locking: combine get_delete_on_close_flag() and get_write_time() into ↵Stefan Metzmacher2008-04-071-1/+1
| | | | | | | | get_file_infos() This means we need to fetch the record only once. metze
* smbd: implement the strange write time update logicStefan Metzmacher2008-04-071-0/+8
| | | | | | | | | | | | | | | | | | | | We now never call file_ntimes() directly, every update is done via smb_set_file_time(). This let samba3 pass the BASE-DELAYWRITE test. The write time is only updated 2 seconds after the first write() on any open handle to the current time (not the time of the first write). Each handle which had write requests updates the write time to the current time on close(). If the write time is set explicit via setfileinfo or setpathinfo the write time is visible directly and a following close on the same handle doesn't update the write time. metze
* Convert OpenDir to talloc, use talloc_tos()Volker Lendecke2008-01-121-57/+39
| | | | This cuts some mallocs on NtCreate&X
* Allocate dirp->name_cache on demand onlyVolker Lendecke2008-01-081-11/+10
|
* Remove superfluous fd parameter from SMB_VFS_FGET_NT_ACL().Michael Adam2008-01-061-2/+2
| | | | Michael
* Use filesystem capabilities to support case-insensitive filesystems.James Peach2007-12-221-17/+21
| | | | | | | | 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).
* Make [f]get_nt_acl return NTSTATUSVolker Lendecke2007-11-131-6/+5
|
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-27/+27
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* r25117: The mega-patch Jerry was waiting for. Remove all pstrings fromJeremy Allison2007-10-101-41/+94
| | | | | | | | the main server code paths. We should now be able to cope with paths up to PATH_MAX length now. Final job will be to add the TALLOC_CTX * parameter to unix_convert to make it explicit (for Volker). Jeremy.
* r25111: Move to talloced pathnames on most code paths.Jeremy Allison2007-10-101-6/+7
| | | | | | | | | 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.
* r25102: Rewrite msdfs code to use talloced filenames. Passes make testJeremy Allison2007-10-101-2/+1
| | | | | | and make valgrindtest. Final step will be to change srvstr_get_path() to return talloced memory in the major codepaths. Jeremy.
* r25009: Large patch discussed with Volker. Move unix_convert to a talloc-basedJeremy Allison2007-10-101-16/+20
| | | | | | interface. More development will come on top of this. Remove the "mangled map" parameter. Jeremy.
* r24639: Add parameter "directory name cache size" - parameterizeJeremy Allison2007-10-101-20/+33
| | | | | | use of directory name cache, 100 by default. Will be needed to turn this off for *BSD systems. 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.
* r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_requestVolker Lendecke2007-10-101-3/+3
| | | | | | | | | | | | that contains some of the fields from the SMB header, removing the need to access inbuf directly. This right now is used only in the open file code & friends, and creating that header is only done when needed. This needs more work, but it is a start. Jeremy, I'm only checking this into 3_0, please review before I merge it to _26. Volker
* r21800: Check-in the DFS rewrite. I am still testing this but itJeremy Allison2007-10-101-4/+2
| | | | | | | | works from smbclient and Windows, and I am promising to support and fix both client and server code moving forward. Still need to test the RPC admin support but I haven't changed that code. Jeremy.
* r21257: Better fix for bug #4188 :Jeremy Allison2007-10-101-0/+39
| | | | | | Windows Vista RC1 and RC2 can't delete directory on Samba share based on work by Joe Meadows <jmeadows@webopolis.com>. Jeremy.
* r21191: Add in the POSIX open/mkdir/unlink calls.Jeremy Allison2007-10-101-0/+1
| | | | | | | | Move more error code returns to NTSTATUS. Client test code to follow... See if this passes the build-farm before I add it into 3.0.25. Jeremy.
* r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.Jeremy Allison2007-10-101-5/+8
| | | | | | | | Allow us to correctly refuse to set delete on close on a non-empty directory. There are still some delete-on-close wrinkles to be fixed, but I understand how to do that better now. I'll fix this tomorrow. Jeremy.
* r20844: Somewhat radical change - this may break the build (I willJeremy Allison2007-10-101-12/+19
| | | | | | | | | | | | 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.
* r20411: Fix originally from SATOH Fumiyasu (slightlyJeremy Allison2007-10-101-0/+12
| | | | | | modified). Ensure "hide unXXX" parameters don't hide MSDFS links. Bug #3319. Jeremy.
* r18547: Add in fixes to mangling dir code - ensure don'tJeremy Allison2007-10-101-40/+51
| | | | | | look in the paths for wcard - always read directly from incoming packet. Jeremy.
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-10/+11
| | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy.
* r16537: Fix for bug #3858, all files in a directory notJeremy Allison2007-10-101-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | being deleted when hide unreadable set to true. Here's the scoop. This one is really interesting. The pattern of deleting a directory is to do a findfirst to get the first part of the list, then for each name returned it does a open/set delete on close/close -> thus deleting the file. Then it does a findnext with the last file name THAT IT JUST DELETED ! Now we can handle this in the findnext in the case where hide unreadable is set to false as we look back in our cache of names and just seek to the right point. The bug is actually fixed in the first hunk of this patch - the one that removes the is_visible_file() check after SearchDir returns false. We don't actually need it and in this case it's causing the delete to be aborted because it can't find the name (doh ! it was just deleted). We don't need it as SearchDir is only ever called from findnext, and findnext should only ever be returning names we gave it. The rest of the patch are the debugs I used to find the problem but they're generically useful. Phew - that one took a while to track down..... Jerry, please merge for 3.0.23 final. Jeremy.
* r15196: Update a comment that I found confusing (I confuse easily).Paul Green2007-10-101-1/+1
|
* r14986: Fix OS/2 directory delete bug found by kukks.Jeremy Allison2007-10-101-8/+28
| | | | | | | | | | | | | (Thanks a lot for all your hard work on this). We were caching the results of *all* directory scans, not just the results that match the client wildcard. This actually made no sense, as only matches on the client wildcard can be returned to the client and so might need to be searched for in the cache. This fixes the directory cache to only cache entries that we return to the client. Jeremy.
* r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison2007-10-101-2/+2
| | | | | | | | by saving the UNIX token used to set a delete on close flag, and using it when doing the delete. libsmbsharemodes.so still needs updating to cope with this change. Samba4 torture tests to follow. Jeremy.
* r11657: Tiny improvement to debug error message in dir_check_ftype.Paul Green2007-10-101-1/+1
|
* r11511: A classic "friday night check-in" :-). This moves muchJeremy Allison2007-10-101-1/+1
| | | | | | | | | | | | | | | | of the Samba4 timezone handling code back into Samba3. Gets rid of "kludge-gmt" and removes the effectiveness of the parameter "time offset" (I can add this back in very easily if needed) - it's no longer being looked at. I'm hoping this will fix the problems people have been having with DST transitions. I'll start comprehensive testing tomorrow, but for now all modifications are done. Splits time get/set functions into srv_XXX and cli_XXX as they need to look at different timezone offsets. Get rid of much of the "efficiency" cruft that was added to Samba back in the day when the C library timezone handling functions were slow. Jeremy.
* r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We canJeremy Allison2007-10-101-2/+2
| | | | | | | | only tell at parse time from the wire if an incoming name has wildcards or not. If it's a mangled name and we demangle the demangled name may contain wildcard characters. Ensure these are ignored. Jeremy.
* r10558: Fix bug #3010 yet again. Die monster, die !Jeremy Allison2007-10-101-1/+16
| | | | Jeremy.
* r9483: Changed DIR to SMB_STRUCT_DIR because of the amazing stupidity of a ↵Jeremy Allison2007-10-101-1/+1
| | | | | | | UNIX vendor not understanding abstract data types :-(. Jeremy.
* r9457: Attempt to fix bug #3010 by handling END_OF_DIRECTORY_OFFSETJeremy Allison2007-10-101-1/+6
| | | | | consistently. Jeremy.
* r9286: Fix false positive found by Coverity - wcard must not be null.Jeremy Allison2007-10-101-12/+14
| | | | Jeremy.
* r8689: Fixes bugid #2889 for sure. Turns out the OS/2 dos box doesn't like ↵Jeremy Allison2007-10-101-14/+21
| | | | | | | two offsets to be identical. Make offsets for . and .. different (and explicit). Jeremy.
* r8655: Still trying to fix #2889. We don't need the DPTR_MASK afterJeremy Allison2007-10-101-9/+2
| | | | | all, now thinking it might be to do with flags2... Jeremy.
* r8610: If I'm going to do a debug level zero, at least make it useful.Jeremy Allison2007-10-101-1/+2
| | | | Jeremy.
* r8609: Fix for bugid #2889. I think the problem is that the top 16 bits of ↵Jeremy Allison2007-10-101-2/+8
| | | | | | | | | | the "server state" field must be non-zero. As we're using the 32 bit field as an offset then normally this field will be zero. W2K3 fills this field with a counter enumerating the number of SMBsearch calls on this directory - starting at 1. Add back the 1<<31 bit flag DPTR_MASK to ensure this is non-zero - with better checks on use. Jeremy.
* r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison2007-10-101-22/+38
| | | | | | | | | tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy.
* r7893: Add in the extra parameters to opendir() to fix the large ↵Jeremy Allison2007-10-101-39/+30
| | | | | | | directory/insane app problem. Rev vfs version. Doesn't change the normal codepath. Jeremy.
* r7842: With the patch I sent Steve yesterday this gives us complete POSIX ↵Jeremy Allison2007-10-101-1/+1
| | | | | | | pathnames. ie. files containing : and \ can be accessed from Linux. Jeremy.
* r7617: Fix for bug #2801 - delete veto files was broken with the newJeremy Allison2007-10-101-1/+17
| | | | | large directory code. Jeremy.
* r7474: A *foul* and *disgusting* hack to ensure that, at the very lowestJeremy Allison2007-10-101-1/+23
| | | | | | | | | | | | | | level, . and .. are the first two entries returned when reading a directory. This also means we can't seek to these offsets, but we will never be doing that anyway (as far as I can think). The reason we have to do this is that the NT4 explorer will happily display a folder marked ".." as a clickable folder (and probably would display "." as a clickable folder too) if these are not in positions zero and one of the returned file list. W2K seems to have fixed this but there are too many older systems out there... Never mind, more for the "Undocumented CIFS talk", coming to a CIFS2005 conference near you soon.... :-). Jeremy.