]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: consistently assert regular files for Durable Handles
authorRalph Boehme <slow@samba.org>
Wed, 3 Jun 2026 13:24:36 +0000 (15:24 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:36 +0000 (10:18 +0000)
We already check this this way when reconnecting a handle.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/durable.c

index 22479ba56ec31e9ff7f4ab3b64d2a8c970f60961..44c9bd1bd2bba097371820b97c242281bf09b7bb 100644 (file)
@@ -71,7 +71,8 @@ NTSTATUS vfs_default_durable_cookie(struct files_struct *fsp,
                return NT_STATUS_NOT_SUPPORTED;
        }
 
-       if (fsp->fsp_flags.is_directory) {
+       if (!S_ISREG(fsp->fsp_name->st.st_ex_mode)) {
+               /* We only support Durable Handles on regular files */
                return NT_STATUS_NOT_SUPPORTED;
        }