From 3365892afd34d2dddbb2139e148d964a17dba50f Mon Sep 17 00:00:00 2001 From: Guenter Kukkukk Date: Wed, 27 Feb 2013 05:34:05 +0100 Subject: [PATCH 1/3] vfs_catia: add debug class for that module Signed-off-by: Guenter Kukkukk Reviewed-by: Jeremy Allison --- source3/modules/vfs_catia.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 31b9f18..8a33e50 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -29,6 +29,11 @@ #include "includes.h" #include "smbd/smbd.h" +static int vfs_catia_debug_level = DBGC_VFS; + +#undef DBGC_CLASS +#define DBGC_CLASS vfs_catia_debug_level + #define GLOBAL_SNUM 0xFFFFFFF #define MAP_SIZE 0xFF #define MAP_NUM 0x101 /* max unicode charval / MAP_SIZE */ @@ -1020,6 +1025,23 @@ static struct vfs_fn_pointers vfs_catia_fns = { NTSTATUS vfs_catia_init(void) { - return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "catia", + NTSTATUS ret; + + ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "catia", &vfs_catia_fns); + if (!NT_STATUS_IS_OK(ret)) + return ret; + + vfs_catia_debug_level = debug_add_class("catia"); + if (vfs_catia_debug_level == -1) { + vfs_catia_debug_level = DBGC_VFS; + DEBUG(0, ("vfs_catia: Couldn't register custom debugging " + "class!\n")); + } else { + DEBUG(10, ("vfs_catia: Debug class number of " + "'catia': %d\n", vfs_catia_debug_level)); + } + + return ret; + } -- 1.8.1.3 From 40208b0945f56e27e535aa0fbadf97d4c4a7e452 Mon Sep 17 00:00:00 2001 From: Guenter Kukkukk Date: Wed, 27 Feb 2013 05:50:52 +0100 Subject: [PATCH 2/3] vfs_catia: fix the translation to "vfs_translate_to_windows" THANKS to an IRC user (Raimund ?) who asked for a char mapping possibility. I suggested vfs_catia - but it did not work! Hopefully now it will. :-) Signed-off-by: Guenter Kukkukk Reviewed-by: Jeremy Allison --- source3/modules/vfs_catia.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 8a33e50..c0063be 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -300,7 +300,7 @@ static NTSTATUS catia_translate_name(struct vfs_handle_struct *handle, { char *name = NULL; char *mapped_name; - NTSTATUS ret; + NTSTATUS status, ret; /* * Copy the supplied name and free the memory for mapped_name, @@ -313,12 +313,12 @@ static NTSTATUS catia_translate_name(struct vfs_handle_struct *handle, errno = ENOMEM; return NT_STATUS_NO_MEMORY; } - ret = catia_string_replace_allocate(handle->conn, name, + status = catia_string_replace_allocate(handle->conn, name, &mapped_name, direction); TALLOC_FREE(name); - if (!NT_STATUS_IS_OK(ret)) { - return ret; + if (!NT_STATUS_IS_OK(status)) { + return status; } ret = SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction, @@ -326,6 +326,8 @@ static NTSTATUS catia_translate_name(struct vfs_handle_struct *handle, if (NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED)) { *pmapped_name = talloc_move(mem_ctx, &mapped_name); + /* we need to return the former translation result here */ + ret = status; } else { TALLOC_FREE(mapped_name); } -- 1.8.1.3 From b131286d40b987666a720496260f04dbc06031e9 Mon Sep 17 00:00:00 2001 From: Guenter Kukkukk Date: Fri, 1 Mar 2013 00:58:05 +0100 Subject: [PATCH 3/3] vfs_catia: add my copyright Signed-off-by: Guenter Kukkukk Reviewed-by: Jeremy Allison --- source3/modules/vfs_catia.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index c0063be..c0bb5ef 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -10,6 +10,7 @@ * * Copyright (C) Volker Lendecke, 2005 * Copyright (C) Aravind Srinivasan, 2009 + * Copyright (C) Guenter Kukkukk, 2013 * * 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 -- 1.8.1.3