--- /dev/null
+<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>
#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)
#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;
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;