From: Volker Lendecke Date: Sat, 13 Sep 2025 10:20:34 +0000 (+0200) Subject: smbd: Slightly simplify smbd_do_qfilepathinfo() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46bc039d98df812232e13741a36af575731b221f;p=thirdparty%2Fsamba.git smbd: Slightly simplify smbd_do_qfilepathinfo() Use metadata_fsp() instead of explicitly checking fsp->base_fsp Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 9f60fa3e05b..8d52e31c4f5 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -2975,7 +2975,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, unsigned int data_size; struct timespec create_time_ts, mtime_ts, atime_ts, ctime_ts; SMB_STRUCT_STAT *psbuf = NULL; - SMB_STRUCT_STAT *base_sp = NULL; + struct files_struct *base_fsp = NULL; char *p; char *base_name; char *dos_fname; @@ -3018,9 +3018,6 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, mode = fdos_mode(fsp); psbuf = &smb_fname->st; - base_sp = (fsp->base_fsp != NULL) ? &fsp->base_fsp->fsp_name->st - : &fsp->fsp_name->st; - nlink = psbuf->st_ex_nlink; if (nlink && (mode&FILE_ATTRIBUTE_DIRECTORY)) { @@ -3120,7 +3117,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, I think this causes us to fail the IFSKIT BasicFileInformationTest. -tpot */ - file_id = SMB_VFS_FS_FILE_ID(conn, base_sp); + base_fsp = metadata_fsp(fsp); + file_id = SMB_VFS_FS_FILE_ID(conn, &base_fsp->fsp_name->st); *fixed_portion = 0;