This fix ensures create_conn_struct_as_root() works the same way as
make_connection_snum() used in smbd for SMB sessions. Without this any caller of
create_conn_struct_as_root() will fail to use work on shares if the sharepath
contains a symlink.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
return NT_STATUS_UNSUCCESSFUL;
}
+ if (!lp_widelinks(snum)) {
+ if (!canonicalize_connect_path(conn)) {
+ DBG_ERR("Failed to canonicalize sharepath\n");
+ conn_free(conn);
+ return NT_STATUS_ACCESS_DENIED;
+ }
+ }
+
talloc_free(conn->origpath);
conn->origpath = talloc_strdup(conn, conn->connectpath);
if (conn->origpath == NULL) {