The Samba-Bugzilla – Attachment 18951 Details for
Bug 15991
samba not triggering mount of zfs snapshot in dataset .zfs/snapshots/<snapname> directory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
4.24 patch
15991-4.24.patch (text/plain), 4.02 KB, created by
Pavel Filipenský
on 2026-04-28 09:10:24 UTC
(
hide
)
Description:
4.24 patch
Filename:
MIME Type:
Creator:
Pavel Filipenský
Created:
2026-04-28 09:10:24 UTC
Size:
4.02 KB
patch
obsolete
>From 7ec721c0e142da2f94201a4abbd41839c7b55f85 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Pavel=20Filipensk=C3=BD?= <pfilipensky@samba.org> >Date: Tue, 7 Apr 2026 16:28:05 +0200 >Subject: [PATCH] smbdotconf: Add "automount fs types" to smb.conf >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This adds a new global parameter "automount fs types" that allows >administrators to configure additional filesystem types that should >trigger automounting, beyond the always-supported autofs filesystem. > >To enable 'samba unaware FS' automounting, add: > > automount fs types = 0x12345678 > >This allows e.g. ZFS snapshots in <dataset root>/.zfs/snapshot to be >mounted. To find out the magic number that is not listed >in /usr/include/linux/magic.h, run: > > stat -f -c '0x%t' /path/to/mountpoint > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15991 > >Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> >Reviewed-by: Samuel Cabrero <scabrero@samba.org> > >Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org> >Autobuild-Date(master): Mon Apr 20 19:57:42 UTC 2026 on atb-devel-224 > >(cherry picked from commit 45b6cd3852949e74ea4a26e5d5e9c0eee97c3b27) >--- > docs-xml/smbdotconf/misc/automountfstypes.xml | 24 ++++++++++++++ > source3/smbd/open.c | 31 +++++++++++++++++++ > 2 files changed, 55 insertions(+) > create mode 100644 docs-xml/smbdotconf/misc/automountfstypes.xml > >diff --git a/docs-xml/smbdotconf/misc/automountfstypes.xml b/docs-xml/smbdotconf/misc/automountfstypes.xml >new file mode 100644 >index 00000000000..4c5bc510520 >--- /dev/null >+++ b/docs-xml/smbdotconf/misc/automountfstypes.xml >@@ -0,0 +1,24 @@ >+<samba:parameter name="automount fs types" >+ context="G" >+ type="cmdlist" >+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> >+<description> >+ <para>This parameter specifies a list of additional filesystem magic numbers >+ that should trigger automounting when accessed.</para> >+ >+ <para>The values should be specified as hexadecimal numbers (with or without >+ 0x prefix), separated by spaces or commas.</para> >+ >+ <para>Note: This parameter is only available on Linux systems.</para> >+ >+ <para>To find the filesystem magic number for a mounted filesystem, >+ consult /usr/include/linux/magic.h or call: >+ <command>stat -f -c '0x%t' /path/to/mountpoint</command></para> >+ >+ <para>Note: autofs (0x187) is always checked and does not need to be included >+ in this list.</para> >+</description> >+ >+<value type="default"></value> >+<value type="example">0xA0B0C0D0 0x12345678</value> >+</samba:parameter> >diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index 8a52cbd6850..c8c2a520aa4 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -42,6 +42,7 @@ > #include "locking/leases_db.h" > #include "librpc/gen_ndr/ndr_leases_db.h" > #include "lib/util/time_basic.h" >+#include "lib/util/smb_strtox.h" > #include "source3/smbd/dir.h" > > #if defined(HAVE_LINUX_MAGIC_H) >@@ -877,6 +878,8 @@ static bool fsp_is_automount_mountpoint(struct files_struct *fsp, int old_fd) > #if defined(HAVE_FSTATFS) && defined(HAVE_LINUX_MAGIC_H) > struct statfs sbuf = {}; > int ret; >+ const char **fs_types_list = NULL; >+ int i; > > if (!S_ISDIR(fsp->fsp_name->st.st_ex_mode)) { > return false; >@@ -890,6 +893,34 @@ static bool fsp_is_automount_mountpoint(struct files_struct *fsp, int old_fd) > if (sbuf.f_type == AUTOFS_SUPER_MAGIC) { > return true; > } >+ >+ /* Check for additional filesystem types from configuration */ >+ fs_types_list = lp_automount_fs_types(); >+ if (fs_types_list == NULL) { >+ return false; >+ } >+ >+ for (i = 0; fs_types_list[i] != NULL; i++) { >+ unsigned long long fs_type_val; >+ int error = 0; >+ >+ fs_type_val = smb_strtoull(fs_types_list[i], >+ NULL, >+ 0, >+ &error, >+ SMB_STR_FULL_STR_CONV); >+ if (error != 0) { >+ DBG_WARNING( >+ "Invalid value in 'automount fs types': %s\n", >+ fs_types_list[i]); >+ continue; >+ } >+ >+ if (sbuf.f_type == fs_type_val) { >+ return true; >+ } >+ } >+ > return false; > #else > return false; >-- >2.53.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
asn
:
review+
Actions:
View
Attachments on
bug 15991
:
18822
|
18824
| 18951