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

3138 Commits

Author SHA1 Message Date
Jeremy Allison
76b9a3597c s3: smbd: Remove all references to fsp->deferred_close.
We are now free to remove it from struct files_struct.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-23 09:40:45 +00:00
Jeremy Allison
9a5b79c663 Revert "s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pread_state."
This reverts commit 594a435b33.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:31 +00:00
Jeremy Allison
43d5d9b020 Revert "s3: VFS: vfs_default. Pass in struct vfswrap_pread_state as the callback data to the subreq."
This reverts commit e102908f11.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:31 +00:00
Jeremy Allison
ce0235be27 Revert "s3: VFS: vfs_default. Protect vfs_pread_done() from accessing a freed req pointer."
This reverts commit b9ad06079f.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:31 +00:00
Jeremy Allison
6041a93612 Revert "s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pwrite_state."
This reverts commit 86cc743950.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:31 +00:00
Jeremy Allison
a6c186b683 Revert "s3: VFS: vfs_default. Pass in struct vfswrap_pwrite_state as the callback data to the subreq."
This reverts commit 13e25d6838.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:31 +00:00
Jeremy Allison
106f83e6d8 Revert "s3: VFS: vfs_default. Protect vfs_pwrite_done() from accessing a freed req pointer."
This reverts commit c8cd93dd54.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:31 +00:00
Jeremy Allison
ddd14d36f6 Revert "s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_fsync_state."
This reverts commit 4adde71b99.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:31 +00:00
Jeremy Allison
22ebf32f3e Revert "s3: VFS: vfs_default. Pass in struct vfswrap_fsync_state as the callback data to the subreq."
This reverts commit d623779913.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
27e1bfcecc Revert "s3: VFS: vfs_default. Protect vfs_fsync_done() from accessing a freed req pointer."
This reverts commit 18671534e4.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
7acec67ad4 Revert "s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pread_state."
This reverts commit 0e3dc0078e.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
097e48fa2c Revert "s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pread_state as the callback data to the subreq."
This reverts commit c6c4e2de22.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
e189d707fe Revert "s3: VFS: vfs_glusterfs. Protect vfs_gluster_pread_done() from accessing a freed req pointer."
This reverts commit 99283871c5.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
d9b00159a6 Revert "s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pwrite_state."
This reverts commit 058a7effd0.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
e8c0bdb423 Revert "s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pwrite_state as the callback data to the subreq."
This reverts commit 3357a77d08.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
f2d5e1a8c6 Revert "s3: VFS: vfs_glusterfs. Protect vfs_gluster_pwrite_done() from accessing a freed req pointer."
This reverts commit 67910c751c.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
aac2993000 Revert "s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_fsync_state."
This reverts commit c0c088b1b7.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
a4e51f2681 Revert "s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_fsync_state as the callback data to the subreq."
This reverts commit cdde55a69d.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
3616d399ef Revert "s3: VFS: vfs_glusterfs. Protect vfs_gluster_fsync_done() from accessing a freed req pointer."
This reverts commit 9ecbda263f.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
626b2b0e3d Revert "vfs_default: pass in state as the callback data to the subreq"
This reverts commit 0e894f3e48.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
1a52e63503 Revert "vfs_default: Protect vfs_getxattrat_done() from accessing a freed req pointer"
This reverts commit 95cfcda13f.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:30 +00:00
Jeremy Allison
4287ea138e s3: smbd: Every place we check fsp->deferred_close, also check for fsp->closing.
Eventually this will allow us to remove fsp->deferred_close
from the fsp struct (and also source3/lib/tevent_wait.[ch]).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-18 18:03:28 +00:00
Ralph Boehme
95cfcda13f vfs_default: Protect vfs_getxattrat_done() from accessing a freed req pointer
If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the request is in
flight (share forced closed by smbcontrol), then we set state->req = NULL in the
state destructor.

The existing state destructor prevents the state memory from being freed, so
when the thread completes and calls vfs_getxattrat_done(), just throw away the result
if state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-09 18:07:34 +00:00
Ralph Boehme
0e894f3e48 vfs_default: pass in state as the callback data to the subreq
Find the req we're finishing off by looking inside the state.  In a shutdown
close the caller calls talloc_free(req), so we can't access it directly as
callback data.

The next commit will NULL out the state->req pointer when a caller calls
talloc_free(req), and the request is still in flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-03-09 18:07:34 +00:00
Ralph Boehme
f92af66190 vfs_recycle: prevent flooding the log if we're called on non-existant paths
vfs_recycle is assuming that any path passed to unlink must exist, otherwise it
logs this error. Turn this into a DEBUG level message.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14316
See also: https://bugzilla.redhat.com/show_bug.cgi?id=1780802

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>

Autobuild-User(master): Isaac Boukris <iboukris@samba.org>
Autobuild-Date(master): Mon Mar  9 14:15:06 UTC 2020 on sn-devel-184
2020-03-09 14:15:06 +00:00
Jeremy Allison
6b567e0c13 s3: VFS: vfs_aio_pthread: Make aio opens safe against connection teardown.
Allocate state off fsp->conn, not NULL, and add a destructor
that catches deallocation of conn which happens
on connection shutdown or force close.

Note - We don't allocate off fsp as the passed in
fsp will get freed once we return EINPROGRESS/NT_STATUS_MORE_PROCESSING_REQUIRED.
A new fsp pointer gets allocated on every re-run of the
open code path.

The destructor allows us to NULL out the saved conn struct pointer
when conn is deallocated so we know not to access deallocated memory.
This matches the async teardown code changes for bug #14301
in pread/pwrite/fsync vfs_default.c and vfs_glusterfs.c

