1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

185 Commits

Author SHA1 Message Date
Joseph Sutton
c2daa3564a s4:ntvfs: Correctly acknowledge PVFS_FLAG_STRICT_SYNC flag (CID 241154)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13 02:18:31 +00:00
Ralph Boehme
c2f0fd40da smb: rename NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to NTCREATEX_FLAG_DENY_FCB
Just a shorter name, no change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-23 17:44:33 +00:00
Ralph Boehme
6da16727e1 smb: rename NTCREATEX_OPTIONS_PRIVATE_DENY_DOS to NTCREATEX_FLAG_DENY_DOS
Just a shorter name, no change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-23 17:44:33 +00:00
ouyang.xu
98ea4a2219 pvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID
Signed-off-by: kkhaike <kkhaike@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Aug 19 09:35:15 CEST 2016 on sn-devel-144
2016-08-19 09:35:14 +02:00
Volker Lendecke
ee78af33fe ntvfs: Fix Coverity ID 1107224 Resource leak
In this error path we were leaking "fd".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-21 16:34:19 -07:00
Andrew Tridgell
3c4af39aa5 s4-ntvfs: added allow_override check based on use of NT ACL
This disables the posix permission override if the calculated
permissions did not come from a NT ACL.

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Dec  1 05:14:49 CET 2011 on sn-devel-104
2011-12-01 05:14:49 +01:00
Stefan Metzmacher
1ba5077e5f s4:ntvfs: s/== PROTOCOL_SMB2/>= PROTOCOL_SMB2_02/
metze
2011-09-05 13:17:33 +02:00
Rusty Russell
0204ae6229 lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Andrew Bartlett
1969aa8eac s4-ntvfs: Rename brl_*() -> brlock_*() to avoid conflict with brlock_init in s3 2011-05-08 10:56:26 +02:00
Pavel Shilovsky
738b2abe78 s4: Don't grant level II oplock to a file with byte-range locks.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Feb 15 11:09:17 CET 2011 on sn-devel-104
2011-02-15 11:09:17 +01:00
Andrew Tridgell
2c2156ea95 s4-pvfs: use pvfs_sys_fchmod() 2010-03-05 23:07:32 +11:00
Andrew Tridgell
ace6d75ae6 s4-pvfs: use pvfs_sys_*() functions to wrap posix calls
This allows for root override, which fixes many problems with
mismatches between NT ACL permissions and unix permissions.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-05 23:07:31 +11:00
Andrew Tridgell
2e1637833b s4-pvfs: log more error conditions in NTVFS backend
This should make is easier to track down some bug reports

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-05 16:12:06 +11:00
Andrew Tridgell
80a37beb53 s4-pvfs: move the private ntcreatex flags to private_flags
Re-using two of the create_options bits was bound to eventually
cause problems, and indeed, Windows7 now uses one of those bits
when opening text files.

Fixes bug 7189
2010-03-05 16:12:05 +11:00
brendan powers
0708b2a0c9 s4-ntvfs: check if pvfs is NULL in pvfs_logoff
pvfs can be NULL if the directory a share points to does not exist. In
this case, there would be no open files, so it is safe to just return
from the function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-17 11:48:39 +11:00
Andrew Tridgell
d78921d78c s4-pvfs: fixed access check failure in SFILEINFO test
matching windows behaviour is not always the right thing to do!
2009-11-27 16:05:06 +11:00
Andrew Tridgell
1219dac5ae s4-pvfs: fixed uninitialised variable
This caused havoc on the build farm. Interestingly, it only affected
gcc 4.3.3, not gcc 4.4.1
2009-10-19 11:59:57 +11:00
Andrew Tridgell
0463d69883 s4-pvfs: change the handling of access checking on create
Previously when a file was created, we produces the resulting access
mask based on an ACL check against the parent. This change means we
now calculate the inherited ACL much earlier, and produce the
resulting access mask from that ACL, or the user supplied ACL.
2009-10-18 07:13:47 +11:00
Andrew Tridgell
c5cfda9e8a s4-pvfs: implement root_fid support in posix backend
Construct the filename from the old handle and the new name.
2009-10-15 20:03:00 +11:00
Andrew Tridgell
00a8ff5fe9 fixed a problem with group policy writes causing policy corruption
This bug was caused by two things:

  1) in the unix ACL mapping, we were not taking into account group
  write permssions for the SEC_STD_DELETE flag

  2) when a file is created using OVERWRITE mode, a fchmod() would
  fail if the user is not the file owner. We resolve that by only
  doing the fchmod() if the mapped file attribute does not match the
  desired file attribute
2009-08-05 17:51:58 +10:00
Stefan Metzmacher
3d6587c777 s4:pvfs: use talloc_get_type() to cast from void *
metze
2009-02-05 17:48:07 +01:00
Stefan Metzmacher
b99926ca5e s4: ntvfs/posix: to set a DACL at open time SEC_DESC_DACL_PRESENT must be set
metze
2008-10-28 17:13:21 +01:00
Jelmer Vernooij
9565999755 Fix include paths to new location of libutil. 2008-10-11 21:31:42 +02:00
Andrew Tridgell
f4e212323f added some debug code 2008-09-23 12:09:56 +10:00
Stefan Metzmacher
cc60d5a032 pvfs: fix handling of create_option flags
metze
(This used to be commit 3c6cadf768)
2008-08-14 13:13:51 +02:00
Andrew Tridgell
2ecda9fde4 we can't query the ACL on a new file till it exists!
(This used to be commit 4f6646f069)
2008-07-24 14:21:52 +10:00
Andrew Bartlett
853194c308 More 'must be ignored' options from the MS-SMB doc.
Also in particular the 'sync' flags (which Samba has traditionally
ignored).

