summaryrefslogtreecommitdiffstats
path: root/source3/smbd/dosmode.c
Commit message (Collapse)AuthorAgeFilesLines
* dosmode: fix FSCTL_SET_SPARSE request validationDavid Disseldorp2014-08-281-0/+13
| | | | | | | | | | | | | Check that FSCTL_SET_SPARSE requests does not refer to directories. Also reject such requests when issued over IPC or printer share connections. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10787 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Aug 28 04:22:37 CEST 2014 on sn-devel-104
* vfs3: Pass "lease" through SMB_VFS_CREATE_FILEVolker Lendecke2014-08-111-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_timeVolker Lendecke2014-06-301-2/+2
| | | | | | | Both take and return values now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Align unix_timespec_to_nt_time with nt_time_to_unix_timespecVolker Lendecke2014-06-301-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused code for dos attributes in stat structChristof Schmitt2014-05-141-135/+4
| | | | | | | | | | This code is unused since the move to the waf build system. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Wed May 14 01:35:41 CEST 2014 on sn-devel-104
* s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() ↵Jeremy Allison2014-05-021-12/+92
| | | | | | | | | | | | | | | | | | instead of open_file_fchmod(). get_file_handle_for_metadata() is a new function that finds an existing open handle (fsp->fh->fd != -1) for a given dev/ino if there is one available, and uses INTERNAL_OPEN_ONLY with WRITE_DATA access if not. Allows open_file_fchmod() to be removed next. Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* param: rename lp function and variable from "inherit_perms" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "inherit_permissions" Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'force_dir_mode' to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | 'force_directory_mode' Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* loadparm: rename lp[cfg]_dir_mask to lp[cfg]_directory_mask for consistency ↵Michael Adam2014-02-031-1/+1
| | | | | | | | | with docs Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s3-smbd: support FILE_ATTRIBUTE_COMPRESSEDDavid Disseldorp2013-11-221-0/+47
| | | | | | | | | | The FILE_ATTRIBUTE_COMPRESSED flag is computed based on whether the filesystem exposes the FILE_FILE_COMPRESSION capability, and whether SMB_VFS_GET_COMPRESSION() reports that the file or directory is currently compressed. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: split out dos_mode debug print functionDavid Disseldorp2013-11-221-12/+31
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed ↵Richard Sharpe2013-08-191-0/+5
| | | | | | | | | | | | | | | | out by Samba. Windows overloads the EA Length field in the DIRECTORY INFO leves of FIND FIRST/FIND NEXT. This field indicates either the REPARSE_TAG if the file/folder has a reparse proint or the EA Length if it has EAs, and is the fundamental reason you cannot have both on a file or folder. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 19 22:21:34 CEST 2013 on sn-devel-104
* smbd: Change logging when SET_OFFLINE is not supportedChristof Schmitt2013-06-061-10/+15
| | | | | | | | | | | | | | A client can send a request to set the OFFLINE attribute. In the default code this is not supported and triggers a log message each time. Change this to only log with level 0 when an actual errors occurs, and log ENOTSUP with level 10. Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Jun 6 04:30:26 CEST 2013 on sn-devel-104
* Allow "store dos attributes" to override the other "map XXX" parameters.Jeremy Allison2013-05-061-5/+8
| | | | | | | | Makes us consistent with what is described in the man pages. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Check for WRITE_ACCESS on the file before overriding an EACCESS.Jeremy Allison2013-04-271-0/+4
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Apr 27 15:57:17 CEST 2013 on sn-devel-104
* Ensure we don't try the open_file_fchmod() if we can't write to the file.Jeremy Allison2013-04-271-0/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* Remove indentation around code wrapped by unneeded CAN_WRITE.Jeremy Allison2013-04-271-23/+20
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* Add early return in file_set_dosmode() on a read only share.Jeremy Allison2013-04-271-0/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Convert set_create_timespec_ea to synthetic_smb_fnameVolker Lendecke2013-04-171-8/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert unix_mode to synthetic_smb_fnameVolker Lendecke2013-04-171-8/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: preserve file type mode bits in file_set_dosmode()Michael Adam2013-02-191-0/+3
| | | | | | | | | | | | | When translating between dos modes and unix modes, these bits were dropped from the stat->st_ex_mode field. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Feb 19 15:45:31 CET 2013 on sn-devel-104
* s3:smbd: also log the "offline" flag when debugging the dos-modeMichael Adam2012-10-171-0/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* lib/param: Move all enum declarations to lib/paramAndrew Bartlett2012-07-241-0/+1
| | | | | | | | This is in preperation for the parameter table being made common. Andrew Bartlett Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-1/+1
| | | | | | | | | | They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3: if we know a file is immutable, report it to be readonlyBjörn Jacke2012-07-041-0/+6
| | | | on *BSD we get the immutable flag via st_flags, we should use that if possible.
* s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCHAndrew Bartlett2011-04-291-7/+7
| | | | | | This means we use just one constant for this file attribute. Andrew Bartlett
* s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIRAndrew Bartlett2011-04-291-9/+9
| | | | | | This means we use just one constant for this file attribute. Andrew Bartlett
* s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEMAndrew Bartlett2011-04-291-7/+7
| | | | | | This means we use just one constant for this file attribute. Andrew Bartlett
* s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDENAndrew Bartlett2011-04-291-13/+13
| | | | | | This means we use just one constant for this file attribute. Andrew Bartlett
* s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLYAndrew Bartlett2011-04-291-10/+10
| | | | | | This means we use just one constant for this file attribute. Andrew Bartlett
* Use handle based xattr set if available.Jeremy Allison2011-04-151-4/+5
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Apr 15 22:11:12 CEST 2011 on sn-devel-104
* Fix bug #7996 - sgid bit lost on folder rename.Jeremy Allison2011-03-301-0/+21
| | | | | Refuse to set dos attributes into unix mode bits on such a folder.
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: Pass smb_filename through the set_offline vfs opVolker Lendecke2011-03-021-1/+1
|
* s3: Pass smb_filename through the is_offline vfs opVolker Lendecke2011-03-021-1/+1
|
* s3:smbd: fix switch indentation level in get_ea_dos_attribute()Michael Adam2011-02-101-4/+4
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Thu Feb 10 17:46:12 CET 2011 on sn-devel-104
* Fix bug #7892 - open_file_fchmod() leaves a stale lock.Jeremy Allison2010-12-291-7/+4
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Dec 29 02:15:23 CET 2010 on sn-devel-104
* Keep track of the sparse status of an open file handle. Allows bypass ofJeremy Allison2010-12-211-0/+2
| | | | | | | | strict allocation on sparse files. Files opened as POSIX opens are always sparse. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Dec 21 04:12:22 CET 2010 on sn-devel-104
* From metze's work on sparse attributes. FILE_ATTRIBUTE_SPARSE is valid on ↵Jeremy Allison2010-12-201-1/+2
| | | | | | | get but not on set. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Dec 20 20:11:22 CET 2010 on sn-devel-104
* Move checks inside file_set_sparse() to allow it to be called from anywhere.Jeremy Allison2010-12-171-1/+21
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Dec 17 21:56:38 CET 2010 on sn-devel-104
* file_set_sparse needs to be a handle based call.Jeremy Allison2010-12-171-10/+8
|
* s3:smbd: add file_set_sparse() functionBjörn Jacke2010-12-171-0/+49
| | | | this is based on a patch for 3.3 from metze
* s3: remove set_sparse_flagBjörn Jacke2010-12-171-15/+1
| | | | | | | | we need to determine sparseness from the sparse flag we store not from the allocation size on the POSIX filesystem. This is how Windows works - in the first place sparseness is a file flag, not the allocation state of the file Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: add FILE_ATTRIBUTE_SPARSE to get_stat_dos_flagsBjörn Jacke2010-12-171-0/+2
|
* s3: Fix some DEBUG msgsVolker Lendecke2010-10-261-5/+5
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Oct 26 15:20:01 UTC 2010 on sn-devel-104
* s3: Remove use of iconv_convenience.Jelmer Vernooij2010-05-181-2/+2
|
* Add debug to make it clear when EA dosmode set is invoked.Jeremy Allison2010-02-011-0/+5
| | | | Jeremy.
* Fix bug #7084 - Create time on directories not stored properly in an EA in ↵Jeremy Allison2010-02-011-7/+0
| | | | | | | | | | new create time code. Remove erroneous optimisation that caused no EA to be set if calculated btime matched st_ex btime, and calculated DOS attribute matched existing file attribute. Jeremy.
* Correct fix for unused variable return from ndr_decode. Use it :-).Jeremy Allison2010-01-251-0/+8
| | | | Jeremy.