state is still correctly deallocated in all code
paths so no memory leaks.

This allows us to safely complete when the openat()
returns and then return the error NT_STATUS_NETWORK_NAME_DELETED
to the client open request.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
e566066605 s3: VFS: vfs_aio_pthread: Add a talloc context parameter to create_private_open_data().
Pass in NULL for now so no behavior change.
We will be changing this from NULL to fsp->conn in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
ddb9038fe7 s3: VFS: vfs_aio_pthread. Move xconn into state struct (opd).
We will need this in future to cause a pending open to
be rescheduled after the connection struct we're using
has been shut down with an aio open in flight. This will
allow a correct error reply to an awaiting client.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
8db831a318 s3: VFS: vfs_aio_pthread: Replace state destructor with explicitly called teardown function.
This will allow repurposing a real destructor to allow
connections structs to be freed whilst the aio open
request is in flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
a1e247c3ba s3: VFS: vfs_aio_pthread. Fix leak of state struct on error.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
9ecbda263f s3: VFS: vfs_glusterfs. Protect vfs_gluster_fsync_done() from accessing a freed req pointer.
If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_gluster_fsync_done(), just throw away the result if
state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
cdde55a69d s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_fsync_state as the callback data to the subreq.
Find the req we're finishing off by looking inside vfs_gluster_fsync_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfs_gluster_fsync_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
c0c088b1b7 s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_fsync_state.
We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
67910c751c s3: VFS: vfs_glusterfs. Protect vfs_gluster_pwrite_done() from accessing a freed req pointer.
If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_gluster_pwrite_done(), just throw away the result if
state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
3357a77d08 s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pwrite_state as the callback data to the subreq.
Find the req we're finishing off by looking inside vfs_gluster_pwrite_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfs_gluster_pwrite_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
058a7effd0 s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pwrite_state.
We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
99283871c5 s3: VFS: vfs_glusterfs. Protect vfs_gluster_pread_done() from accessing a freed req pointer.
If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_gluster_pread_done(), just throw away the result if
state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:44 +00:00
Jeremy Allison
c6c4e2de22 s3: VFS: vfs_glusterfs. Pass in struct vfs_gluster_pread_state as the callback data to the subreq.
Find the req we're finishing off by looking inside vfs_gluster_pread_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfs_gluster_pread_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
0e3dc0078e s3: VFS: vfs_glusterfs: Add tevent_req pointer to state struct in vfs_gluster_pread_state.
We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
18671534e4 s3: VFS: vfs_default. Protect vfs_fsync_done() from accessing a freed req pointer.
If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_fsync_done(), just throw away the result if
state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
d623779913 s3: VFS: vfs_default. Pass in struct vfswrap_fsync_state as the callback data to the subreq.
Find the req we're finishing off by looking inside vfswrap_fsync_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfswrap_fsync_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
4adde71b99 s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_fsync_state.
We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
c8cd93dd54 s3: VFS: vfs_default. Protect vfs_pwrite_done() from accessing a freed req pointer.
If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_pwrite_done(), just throw away the result if
state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
13e25d6838 s3: VFS: vfs_default. Pass in struct vfswrap_pwrite_state as the callback data to the subreq.
Find the req we're finishing off by looking inside vfswrap_pwrite_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfswrap_pwrite_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
86cc743950 s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pwrite_state.
We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
b9ad06079f s3: VFS: vfs_default. Protect vfs_pread_done() from accessing a freed req pointer.
If the fsp is forced closed by a SHUTDOWN_CLOSE whilst the
request is in flight (share forced closed by smbcontrol),
then we set state->req = NULL in the state destructor.

The existing state destructor prevents the state memory
from being freed, so when the thread completes and calls
vfs_pread_done(), just throw away the result if
state->req == NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
e102908f11 s3: VFS: vfs_default. Pass in struct vfswrap_pread_state as the callback data to the subreq.
Find the req we're finishing off by looking inside vfswrap_pread_state.
In a shutdown close the caller calls talloc_free(req), so we can't
access it directly as callback data.

The next commit will NULL out the vfswrap_pread_state->req pointer
when a caller calls talloc_free(req), and the request is still in
flight.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Jeremy Allison
594a435b33 s3: VFS: vfs_default: Add tevent_req pointer to state struct in vfswrap_pread_state.
We will need this to detect when this request is outstanding but
has been destroyed in a SHUTDOWN_CLOSE on this file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-03-08 18:07:43 +00:00
Art M. Gallagher
b0ba7cd4f9 vfs_fruit: tmsize prevent overflow Force the type during arithmetic in order to prevent overflow when summing the Time Machine folder size. Increase the precision to off_t (used for file sizes), leave the overflow error traps but with more precise wording.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13622
Signed-off-by: Art M. Gallagher <smblock@artmg.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar  7 01:37:31 UTC 2020 on sn-devel-184
2020-03-07 01:37:31 +00:00
Ralph Boehme
f89c7ad851 smbd: ignore set NTACL requests which contain S-1-5-88 NFS ACEs
We apply the same "ignore" logic already in the POSIX ACL code and in the
vfs_acl_xattr|tdb VFS modules to smb_set_nt_acl_nfs4() in the nfs4_acl helper
subsystem which is common to a bunch of VFS modules: GPFS, ZFS, NFS4_xattr and
aixacl2.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14307

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar  3 19:15:10 UTC 2020 on sn-devel-184
2020-03-03 19:15:10 +00:00