Skip to content

Commit

Permalink
NAS-115956/ 22.02 / s3:modules - properly clean up temp pathref fsps
Browse files Browse the repository at this point in the history
In certain situations where modules were generating temporary
files structs for at-based syscalls, we weren't fully freeing
all resources related to the temporary file. Ensure we
properly decref files count and adjust fsp list prior to
freeing the temporary fsp.
  • Loading branch information
anodos325 committed Apr 28, 2022
1 parent 0f6586d commit f7a0e4d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions source3/modules/vfs_winmsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static NTSTATUS winmsa_inherit_acl(vfs_handle_struct *handle,
}

status = fd_close(tmp_fsp);
file_free(NULL, tmp_fsp);
return status;
}

Expand Down
1 change: 1 addition & 0 deletions source3/modules/vfs_zfs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ static bool zfs_inherit_acls(vfs_handle_struct *handle,
}

fd_close(pathref);
file_free(NULL, pathref);
pathref = c_fsp;
}
error = chdir(handle->conn->connectpath);
Expand Down
1 change: 0 additions & 1 deletion source3/smbd/smbXsrv_tcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,6 @@ NTSTATUS smbXsrv_tcon_disconnect(struct smbXsrv_tcon *tcon, uint64_t vuid)
tcon->global->share_name,
nt_errstr(status)));

close_cnum(tcon->compat, vuid);
tcon->compat = NULL;
return status;
}
Expand Down

0 comments on commit f7a0e4d

Please sign in to comment.