Thanks to Olivier Salamin <olivier.salamin@gmail.com> for pointing out
more flags that needed to be handled.

Andrew Bartlett
(This used to be commit 370bb39cd7)
2008-07-18 18:40:19 +10:00
Andrew Bartlett
e92125e631 Ignore and handle more NT Create & X options.
The MS-SMB document explains that some of these options should be
ignored.  The test proves it.

/* Must be ignored by the server, per MS-SMB 2.2.8 */
/* Must be ignored by the server, per MS-SMB 2.2.8 */

If we implement HSM in samba4 (likely) we should honour this bit.
/* Don't pull this file off tape in a HSM system */

Andrew Bartlett
(This used to be commit 502739ff90)
2008-07-16 14:00:18 +10:00
Stefan Metzmacher
b800af662c pvfs: use utimes() instead of utime() to get better timestamp resolution
Note: that libreplace always provides utimes()

metze
(This used to be commit 61bad69e2d)
2008-06-03 14:05:04 +02:00
Stefan Metzmacher
6e52c4feb8 pvfs_close: correctly handle the write time updates passed by close()
metze
(This used to be commit 7f033ce4fb)
2008-06-03 14:03:52 +02:00
Stefan Metzmacher
60759b64a7 pvfs: correctly set the write time in the handle destructor
metze
(This used to be commit 58c118ab4d)
2008-06-03 14:03:51 +02:00
Stefan Metzmacher
c43591c216 pvfs: add PVFS_RESOLVE_NO_OPENDB flag and get the write time from the opendb
By default get the current write time from the opendb,
but allow callers to pass PVFS_RESOLVE_NO_OPENDB
for performance reasons, if they don't need to the write time.

metze
(This used to be commit def52cc098)
2008-06-03 14:03:50 +02:00
Stefan Metzmacher
0827b08a43 opendb: add write time handling
metze
(This used to be commit 3868d8ce63)
2008-06-03 14:03:49 +02:00
Andrew Tridgell
c86dc11be6 added support for returning the maximal access MXAC tag in SMB2 create
(This used to be commit 4eb49335d5)
2008-05-29 19:16:26 +10:00
Andrew Tridgell
67226f054b fixed create_action for truncated files
(This used to be commit 884c32fcef)
2008-05-28 22:44:20 +10:00
Andrew Tridgell
6b70726305 implement the documented SMB2 create blobs in the server
Not all of them are honoured yet, but they are all parsed and the ones
that have SMB equivalents are honoured
(This used to be commit 9fc70e2ed6)
2008-05-28 16:28:37 +10:00
Andrew Tridgell
cb36437db2 added support for the output fields of SMB2 close
(This used to be commit 2633bc7497)
2008-05-27 16:43:36 +10:00
Andrew Tridgell
46e64417a3 another attempt at the damn SEC_STD_SYNCHRONIZE flag
(This used to be commit 2ac27bfffa)
2008-05-27 16:02:27 +10:00
Andrew Tridgell
cf274201b4 disable the SEC_STD_SYNCHRONIZE test until we know what it means
(This used to be commit 897f4582be)
2008-05-27 15:27:25 +10:00
Andrew Tridgell
65e31a965e make the SEC_STD_SYNCHRONIZE test more specific
(This used to be commit 8c263f91bd)
2008-05-27 14:59:55 +10:00
Andrew Tridgell
6e265867ff SEC_STD_SYNCHRONIZE is only invalid on SMB2
(This used to be commit 067f1271ad)
2008-05-27 14:30:42 +10:00
Andrew Tridgell
f0b4b15f64 check for some more invalid bits in smb2 create
(This used to be commit dcdaa9f5fd)
2008-05-27 14:07:11 +10:00
Andrew Tridgell
2ad2bdda89 stricter checks for valid inputs in SMB2 open and lock
(This used to be commit a7b5689a73)
2008-05-26 15:02:43 +10:00
Stefan Metzmacher
5d648b4aa5 pvfs_open: return FILE_IS_A_DIRECTORY when opening a stream on a directory
metze
(This used to be commit 1421b1cc0c)
2008-05-23 09:55:15 +02:00
Andrew Tridgell
7a9ffeca21 check for invalid file attribute values in create
(This used to be commit dd21e3d9d7)
2008-05-22 17:53:50 +10:00
Andrew Tridgell
2352602a57 check the creation options where the client can require a path to be a
file or a directory
(This used to be commit c05b58940f)
2008-05-20 11:58:47 +10:00
Stefan Metzmacher
3e80085fb0 pvfs: remove XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME code
I'll fix this more correctly very soon,
so that we'll pass the BASE-DELAYWRITE test.

metze
(This used to be commit b09dd6b65d)
2008-05-07 15:46:22 +02:00
Stefan Metzmacher
e76c8aa097 pvfs_open: set h->have_opendb_entry directly after odb_open_file()
Otherwise we may not clean up in the destructor.

metze
(This used to be commit 218ec98a16)
2008-03-15 12:36:20 +01:00
Stefan Metzmacher
74d940ca57 pvfs_open: the pvfs_odb_retry structs need to be children of the request
Otherwise they're not cleaned up when the request is finished.

metze
(This used to be commit 055760f0f4)
2008-03-15 12:35:04 +01:00
Stefan Metzmacher
50243cdbbd pvfs_open: retry pvfs_open() after an EGAIN or EWOULDBLOCK from open()
In case a unix application as an oplock or share mode on
a file we need to retry periodicly as there's no way
to get a notification from the kernel when the oplock
is released.

metze
(This used to be commit 4d40f3a026)
2008-03-12 17:35:07 +01:00