summaryrefslogtreecommitdiff
path: root/source3/smbd/dir.c
AgeCommit message (Collapse)AuthorFilesLines
2013-06-12smbd: Remove an unused variableVolker Lendecke1-2/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 12 01:00:44 CEST 2013 on sn-devel-104
2013-04-27Fix bug #9822 - Samba crashing during Win8 sync.Jeremy Allison1-0/+1
When refactoring the dptr desctructor in the fix for bug: 9778 (Samba directory code uses dirfd() without vectoring through a VFS call) I removed the code to NULL out the struct smb_Dir * pointer inside the fsp struct by mistake. Re-add the NULLing out of that pointer when closing a directory pointer associated with an open file. Reporter confirms it fixes the crash. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Sat Apr 27 20:44:55 CEST 2013 on sn-devel-104
2013-04-17smbd: Convert is_visible_file to synthetic_smb_fnameVolker Lendecke1-4/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert dptr_create to synthetic_smb_fnameVolker Lendecke1-8/+7
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert open_dir_with_privilege to synthetic_smb_fnameVolker Lendecke1-5/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert smbd_dirptr_get_entry to cp_smb_filenameVolker Lendecke1-3/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-16Cleanup. Remove unused function dptr_DirCacheAdd(). Make DirCacheAdd() static.Jeremy Allison1-10/+3
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Apr 16 12:05:13 CEST 2013 on sn-devel-104
2013-04-12Remove the "Ugly hack" that was the second use of dirfd().Jeremy Allison1-13/+5
The destructor does all the resource deallocation needed. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-12In the struct smb_Dir destructor, use the fsp back pointer to release resources.Jeremy Allison1-10/+13
Removes one use of dirfd(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-12Maintain a back-pointer to the fsp in struct smb_Dir when opening with ↵Jeremy Allison1-1/+5
FDOPENDIR. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-03-22smbd: Tune "dir" a bit.Volker Lendecke1-6/+19
for i in $(seq 1 20000) ; do echo dir ; done | smbclient //127.0.0.1/tmp -U% without and with this patch: $ time bin/smbd -d0 -i smbd version 4.1.0pre1-GIT-1f139ae started. Copyright Andrew Tridgell and the Samba Team 1992-2013 Beendet real 0m28.342s user 0m10.249s sys 0m10.513s $ time bin/smbd -d0 -i smbd version 4.1.0pre1-GIT-1f139ae started. Copyright Andrew Tridgell and the Samba Team 1992-2013 Beendet real 0m27.348s user 0m9.089s sys 0m10.853s The "real" timestamp is irrelevant, this also contains the time between starting smbd and the smbclient job. It's the "user" time. The result that this patch improves the time spent in user space by 10% is consistent. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Mar 22 22:10:57 CET 2013 on sn-devel-104
2012-11-20More for #9374 - Allow smb2.acls torture test to pass against smbd with a ↵Jeremy Allison1-5/+9
POSIX ACLs backend. Change can_delete_directory() to can_delete_directory_fsp(), as we only ever call this from an open directory file handle. This allows us to use OpenDir_fsp() instead of OpenDir(). OpenDir() re-checks the ACL on the directory, which may refuse DIR_LIST permissions. OpenDir_fsp() does not. As this is a file-server internal check to see if the directory actually contains any files before setting delete on close, we can ignore the ACL here (Windows does). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Nov 20 01:46:28 CET 2012 on sn-devel-104
2012-09-14Add bool use_privs parameter to smbd_check_access_rights()Jeremy Allison1-0/+2
If this is set we should use it in preference to blindly assuming root can do anything. Currently set to 'false' in (most) callers.
2012-09-14Add "backup_intent" bool.Jeremy Allison1-1/+2
2012-04-06build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett1-2/+2
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
2012-04-05build: Remove SMB_STRUCT_DIR defineAndrew Bartlett1-1/+1
2012-03-01Add open_dir_with_privilege() to ensure we're opening the correct directory ↵Jeremy Allison1-2/+66
when doing backup requests. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 1 03:50:40 CET 2012 on sn-devel-104
2012-02-29Add accessor functions to set a bool "priv" on a directory handle. Not yet ↵Jeremy Allison1-0/+11
used, but will be part of FLAG_TRANS2_FIND_BACKUP_INTENT code.
2012-02-25Move dptr code over to TALLOC.Jeremy Allison1-18/+9
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Feb 25 03:50:24 CET 2012 on sn-devel-104
2012-02-24Make dptr_path() and dptr_wcard() const.Jeremy Allison1-2/+2
2011-12-20s3: Fix some False/NULL hickupsVolker Lendecke1-1/+1
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
2011-12-13s3: Move can_delete_directory to smbd/, remove shimVolker Lendecke1-2/+2
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Dec 13 19:00:37 CET 2011 on sn-devel-104
2011-11-10s3:smbd: don't limit the number of open dptrs for smb2 (bug #8592)Stefan Metzmacher1-3/+12
This fixes a crash bug that is triggered, when a client has more than 256 directory handles with searches. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Nov 10 14:08:14 CET 2011 on sn-devel-104
2011-11-10s3:smbd: fully construct the dptr before allocating a dnum in the bitmapStefan Metzmacher1-27/+29
metze
2011-11-10s3:smbd: avoid string_set() in dir.cStefan Metzmacher1-2/+9
And do some more error checks. metze
2011-11-07Add the SEC_DIR_LIST check to dptr_create().Jeremy Allison1-0/+27
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Nov 7 21:11:03 CET 2011 on sn-devel-104
2011-11-05Move the SEC_DIR_LIST check into dptr_create for SMB2 and now for SMB1.Jeremy Allison1-0/+6
The pathname check still needs fixing. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Nov 5 01:38:00 CET 2011 on sn-devel-104
2011-11-04Remove can_access_file_acl(). We no longer need this duplicate code (hurrah!).Jeremy Allison1-1/+3
2011-11-04Revert "Call check_parent_access() on readdir."Jeremy Allison1-13/+0
This reverts commit a763edaf9c76afe2546c035fc090370301dd347b. Checking the wrong thing..
2011-11-01Call check_parent_access() on readdir.Jeremy Allison1-0/+13
2011-08-25s3:smbd: remove an unused variable in dptr_create()Michael Adam1-1/+0
2011-08-03We don't need check_name() here. All possible paths to dptr_create()Jeremy Allison1-4/+0
have already called check_name. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Aug 3 03:00:55 CEST 2011 on sn-devel-104
2011-07-08lib/util Move bitmap.c to lib/utilAndrew Bartlett1-0/+1
2011-06-21s3-build: Provide a run-time shim to work around duplicate symbolsAndrew Bartlett1-2/+2
The become_root() and similar 'smbd' functions that are used widely in Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c. These have been replaced by a runtime plugin mechanim, which ensures that standlone binaries still do nothing, while in smbd the correct function is used. This avoids having these as duplicate symbols in the smbd binary, which can cause unpredictable behaviour. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()Andrew Bartlett1-1/+1
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett1-2/+2
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
2011-04-29s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCHAndrew Bartlett1-2/+2
This means we use just one constant for this file attribute. Andrew Bartlett
2011-04-29s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIRAndrew Bartlett1-4/+4
This means we use just one constant for this file attribute. Andrew Bartlett
2011-04-29s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEMAndrew Bartlett1-3/+3
This means we use just one constant for this file attribute. Andrew Bartlett
2011-04-29s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDENAndrew Bartlett1-3/+3
This means we use just one constant for this file attribute. Andrew Bartlett
2011-04-29s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLYAndrew Bartlett1-2/+2
This means we use just one constant for this file attribute. Andrew Bartlett
2011-03-30s3: include smbd/smbd.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-includes: only include system/filesys.h when needed.Günther Deschner1-0/+1
Guenther
2011-03-18The searches struct is still being used and idled in SMB2 - move it to the ↵Jeremy Allison1-26/+26
global section until we decide if we want to idle SMB2 directory handles. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Mar 18 01:13:53 CET 2011 on sn-devel-104
2011-03-17Fix crash bug on smbd shutdown when using FOPENDIR() found by Volker.Jeremy Allison1-1/+13
The key was allowing the dptr_idle code to be triggered. We were closing the dirp->dir handle without updating the underlying fd in the open fsp. Jeremy.
2011-02-26dirfd doesn't exist in some platforms.Jeremy Allison1-0/+6
Hack that should get the buildfarm back to green. Ensure dirfd() needs to be defined before we properly return fdopendir. This will do until we get a proper dirfd() defined in libreplace. From http://www.gnu.org/software/hello/manual/gnulib/dirfd.html This function is missing on some platforms: AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 10, mingw. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Feb 26 04:19:55 CET 2011 on sn-devel-104
2011-02-10Put OpenDir() back the way it was - don't overload with an fsp arg. Create ↵Jeremy Allison1-14/+59
OpenDir_fsp for new usage. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Feb 10 02:43:31 CET 2011 on sn-devel-104
2011-02-09Allow SMB2_FIND to actually use the open fd handle if we support fdopendir. ↵Jeremy Allison1-11/+43
Fallback to pathname opendir if not.
2011-02-08Pass fsp to dptr_CloseDir(). Cope with setting the fd if we're closing an fd ↵Jeremy Allison1-3/+9
that opendir knows about.
2011-01-25Add uint32_t name_hash argument (currently unused) to get_file_infos().Jeremy Allison1-1/+1
Will be used when we store more than one delete on close token.