[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Thu Apr 9 21:22:03 UTC 2020


The branch, master has been updated
       via  c4176b1cea4 Update WHATSNEW.txt to explain the vfs_widelinks module addition.
       via  27d362c6cdc docs-xml: Add a vfs_widelinks manpage.
       via  8ec68cdfc46 s3: smbd: Reformatting - fix indentation in fd_open().
       via  8e1524945ca s3: smbd: Reformatting - fix indentation in check_reduced_name().
       via  78a25320dce s3: smbd: Always call canonicalize_connect_path() for a share.
       via  9eac2320126 s3: smbd: Always call canonicalize_connect_path() for a (synthesized) msdfs-share.
       via  d803d66b3c2 s3: smbd: Remove allowing widelinks in fd_open path.
       via  47b7f3319e4 s3: VFS: Remove the lp_widelinks() check from check_reduced_name().
       via  886d2c09b84 s3: smbd: VFS: Add custom initialization for vfs_widelinks.
       via  f7fe3474298 s3: VFS: Add cmocka tests for pathname parsing in vfs_widelinks.
       via  8197fc07b42 VFS: Add vfs_widelinks module.
      from  03f79a3bd71 s3:rpc_server: Improve local dispatching

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c4176b1cea4dc55c8c438cc2522f128e7d9f354b
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Apr 7 09:58:08 2020 -0700

    Update WHATSNEW.txt to explain the vfs_widelinks module addition.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Thu Apr  9 21:21:46 UTC 2020 on sn-devel-184

commit 27d362c6cdca0c97cb48aeafc18872d2e0b001d0
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Apr 7 09:47:46 2020 -0700

    docs-xml: Add a vfs_widelinks manpage.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 8ec68cdfc46fc66e822f4a11ad7bf5c28d537f01
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 17:44:56 2020 -0700

    s3: smbd: Reformatting - fix indentation in fd_open().
    
    Now we removed the lp_widelinks() clause we
    left an extra {..} level of indirection. Just
    reformat to remove it. No logic changes.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 8e1524945ca2fd2d8e7520c0c42ef5f664d832f6
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 17:41:42 2020 -0700

    s3: smbd: Reformatting - fix indentation in check_reduced_name().
    
    Now we removed the lp_widelinks() clause we
    left an extra {..} level of indirection. Just
    reformat to remove it and update to modern
    DBG_ macros. No logic changes
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 78a25320dcef958cb6515599275ae47ccba55e40
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 17:36:44 2020 -0700

    s3: smbd: Always call canonicalize_connect_path() for a share.
    
    Share path definitions don't need to be aware of symlinks.
    
    This is strictly a change in behavior, but the vfs_widelinks
    module (if loaded) copes with symlinks in the share definition.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 9eac23201268a23a43d6bcfbbf5a7368169ccec4
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 17:34:22 2020 -0700

    s3: smbd: Always call canonicalize_connect_path() for a (synthesized) msdfs-share.
    
    Share path definitions don't need to be aware of symlinks.
    
    This is strictly a change in behavior, but the vfs_widelinks
    module (if loaded) copes with symlinks in the share definition.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit d803d66b3c2365dee174a456ce38c5c2cd2c7cc3
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 17:33:17 2020 -0700

    s3: smbd: Remove allowing widelinks in fd_open path.
    
    Widelinks are now always denied, unless the vfs_widelinks
    VFS module is loaded.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 47b7f3319e4ad9bc25eea151d3209d387c1decc6
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 17:31:16 2020 -0700

    s3: VFS: Remove the lp_widelinks() check from check_reduced_name().
    
    Widelinks are now always denied, unless the vfs_widelinks
    VFS module is loaded.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 886d2c09b84787062c98e26dfccceaba6420cf6c
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 17:24:10 2020 -0700

    s3: smbd: VFS: Add custom initialization for vfs_widelinks.
    
    As the widelinks logic is now moving into a
    vfs_widelinks module, we need to custom load
    it after the default module is initialized.
    That way no changes to smb.conf files are
    needed.
    
    We may revisit this for Samba 5.0 and force
    people to change their smb.conf files and
    explicitly load this as a vfs module if they
    want the insecure widelinks behavior.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit f7fe3474298370f592bd06e064712e60cb6181cf
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 6 12:18:50 2020 -0700

    s3: VFS: Add cmocka tests for pathname parsing in vfs_widelinks.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 8197fc07b425735554d17205feb78519278fc3f0
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 3 18:24:42 2020 -0700

    VFS: Add vfs_widelinks module.
    
    Hides symlinks from smbd. Will be used to replace
    the lp_widelinks() code inside smbd.
    
    Long description of how this module works
    with notes is included.
    
    The man page and WHATSNEW.txt update is done
    in a later patch in this series.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 WHATSNEW.txt                          |  24 ++
 docs-xml/manpages/vfs_widelinks.8.xml |  90 ++++++
 docs-xml/wscript_build                |   1 +
 source3/modules/test_vfs_widelinks.c  |  88 ++++++
 source3/modules/vfs_widelinks.c       | 545 ++++++++++++++++++++++++++++++++++
 source3/modules/wscript_build         |  12 +
 source3/selftest/tests.py             |   4 +
 source3/smbd/msdfs.c                  |  12 +-
 source3/smbd/open.c                   |  69 ++---
 source3/smbd/service.c                |  20 +-
 source3/smbd/vfs.c                    | 177 +++++------
 source3/wscript                       |   2 +-
 12 files changed, 908 insertions(+), 136 deletions(-)
 create mode 100644 docs-xml/manpages/vfs_widelinks.8.xml
 create mode 100644 source3/modules/test_vfs_widelinks.c
 create mode 100644 source3/modules/vfs_widelinks.c


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index e9b269209f0..e47f0806332 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -27,6 +27,30 @@ we test with in our CI infrastructure.
 (Build time support for the file server with Python 2.6 has not
 changed)
 
+wide links functionality
+------------------------
+
+For this release, the code implementing the insecure "wide links = yes"
+functionality has been moved out of the core smbd code and into a separate
+VFS module, vfs_widelinks. Currently this vfs module is implicitly loaded
+by smbd as the last but one module before vfs_default if "wide links = yes"
+is enabled on the share (note, the existing restrictions on enabling wide
+links around the SMB1 "unix extensions" and the "allow insecure wide links"
+parameters are still in force). The implicit loading was done to allow
+existing users of "wide links = yes" to keep this functionality without
+having to make a change to existing working smb.conf files.
+
+Please note that the Samba developers recommend changing any Samba
+installations that currently use "wide links = yes" to use bind mounts
+as soon as possible, as "wide links = yes" is an inherently insecure
+configuration which we would like to remove from Samba. Moving the
+feature into a VFS module allows this to be done in a cleaner way
+in future.
+
+A future release to be determined will remove this implicit linkage,
+causing administrators who need this functionality to have to explicitly
+add the vfs_widelinks module into the "vfs objects =" parameter lists.
+The release notes will be updated to note this change when it occurs.
 
 REMOVED FEATURES
 ================
diff --git a/docs-xml/manpages/vfs_widelinks.8.xml b/docs-xml/manpages/vfs_widelinks.8.xml
new file mode 100644
index 00000000000..b8973701d23
--- /dev/null
+++ b/docs-xml/manpages/vfs_widelinks.8.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<refentry id="vfs_widelinks.8">
+
+<refmeta>
+	<refentrytitle>vfs_widelinks</refentrytitle>
+	<manvolnum>8</manvolnum>
+	<refmiscinfo class="source">Samba</refmiscinfo>
+	<refmiscinfo class="manual">System Administration tools</refmiscinfo>
+	<refmiscinfo class="version">&doc.version;</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+	<refname>vfs_widelinks</refname>
+	<refpurpose>make a Samba share ignore filesystem symbolic links inside a share</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+	<cmdsynopsis>
+		<command>vfs objects = widelinks</command>
+	</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1>
+	<title>DESCRIPTION</title>
+
+	<para>This VFS module is part of the
+	<citerefentry><refentrytitle>samba</refentrytitle>
+	<manvolnum>7</manvolnum></citerefentry> suite.</para>
+
+	<para>The <command>vfs_widelinks</command> VFS module
+	hides the existence of symbolic links in the filesystem
+	inside a share. It is used in Samba verson 4.13 and above
+	to implement the <filename>smb.conf</filename>"wide links = yes"
+	functionality that used to be inside the core smbd code.
+	The module should not be loaded explicitly by smb.conf
+	as part of the "vfs objects =" parameter, but is loaded
+	implicitly when "wide links = yes" is enabled. This is
+	to prevent existing smb.conf files from having to be
+	modified to keep the existing insecure "wide links"
+	functionality on a share.
+	</para>
+	<para>Please note that "wide links = yes" functionality
+	is a deliberately insecure option, and should never be
+	used in Samba installations. On Linux, bind mounts can
+	be used instead to implement anything "wide links = yes"
+	can enable. This module has been created to provide
+	backwards compatibility with existing users of
+	"wide links = yes" installations, but this use cannot be
+	recommended and is not endorsed by the Samba developers.
+	</para>
+	<para>Note that this implicit loading may become explicit
+	in a later Samba release, and administrators wishing to
+	keep the insecure "wide links" functionality may have
+	to add this module into their "vfs objects =" module
+	list. The Samba project release notes and this manpage
+	will be updated to reflect this when this change is made.
+	</para>
+
+	<para>This module is stackable.</para>
+
+</refsect1>
+
+<refsect1>
+	<title>EXAMPLES</title>
+
+	<para>No examples listed. This module is implicitly loaded
+	by smbd as needed.
+	</para>
+</refsect1>
+
+<refsect1>
+	<title>VERSION</title>
+
+	<para>This man page is part of version &doc.version; of the Samba suite.
+	</para>
+</refsect1>
+
+<refsect1>
+	<title>AUTHOR</title>
+
+	<para>The original Samba software and related utilities
+	were created by Andrew Tridgell. Samba is now developed
+	by the Samba Team as an Open Source project similar
+	to the way the Linux kernel is developed.</para>
+
+</refsect1>
+
+</refentry>
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index 21158e11fe7..9f87e86272b 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -108,6 +108,7 @@ vfs_module_manpages = ['vfs_acl_tdb',
                        'vfs_tsmsm',
                        'vfs_unityed_media',
                        'vfs_virusfilter',
+                       'vfs_widelinks',
                        'vfs_worm',
                        'vfs_xattr_tdb',
                        'vfs_zfsacl' ]
diff --git a/source3/modules/test_vfs_widelinks.c b/source3/modules/test_vfs_widelinks.c
new file mode 100644
index 00000000000..c6055c8c17c
--- /dev/null
+++ b/source3/modules/test_vfs_widelinks.c
@@ -0,0 +1,88 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *
+ *  Unit test for widelinks path validator.
+ *
+ *  Copyright (C) Jeremy Allison 2020
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Needed for static build to complete... */
+#include "includes.h"
+#include "smbd/smbd.h"
+NTSTATUS vfs_widelinks_init(TALLOC_CTX *ctx);
+
+#include "vfs_widelinks.c"
+#include <cmocka.h>
+
+struct str_test_values {
+	const char *src_str;
+	const char *dst_str;
+} ;
+
+/* As many nasty edge cases as I can think of.. */
+
+static struct str_test_values examples[] = {
+	{ "/", "/" },
+	{ "/../../", "/" },
+	{ "/foo/../", "/" },
+	{ "/./././", "/" },
+	{ "/./././.", "/" },
+	{ "/.../././.", "/..." },
+	{ "/./././.foo", "/.foo" },
+	{ "/./././.foo.", "/.foo." },
+	{ "/./././foo.", "/foo." },
+	{ "/foo/bar/..", "/foo" },
+	{ "/foo/bar/../baz/", "/foo/baz" },
+	{ "////////////////", "/" },
+	{ "/////////./././././.", "/" },
+	{ "/./.././../.boo/../baz", "/baz" },
+	{ "/a/component/path", "/a/component/path" },
+	{ "/a/component/path/", "/a/component/path" },
+	{ "/a/component/path/..", "/a/component" },
+	{ "/a/component/../path/", "/a/path" },
+	{ "///a/./././///component/../////path/", "/a/path" }
+};
+
+/*
+ * Test our realpath resolution code.
+ */
+static void test_resolve_realpath_name(void **state)
+{
+	unsigned i;
+	TALLOC_CTX *frame = talloc_stackframe();
+
+	for (i = 0; i < ARRAY_SIZE(examples); i++) {
+		char *test_dst = resolve_realpath_name(frame,
+					examples[i].src_str);
+		if (test_dst == NULL) {
+			fail();
+		}
+		assert_string_equal(test_dst, examples[i].dst_str);
+		TALLOC_FREE(test_dst);
+	}
+	TALLOC_FREE(frame);
+}
+
+int main(int argc, char **argv)
+{
+	const struct CMUnitTest tests[] = {
+		cmocka_unit_test(test_resolve_realpath_name),
+	};
+
+	cmocka_set_message_output(CM_OUTPUT_SUBUNIT);
+
+	return cmocka_run_group_tests(tests, NULL, NULL);
+}
diff --git a/source3/modules/vfs_widelinks.c b/source3/modules/vfs_widelinks.c
new file mode 100644
index 00000000000..9a005c9ce3f
--- /dev/null
+++ b/source3/modules/vfs_widelinks.c
@@ -0,0 +1,545 @@
+/*
+ * Widelinks VFS module. Causes smbd not to see symlinks.
+ *
+ * Copyright (C) Jeremy Allison, 2020
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ What does this module do ? It implements the explicitly insecure
+ "widelinks = yes" functionality that used to be in the core smbd
+ code.
+
+ Now this is implemented here, the insecure share-escape code that
+ explicitly allows escape from an exported share path can be removed
+ from smbd, leaving it a cleaner and more maintainable code base.
+
+ The smbd code can now always return ACCESS_DENIED if a path
+ leads outside a share.
+
+ How does it do that ? There are 2 features.
+
+ 1). When the upper layer code does a chdir() call to a pathname,
+ this module stores the requested pathname inside config->cwd.
+
+ When the upper layer code does a getwd() or reapath(), we return
+ the absolute path of the value stored in config->cwd, *not* the
+ position on the underlying filesystem.
+
+ This hides symlinks as if the chdir pathname contains a symlink,
+ normally doing a realpath call on it would return the real
+ position on the filesystem. For widelinks = yes, this isn't what
+ you want. You want the position you think is underneath the share
+ definition - the symlink path you used to go outside the share,
+ not the contents of the symlink itself.
+
+ That way, the upper layer smbd code can strictly enforce paths
+ being underneath a share definition without the knowledge that
+ "widelinks = yes" has moved us outside the share definition.
+
+ 1a). Note that when setting up a share, smbd may make calls such
+ as realpath and stat/lstat in order to set up the share definition.
+ These calls are made *before* smbd calls chdir() to move the working
+ directory below the exported share definition. In order to allow
+ this, all the vfs_widelinks functions are coded to just pass through
+ the vfs call to the next module in the chain if (a). The widelinks
+ module was loaded in error by an administrator and widelinks is
+ set to "no". This is the:
+
+	if (!config->active) {
+		Module not active.
+		SMB_VFS_NEXT_XXXXX(...)
+	}
+
+ idiom in the vfs functions.
+
+ 1b). If the module was correctly active, but smbd has yet
+ to call chdir(), then config->cwd == NULL. In that case
+ the correct action (to match the previous widelinks behavior
+ in the code inside smbd) is to pass through the vfs call to
+ the next module in the chain. That way, any symlinks in the
+ pathname are still exposed to smbd, which will restrict them to
+ be under the exported share definition. This allows the module
+ to "fail safe" for any vfs call made when setting up the share
+ structure definition, rather than fail unsafe by hiding symlinks
+ before chdir is called. This is the:
+
+	if (config->cwd == NULL) {
+		XXXXX syscall before chdir - see note 1b above.
+		return SMB_VFS_NEXT_XXXXX()
+	}
+
+ idiom in the vfs functions.
+
+ 2). The module hides the existance of symlinks by inside
+ lstat(), open(), and readdir() so long as it's not a POSIX
+ pathname request (those requests *must* be aware of symlinks
+ and the POSIX client has to follow them, it's expected that
+ a server will always fail to follow symlinks).
+
+ It does this by:
+
+ 2a). lstat -> stat
+ 2b). open removes any O_NOFOLLOW from flags.
+ 2c). The optimization in readdir that returns a stat
+ struct is removed as this could return a symlink mode
+ bit, causing smbd to always call stat/lstat itself on
+ a pathname (which we'll then use to hide symlinks).
+
+*/
+
+#include "includes.h"
+#include "smbd/smbd.h"
+
+struct widelinks_config {
+	bool active;
+	char *cwd;
+};
+
+/*
+ * Canonicalizes an absolute path, removing '.' and ".." components
+ * and consolitating multiple '/' characters. As this can only be
+ * called once widelinks_chdir with an absolute path has been called,
+ * we can assert that the start of path must be '/'.
+ */
+
+static char *resolve_realpath_name(TALLOC_CTX *ctx, const char *pathname_in)
+{
+	const char *s = pathname_in;
+	char *pathname = talloc_array(ctx, char, strlen(pathname_in)+1);
+	char *p = pathname;
+	bool wrote_slash = false;
+
+	if (pathname == NULL) {
+		return NULL;
+	}
+
+	SMB_ASSERT(pathname_in[0] == '/');
+
+	while (*s) {
+		/* Deal with '/' or multiples of '/'. */
+		if (s[0] == '/') {
+			while (s[0] == '/') {
+				/* Eat trailing '/' */
+				s++;
+			}
+			/* Update target with one '/' */
+			if (!wrote_slash) {
+				*p++ = '/';
+				wrote_slash = true;
+			}
+			continue;
+		}
+		if (wrote_slash) {
+			/* Deal with "./" or ".\0" */
+			if (s[0] == '.' &&
+					(s[1] == '/' || s[1] == '\0')) {
+				/* Eat the dot. */
+				s++;
+				while (s[0] == '/') {
+					/* Eat any trailing '/' */
+					s++;
+				}
+				/* Don't write anything to target. */
+				/* wrote_slash is still true. */
+				continue;
+			}
+			/* Deal with "../" or "..\0" */
+			if (s[0] == '.' && s[1] == '.' &&
+					(s[2] == '/' || s[2] == '\0')) {
+				/* Eat the dot dot. */
+				s += 2;
+				while (s[0] == '/') {
+					/* Eat any trailing '/' */
+					s++;
+				}
+				/*
+				 * As wrote_slash is true, we go back
+				 * one character to point p at the slash
+				 * we just saw.
+				 */
+				if (p > pathname) {
+					p--;
+				}
+				/*
+				 * Now go back to the slash
+				 * before the one that p currently points to.
+				 */
+				while (p > pathname) {
+					p--;
+					if (p[0] == '/') {
+						break;
+					}
+				}
+				/*
+				 * Step forward one to leave the
+				 * last written '/' alone.
+				 */
+				p++;
+
+				/* Don't write anything to target. */
+				/* wrote_slash is still true. */
+				continue;
+			}
+		}
+		/* Non-separator character, just copy. */
+		*p++ = *s++;
+		wrote_slash = false;
+	}
+	if (wrote_slash) {
+		/*
+		 * We finished on a '/'.
+		 * Remove the trailing '/', but not if it's
+		 * the sole character in the path.
+		 */
+		if (p > pathname + 1) {
+			p--;
+		}
+	}
+	/* Terminate and we're done ! */
+	*p++ = '\0';
+	return pathname;
+}
+
+static int widelinks_connect(struct vfs_handle_struct *handle,
+			const char *service,
+			const char *user)
+{
+	struct widelinks_config *config;
+	int ret;
+
+	ret = SMB_VFS_NEXT_CONNECT(handle,
+				service,
+				user);
+	if (ret != 0) {
+		return ret;
+	}
+
+	config = talloc_zero(handle->conn,
+				struct widelinks_config);
+	if (!config) {
+		SMB_VFS_NEXT_DISCONNECT(handle);
+		return -1;
+	}
+	config->active = lp_widelinks(SNUM(handle->conn));
+	if (!config->active) {
+		DBG_ERR("vfs_widelinks module loaded with "
+			"widelinks = no\n");
+	}
+
+        SMB_VFS_HANDLE_SET_DATA(handle,
+				config,
+				NULL, /* free_fn */
+				struct widelinks_config,
+				return -1);
+	return 0;
+}
+
+static int widelinks_chdir(struct vfs_handle_struct *handle,
+				const struct smb_filename *smb_fname)
+{
+	int ret = -1;
+	struct widelinks_config *config = NULL;
+	char *new_cwd = NULL;
+
+	SMB_VFS_HANDLE_GET_DATA(handle,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list