This simplifies the two mode_fn()s we have.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
get_dosmode = false;
}
+ /*
+ * openat_pathref_fsp() filled atname->st, but from
+ * now on we're working with smb_fname. Keep the stat
+ * info for mode_fn's use.
+ */
+ smb_fname->st = atname->st;
+
status = move_smb_fname_fsp_link(smb_fname, atname);
if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("Failed to move pathref for [%s]: %s\n",
bool get_dosmode,
uint32_t *_mode)
{
- connection_struct *conn = (connection_struct *)private_data;
-
- if (!VALID_STAT(smb_fname->st)) {
- if ((SMB_VFS_STAT(conn, smb_fname)) != 0) {
- DEBUG(5,
- ("smbd_dirptr_8_3_mode_fn: "
- "Couldn't stat [%s]. Error "
- "= %s\n",
- smb_fname_str_dbg(smb_fname),
- strerror(errno)));
- return false;
- }
- }
-
if (get_dosmode) {
*_mode = fdos_mode(smb_fname->fsp);
smb_fname->st = smb_fname->fsp->fsp_name->st;
{
struct smbd_dirptr_lanman2_state *state =
(struct smbd_dirptr_lanman2_state *)private_data;
- bool ms_dfs_link = false;
if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
if (SMB_VFS_LSTAT(state->conn, smb_fname) != 0) {
return true;
}
- if (!VALID_STAT(smb_fname->st) &&
- SMB_VFS_STAT(state->conn, smb_fname) != 0) {
+ if (S_ISLNK(smb_fname->st.st_ex_mode)) {
/* Needed to show the msdfs symlinks as
* directories */
- ms_dfs_link = check_msdfs_link(dirfsp,
- atname,
- smb_fname);
+ bool ms_dfs_link = check_msdfs_link(dirfsp, atname, smb_fname);
if (!ms_dfs_link) {
DEBUG(5,("smbd_dirptr_lanman2_mode_fn: "
"Couldn't stat [%s] (%s)\n",