[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Sep 18 01:27:02 UTC 2019


The branch, master has been updated
       via  55b54e72174 s3: VFS: Remove vfs_netatalk. Old, unused and unmaintained.
      from  fd61e550ace smbd: Don't always walk the share mode array in open_mode_check()

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


- Log -----------------------------------------------------------------
commit 55b54e72174fc018fee82ded0cb70eebb839cb5f
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Sep 17 16:08:17 2019 -0700

    s3: VFS: Remove vfs_netatalk. Old, unused and unmaintained.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Sep 18 01:26:06 UTC 2019 on sn-devel-184

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

Summary of changes:
 docs-xml/manpages/vfs_netatalk.8.xml |  77 ------
 docs-xml/wscript_build               |   1 -
 source3/modules/vfs_netatalk.c       | 499 -----------------------------------
 source3/modules/wscript_build        |   8 -
 source3/wscript                      |   2 +-
 5 files changed, 1 insertion(+), 586 deletions(-)
 delete mode 100644 docs-xml/manpages/vfs_netatalk.8.xml
 delete mode 100644 source3/modules/vfs_netatalk.c


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_netatalk.8.xml b/docs-xml/manpages/vfs_netatalk.8.xml
deleted file mode 100644
index 38e335075d2..00000000000
--- a/docs-xml/manpages/vfs_netatalk.8.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?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_netatalk.8">
-
-<refmeta>
-	<refentrytitle>vfs_netatalk</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_netatalk</refname>
-	<refpurpose>hide .AppleDouble files from CIFS clients</refpurpose>
-</refnamediv>
-
-<refsynopsisdiv>
-	<cmdsynopsis>
-		<command>vfs objects = netatalk</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_netatalk</command> VFS module dynamically
-	hides .AppleDouble files, preventing spurious errors on some
-	CIFS clients. .AppleDouble files may be created by historic
-	implementations of AFP (Apple Filing Protocol) on servers. </para>
-
-	<para>This module is stackable.</para>
-
-</refsect1>
-
-<refsect1>
-	<title>EXAMPLES</title>
-
-	<para>Hide .AppleDouble files on the [data] share:</para>
-<programlisting>
-        <smbconfsection name="[data]"/>
-	<smbconfoption name="vfs objects">netatalk</smbconfoption>
-</programlisting>
-
-</refsect1>
-
-<refsect1>
-	<title>CAVEATS</title>
-	<para>This module is largely historic and unlikely to be of use
-	in modern networks since current Apple systems are able to mount CIFS
-	shares natively.
-	</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 3dad0a21313..f207e51ff21 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -88,7 +88,6 @@ vfs_module_manpages = ['vfs_acl_tdb',
                        'vfs_gpfs',
                        'vfs_linux_xfs_sgid',
                        'vfs_media_harmony',
-                       'vfs_netatalk',
                        'vfs_nfs4acl_xattr',
                        'vfs_offline',
                        'vfs_prealloc',
diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c
deleted file mode 100644
index 658c95c175e..00000000000
--- a/source3/modules/vfs_netatalk.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/* 
- * AppleTalk VFS module for Samba-3.x
- *
- * Copyright (C) Alexei Kotovich, 2002
- * Copyright (C) Stefan (metze) Metzmacher, 2003
- *
- * 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/>.
- */
-
-#include "includes.h"
-#include "smbd/smbd.h"
-#include "system/filesys.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_VFS
-
-#define APPLEDOUBLE	".AppleDouble"
-#define ADOUBLEMODE	0777
-
-/* atalk functions */
-
-static int atalk_build_paths(TALLOC_CTX *ctx, const char *path,
-			     const char *fname,
-			     char **adbl_path, char **orig_path,
-			     SMB_STRUCT_STAT *adbl_info,
-			     SMB_STRUCT_STAT *orig_info);
-
-static int atalk_unlink_file(const char *path);
-
-static int atalk_get_path_ptr(char *path)
-{
-	int i   = 0;
-	int ptr = 0;
-	
-	for (i = 0; path[i]; i ++) {
-		if (path[i] == '/')
-			ptr = i;
-		/* get out some 'spam';) from win32's file name */
-		else if (path[i] == ':') {
-			path[i] = '\0';
-			break;
-		}
-	}
-	
-	return ptr;
-}
-
-static int atalk_build_paths(TALLOC_CTX *ctx, const char *path,
-			     const char *fname,
-			     char **adbl_path, char **orig_path,
-			     SMB_STRUCT_STAT *adbl_info,
-			     SMB_STRUCT_STAT *orig_info)
-{
-	int ptr0 = 0;
-	int ptr1 = 0;
-	char *dname = 0;
-	char *name  = 0;
-
-	if (!ctx || !path || !fname || !adbl_path || !orig_path ||
-		!adbl_info || !orig_info)
-		return -1;
-#if 0
-	DEBUG(3, ("ATALK: PATH: %s[%s]\n", path, fname));
-#endif
-	if (strstr_m(path, APPLEDOUBLE) || strstr_m(fname, APPLEDOUBLE)) {
-		DEBUG(3, ("ATALK: path %s[%s] already contains %s\n", path, fname, APPLEDOUBLE));
-		return -1;
-	}
-
-	if (fname[0] == '.') ptr0 ++;
-	if (fname[1] == '/') ptr0 ++;
-
-	*orig_path = talloc_asprintf(ctx, "%s/%s", path, &fname[ptr0]);
-
-	/* get pointer to last '/' */
-	ptr1 = atalk_get_path_ptr(*orig_path);
-
-	sys_lstat(*orig_path, orig_info, false);
-
-	if (S_ISDIR(orig_info->st_ex_mode)) {
-		*adbl_path = talloc_asprintf(ctx, "%s/%s/%s/", 
-		  path, &fname[ptr0], APPLEDOUBLE);
-	} else {
-		dname = talloc_strdup(ctx, *orig_path);
-		dname[ptr1] = '\0';
-		name = *orig_path;
-		*adbl_path = talloc_asprintf(ctx, "%s/%s/%s", 
-		  dname, APPLEDOUBLE, &name[ptr1 + 1]);
-	}
-#if 0
-	DEBUG(3, ("ATALK: DEBUG:\n%s\n%s\n", *orig_path, *adbl_path)); 
-#endif
-	sys_lstat(*adbl_path, adbl_info, false);
-	return 0;
-}
-
-static int atalk_unlink_file(const char *path)
-{
-	int ret = 0;
-
-	become_root();
-	ret = unlink(path);
-	unbecome_root();
-	
-	return ret;
-}
-
-static void atalk_add_to_list(name_compare_entry **list)
-{
-	size_t i, count = 0;
-	name_compare_entry *new_list = 0;
-	name_compare_entry *cur_list = 0;
-
-	cur_list = *list;
-
-	if (cur_list) {
-		for (i = 0, count = 0; cur_list[i].name; i ++, count ++) {
-			if (strstr_m(cur_list[i].name, APPLEDOUBLE))
-				return;
-		}
-	}
-
-	if (!(new_list = SMB_CALLOC_ARRAY(name_compare_entry, count + 2)))
-		return;
-
-	for (i = 0; i < count; i ++) {
-		new_list[i].name    = SMB_STRDUP(cur_list[i].name);
-		new_list[i].is_wild = cur_list[i].is_wild;
-	}
-
-	new_list[i].name    = SMB_STRDUP(APPLEDOUBLE);
-	new_list[i].is_wild = False;
-
-	free_namearray(*list);
-
-	*list = new_list;
-	new_list = 0;
-	cur_list = 0;
-}
-
-static void atalk_rrmdir(TALLOC_CTX *ctx, char *path)
-{
-	char *dpath;
-	struct dirent *dent = 0;
-	DIR *dir;
-
-	if (!path) return;
-
-	dir = opendir(path);
-	if (!dir) return;
-
-	while (NULL != (dent = readdir(dir))) {
-		if (strcmp(dent->d_name, ".") == 0 ||
-		    strcmp(dent->d_name, "..") == 0)
-			continue;
-		if (!(dpath = talloc_asprintf(ctx, "%s/%s", 
-					      path, dent->d_name)))
-			continue;
-		atalk_unlink_file(dpath);
-	}
-
-	closedir(dir);
-}
-
-/* Disk operations */
-
-/* Directory operations */
-
-static DIR *atalk_opendir(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			const char *mask,
-			uint32_t attr)
-{
-	DIR *ret = 0;
-
-	ret = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-
-	/*
-	 * when we try to perform delete operation upon file which has fork
-	 * in ./.AppleDouble and this directory wasn't hidden by Samba,
-	 * MS Windows explorer causes the error: "Cannot find the specified file"
-	 * There is some workaround to avoid this situation, i.e. if
-	 * connection has not .AppleDouble entry in either veto or hide 
-	 * list then it would be nice to add one.
-	 */
-
-	atalk_add_to_list(&handle->conn->hide_list);
-	atalk_add_to_list(&handle->conn->veto_list);
-
-	return ret;
-}
-
-static DIR *atalk_fdopendir(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32_t attr)
-{
-	DIR *ret = 0;
-
-	ret = SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
-
-	if (ret == NULL) {
-		return ret;
-	}
-
-	/*
-	 * when we try to perform delete operation upon file which has fork
-	 * in ./.AppleDouble and this directory wasn't hidden by Samba,
-	 * MS Windows explorer causes the error: "Cannot find the specified file"
-	 * There is some workaround to avoid this situation, i.e. if
-	 * connection has not .AppleDouble entry in either veto or hide 
-	 * list then it would be nice to add one.
-	 */
-
-	atalk_add_to_list(&handle->conn->hide_list);
-	atalk_add_to_list(&handle->conn->veto_list);
-
-	return ret;
-}
-
-static int atalk_rmdir(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname)
-{
-	bool add = False;
-	TALLOC_CTX *ctx = 0;
-	const char *path = smb_fname->base_name;
-	char *dpath;
-
-	if (!handle->conn->cwd_fsp->fsp_name->base_name || !path) goto exit_rmdir;
-
-	/* due to there is no way to change bDeleteVetoFiles variable
-	 * from this module, gotta use talloc stuff..
-	 */
-
-	strstr_m(path, APPLEDOUBLE) ? (add = False) : (add = True);
-
-	if (!(ctx = talloc_init("remove_directory")))
-		goto exit_rmdir;
-
-	if (!(dpath = talloc_asprintf(ctx, "%s/%s%s", 
-	  handle->conn->cwd_fsp->fsp_name->base_name, path, add ? "/"APPLEDOUBLE : "")))
-		goto exit_rmdir;
-
-	atalk_rrmdir(ctx, dpath);
-
-exit_rmdir:
-	talloc_destroy(ctx);
-	return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
-}
-
-/* File operations */
-
-static int atalk_renameat(struct vfs_handle_struct *handle,
-			files_struct *srcfsp,
-			const struct smb_filename *smb_fname_src,
-			files_struct *dstfsp,
-			const struct smb_filename *smb_fname_dst)
-{
-	int ret = 0;
-	char *oldname = NULL;
-	char *adbl_path = NULL;
-	char *orig_path = NULL;
-	SMB_STRUCT_STAT adbl_info;
-	SMB_STRUCT_STAT orig_info;
-	NTSTATUS status;
-
-	ret = SMB_VFS_NEXT_RENAMEAT(handle,
-			srcfsp,
-			smb_fname_src,
-			dstfsp,
-			smb_fname_dst);
-
-	status = get_full_smb_filename(talloc_tos(), smb_fname_src, &oldname);
-	if (!NT_STATUS_IS_OK(status)) {
-		return ret;
-	}
-
-	if (atalk_build_paths(talloc_tos(),
-			      handle->conn->cwd_fsp->fsp_name->base_name,
-			      oldname,
-			      &adbl_path, &orig_path, &adbl_info,
-			      &orig_info) != 0)
-		goto exit_renameat;
-
-	if (S_ISDIR(orig_info.st_ex_mode) || S_ISREG(orig_info.st_ex_mode)) {
-		DEBUG(3, ("ATALK: %s has passed..\n", adbl_path));
-		goto exit_renameat;
-	}
-
-	atalk_unlink_file(adbl_path);
-
-exit_renameat:
-	TALLOC_FREE(oldname);
-	TALLOC_FREE(adbl_path);
-	TALLOC_FREE(orig_path);
-	return ret;
-}
-
-static int atalk_unlink(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname)
-{
-	int ret = 0, i;
-	char *path = NULL;
-	char *adbl_path = NULL;
-	char *orig_path = NULL;
-	SMB_STRUCT_STAT adbl_info;
-	SMB_STRUCT_STAT orig_info;
-	NTSTATUS status;
-
-	ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-
-	status = get_full_smb_filename(talloc_tos(), smb_fname, &path);
-	if (!NT_STATUS_IS_OK(status)) {
-		return ret;
-	}
-
-	/* no .AppleDouble sync if veto or hide list is empty,
-	 * otherwise "Cannot find the specified file" error will be caused
-	 */
-
-	if (!handle->conn->veto_list) return ret;
-	if (!handle->conn->hide_list) return ret;
-
-	for (i = 0; handle->conn->veto_list[i].name; i ++) {
-		if (strstr_m(handle->conn->veto_list[i].name, APPLEDOUBLE))
-			break;
-	}
-
-	if (!handle->conn->veto_list[i].name) {
-		for (i = 0; handle->conn->hide_list[i].name; i ++) {
-			if (strstr_m(handle->conn->hide_list[i].name, APPLEDOUBLE))
-				break;
-			else {
-				DEBUG(3, ("ATALK: %s is not hidden, skipped..\n",
-				  APPLEDOUBLE));		
-				goto exit_unlink;
-			}
-		}
-	}
-
-	if (atalk_build_paths(talloc_tos(),
-				handle->conn->cwd_fsp->fsp_name->base_name, path,
-			      &adbl_path, &orig_path,
-			      &adbl_info, &orig_info) != 0)
-		goto exit_unlink;
-
-	if (S_ISDIR(orig_info.st_ex_mode) || S_ISREG(orig_info.st_ex_mode)) {
-		DEBUG(3, ("ATALK: %s has passed..\n", adbl_path));
-		goto exit_unlink;
-	}
-
-	atalk_unlink_file(adbl_path);
-
-exit_unlink:
-	TALLOC_FREE(path);
-	TALLOC_FREE(adbl_path);
-	TALLOC_FREE(orig_path);
-	return ret;
-}
-
-static int atalk_chmod(struct vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname,
-			mode_t mode)
-{
-	int ret = 0;
-	int ret1 = 0;
-	char *adbl_path = 0;
-	char *orig_path = 0;
-	SMB_STRUCT_STAT adbl_info;
-	SMB_STRUCT_STAT orig_info;
-	TALLOC_CTX *ctx;
-
-	ret = SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
-
-	if (!(ctx = talloc_init("chmod_file")))
-		return ret;
-
-	ret1 = atalk_build_paths(ctx,
-			handle->conn->cwd_fsp->fsp_name->base_name,
-			smb_fname->base_name,
-			&adbl_path,
-			&orig_path,
-			&adbl_info,
-			&orig_info);
-	if (ret1 != 0) {
-		goto exit_chmod;
-	}
-
-	if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) {
-		DEBUG(3, ("ATALK: %s has passed..\n", orig_path));		
-		goto exit_chmod;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list