4 * Implement a fixed mapping of forbidden NT characters in filenames that are
5 * used a lot by the CAD package Catia.
7 * Yes, this a BAD BAD UGLY INCOMPLETE hack, but it helps quite some people
8 * out there. Catia V4 on AIX uses characters like "<*$ a *lot*, all forbidden
11 * Copyright (C) Volker Lendecke, 2005
12 * Copyright (C) Aravind Srinivasan, 2009
13 * Copyright (C) Guenter Kukkukk, 2013
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 3 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see <http://www.gnu.org/licenses/>.
31 #include "smbd/smbd.h"
33 static int vfs_catia_debug_level = DBGC_VFS;
36 #define DBGC_CLASS vfs_catia_debug_level
38 #define GLOBAL_SNUM 0xFFFFFFF
40 #define MAP_NUM 0x101 /* max unicode charval / MAP_SIZE */
41 #define T_OFFSET(_v_) ((_v_ % MAP_SIZE))
42 #define T_START(_v_) (((_v_ / MAP_SIZE) * MAP_SIZE))
43 #define T_PICK(_v_) ((_v_ / MAP_SIZE))
45 struct char_mappings {
46 smb_ucs2_t entry[MAP_SIZE][2];
49 struct share_mapping_entry {
51 struct share_mapping_entry *next;
52 struct char_mappings **mappings;
55 struct share_mapping_entry *srt_head = NULL;
57 static bool build_table(struct char_mappings **cmaps, int value)
60 int start = T_START(value);
62 (*cmaps) = talloc_zero(NULL, struct char_mappings);
67 for (i = 0; i < MAP_SIZE;i++) {
68 (*cmaps)->entry[i][vfs_translate_to_unix] = start + i;
69 (*cmaps)->entry[i][vfs_translate_to_windows] = start + i;
75 static void set_tables(struct char_mappings **cmaps,
81 /* set unix -> windows */
82 i = T_OFFSET(unix_map);
83 cmaps[T_PICK(unix_map)]->entry[i][vfs_translate_to_windows] = windows_map;
85 /* set windows -> unix */
86 i = T_OFFSET(windows_map);
87 cmaps[T_PICK(windows_map)]->entry[i][vfs_translate_to_unix] = unix_map;
90 static bool build_ranges(struct char_mappings **cmaps,
95 if (!cmaps[T_PICK(unix_map)]) {
96 if (!build_table(&cmaps[T_PICK(unix_map)], unix_map))
100 if (!cmaps[T_PICK(windows_map)]) {
101 if (!build_table(&cmaps[T_PICK(windows_map)], windows_map))
105 set_tables(cmaps, unix_map, windows_map);
110 static struct share_mapping_entry *get_srt(connection_struct *conn,
111 struct share_mapping_entry **global)
113 struct share_mapping_entry *share;
115 for (share = srt_head; share != NULL; share = share->next) {
116 if (share->snum == GLOBAL_SNUM)
119 if (share->snum == SNUM(conn))
126 static struct share_mapping_entry *add_srt(int snum, const char **mappings)
132 long unix_map, windows_map;
133 struct share_mapping_entry *ret = NULL;
135 ret = (struct share_mapping_entry *)
136 TALLOC_ZERO(NULL, sizeof(struct share_mapping_entry) +
137 (mappings ? (MAP_NUM * sizeof(struct char_mappings *)) : 0));
145 ret->mappings = (struct char_mappings**) ((unsigned char*) ret +
146 sizeof(struct share_mapping_entry));
147 memset(ret->mappings, 0,
148 MAP_NUM * sizeof(struct char_mappings *));
150 ret->mappings = NULL;
155 * catia mappings are of the form :
156 * UNIX char (in 0xnn hex) : WINDOWS char (in 0xnn hex)
158 * multiple mappings are comma separated in smb.conf
160 for (i=0;mappings[i];i++) {
161 fstrcpy(mapping, mappings[i]);
162 unix_map = strtol(mapping, &tmp, 16);
163 if (unix_map == 0 && errno == EINVAL) {
164 DEBUG(0, ("INVALID CATIA MAPPINGS - %s\n", mapping));
167 windows_map = strtol(++tmp, NULL, 16);
168 if (windows_map == 0 && errno == EINVAL) {
169 DEBUG(0, ("INVALID CATIA MAPPINGS - %s\n", mapping));
173 if (!build_ranges(ret->mappings, unix_map, windows_map)) {
174 DEBUG(0, ("TABLE ERROR - CATIA MAPPINGS - %s\n", mapping));
179 ret->next = srt_head;
185 static bool init_mappings(connection_struct *conn,
186 struct share_mapping_entry **selected_out)
188 const char **mappings = NULL;
189 struct share_mapping_entry *share_level = NULL;
190 struct share_mapping_entry *global = NULL;
192 /* check srt cache */
193 share_level = get_srt(conn, &global);
195 *selected_out = share_level;
196 return (share_level->mappings != NULL);
199 /* see if we have a global setting */
202 mappings = lp_parm_string_list(-1, "catia", "mappings", NULL);
203 global = add_srt(GLOBAL_SNUM, mappings);
206 /* no global setting - what about share level ? */
207 mappings = lp_parm_string_list(SNUM(conn), "catia", "mappings", NULL);
208 share_level = add_srt(SNUM(conn), mappings);
210 if (share_level->mappings) {
211 (*selected_out) = share_level;
214 if (global->mappings) {
215 share_level->mappings = global->mappings;
216 (*selected_out) = share_level;
223 static NTSTATUS catia_string_replace_allocate(connection_struct *conn,
226 enum vfs_translate_direction direction)
228 static smb_ucs2_t *tmpbuf = NULL;
230 struct share_mapping_entry *selected;
231 struct char_mappings *map = NULL;
232 size_t converted_size;
233 TALLOC_CTX *ctx = talloc_tos();
235 if (!init_mappings(conn, &selected)) {
236 /* No mappings found. Just use the old name */
237 *mapped_name = talloc_strdup(NULL, name_in);
240 return NT_STATUS_NO_MEMORY;
245 if ((push_ucs2_talloc(ctx, &tmpbuf, name_in,
246 &converted_size)) == false) {
247 return map_nt_error_from_unix(errno);
253 map = selected->mappings[T_PICK((*ptr))];
259 *ptr = map->entry[T_OFFSET((*ptr))][direction];
262 if ((pull_ucs2_talloc(ctx, mapped_name, tmpbuf,
263 &converted_size)) == false) {
265 return map_nt_error_from_unix(errno);
271 static DIR *catia_opendir(vfs_handle_struct *handle,
272 const struct smb_filename *smb_fname,
276 char *name_mapped = NULL;
279 struct smb_filename *mapped_smb_fname = NULL;
281 status = catia_string_replace_allocate(handle->conn,
282 smb_fname->base_name,
284 vfs_translate_to_unix);
285 if (!NT_STATUS_IS_OK(status)) {
286 errno = map_errno_from_nt_status(status);
290 mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
294 if (mapped_smb_fname == NULL) {
295 TALLOC_FREE(mapped_smb_fname);
300 ret = SMB_VFS_NEXT_OPENDIR(handle, mapped_smb_fname, mask, attr);
302 TALLOC_FREE(name_mapped);
303 TALLOC_FREE(mapped_smb_fname);
309 * TRANSLATE_NAME call which converts the given name to
310 * "WINDOWS displayable" name
312 static NTSTATUS catia_translate_name(struct vfs_handle_struct *handle,
313 const char *orig_name,
314 enum vfs_translate_direction direction,
320 NTSTATUS status, ret;
323 * Copy the supplied name and free the memory for mapped_name,
324 * already allocated by the caller.
325 * We will be allocating new memory for mapped_name in
326 * catia_string_replace_allocate
328 name = talloc_strdup(talloc_tos(), orig_name);
331 return NT_STATUS_NO_MEMORY;
333 status = catia_string_replace_allocate(handle->conn, name,
334 &mapped_name, direction);
337 if (!NT_STATUS_IS_OK(status)) {
341 ret = SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction,
342 mem_ctx, pmapped_name);
344 if (NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED)) {
345 *pmapped_name = talloc_move(mem_ctx, &mapped_name);
346 /* we need to return the former translation result here */
349 TALLOC_FREE(mapped_name);
355 static int catia_open(vfs_handle_struct *handle,
356 struct smb_filename *smb_fname,
361 char *name_mapped = NULL;
366 tmp_base_name = smb_fname->base_name;
367 status = catia_string_replace_allocate(handle->conn,
368 smb_fname->base_name,
369 &name_mapped, vfs_translate_to_unix);
370 if (!NT_STATUS_IS_OK(status)) {
371 errno = map_errno_from_nt_status(status);
375 smb_fname->base_name = name_mapped;
376 ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
377 smb_fname->base_name = tmp_base_name;
378 TALLOC_FREE(name_mapped);
383 static int catia_rename(vfs_handle_struct *handle,
384 const struct smb_filename *smb_fname_src,
385 const struct smb_filename *smb_fname_dst)
387 TALLOC_CTX *ctx = talloc_tos();
388 struct smb_filename *smb_fname_src_tmp = NULL;
389 struct smb_filename *smb_fname_dst_tmp = NULL;
390 char *src_name_mapped = NULL;
391 char *dst_name_mapped = NULL;
395 status = catia_string_replace_allocate(handle->conn,
396 smb_fname_src->base_name,
397 &src_name_mapped, vfs_translate_to_unix);
398 if (!NT_STATUS_IS_OK(status)) {
399 errno = map_errno_from_nt_status(status);
403 status = catia_string_replace_allocate(handle->conn,
404 smb_fname_dst->base_name,
405 &dst_name_mapped, vfs_translate_to_unix);
406 if (!NT_STATUS_IS_OK(status)) {
407 errno = map_errno_from_nt_status(status);
411 /* Setup temporary smb_filename structs. */
412 smb_fname_src_tmp = cp_smb_filename(ctx, smb_fname_src);
413 if (smb_fname_src_tmp == NULL) {
418 smb_fname_dst_tmp = cp_smb_filename(ctx, smb_fname_dst);
419 if (smb_fname_dst_tmp == NULL) {
424 smb_fname_src_tmp->base_name = src_name_mapped;
425 smb_fname_dst_tmp->base_name = dst_name_mapped;
426 DEBUG(10, ("converted old name: %s\n",
427 smb_fname_str_dbg(smb_fname_src_tmp)));
428 DEBUG(10, ("converted new name: %s\n",
429 smb_fname_str_dbg(smb_fname_dst_tmp)));
431 ret = SMB_VFS_NEXT_RENAME(handle, smb_fname_src_tmp,
434 TALLOC_FREE(src_name_mapped);
435 TALLOC_FREE(dst_name_mapped);
436 TALLOC_FREE(smb_fname_src_tmp);
437 TALLOC_FREE(smb_fname_dst_tmp);
441 static int catia_stat(vfs_handle_struct *handle,
442 struct smb_filename *smb_fname)
449 status = catia_string_replace_allocate(handle->conn,
450 smb_fname->base_name,
451 &name, vfs_translate_to_unix);
452 if (!NT_STATUS_IS_OK(status)) {
453 errno = map_errno_from_nt_status(status);
457 tmp_base_name = smb_fname->base_name;
458 smb_fname->base_name = name;
460 ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
461 smb_fname->base_name = tmp_base_name;
467 static int catia_lstat(vfs_handle_struct *handle,
468 struct smb_filename *smb_fname)
475 status = catia_string_replace_allocate(handle->conn,
476 smb_fname->base_name,
477 &name, vfs_translate_to_unix);
478 if (!NT_STATUS_IS_OK(status)) {
479 errno = map_errno_from_nt_status(status);
483 tmp_base_name = smb_fname->base_name;
484 smb_fname->base_name = name;
486 ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname);
487 smb_fname->base_name = tmp_base_name;
493 static int catia_unlink(vfs_handle_struct *handle,
494 const struct smb_filename *smb_fname)
496 struct smb_filename *smb_fname_tmp = NULL;
501 status = catia_string_replace_allocate(handle->conn,
502 smb_fname->base_name,
503 &name, vfs_translate_to_unix);
504 if (!NT_STATUS_IS_OK(status)) {
505 errno = map_errno_from_nt_status(status);
509 /* Setup temporary smb_filename structs. */
510 smb_fname_tmp = cp_smb_filename(talloc_tos(), smb_fname);
511 if (smb_fname_tmp == NULL) {
516 smb_fname_tmp->base_name = name;
517 ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname_tmp);
518 TALLOC_FREE(smb_fname_tmp);
524 static int catia_chown(vfs_handle_struct *handle,
533 status = catia_string_replace_allocate(handle->conn, path,
534 &name, vfs_translate_to_unix);
535 if (!NT_STATUS_IS_OK(status)) {
536 errno = map_errno_from_nt_status(status);
540 ret = SMB_VFS_NEXT_CHOWN(handle, name, uid, gid);
546 static int catia_lchown(vfs_handle_struct *handle,
555 status = catia_string_replace_allocate(handle->conn, path,
556 &name, vfs_translate_to_unix);
557 if (!NT_STATUS_IS_OK(status)) {
558 errno = map_errno_from_nt_status(status);
562 ret = SMB_VFS_NEXT_LCHOWN(handle, name, uid, gid);
568 static int catia_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
574 status = catia_string_replace_allocate(handle->conn, path,
575 &name, vfs_translate_to_unix);
576 if (!NT_STATUS_IS_OK(status)) {
577 errno = map_errno_from_nt_status(status);
581 ret = SMB_VFS_NEXT_CHMOD(handle, name, mode);
587 static int catia_rmdir(vfs_handle_struct *handle,
588 const struct smb_filename *smb_fname)
593 struct smb_filename *catia_smb_fname = NULL;
595 status = catia_string_replace_allocate(handle->conn,
596 smb_fname->base_name,
598 vfs_translate_to_unix);
599 if (!NT_STATUS_IS_OK(status)) {
600 errno = map_errno_from_nt_status(status);
603 catia_smb_fname = synthetic_smb_fname(talloc_tos(),
607 if (catia_smb_fname == NULL) {
613 ret = SMB_VFS_NEXT_RMDIR(handle, catia_smb_fname);
615 TALLOC_FREE(catia_smb_fname);
620 static int catia_mkdir(vfs_handle_struct *handle,
621 const struct smb_filename *smb_fname,
627 struct smb_filename *catia_smb_fname = NULL;
629 status = catia_string_replace_allocate(handle->conn,
630 smb_fname->base_name,
632 vfs_translate_to_unix);
633 if (!NT_STATUS_IS_OK(status)) {
634 errno = map_errno_from_nt_status(status);
637 catia_smb_fname = synthetic_smb_fname(talloc_tos(),
641 if (catia_smb_fname == NULL) {
647 ret = SMB_VFS_NEXT_MKDIR(handle, catia_smb_fname, mode);
649 TALLOC_FREE(catia_smb_fname);
654 static int catia_chdir(vfs_handle_struct *handle,
661 status = catia_string_replace_allocate(handle->conn, path,
662 &name, vfs_translate_to_unix);
663 if (!NT_STATUS_IS_OK(status)) {
664 errno = map_errno_from_nt_status(status);
668 ret = SMB_VFS_NEXT_CHDIR(handle, name);
674 static int catia_ntimes(vfs_handle_struct *handle,
675 const struct smb_filename *smb_fname,
676 struct smb_file_time *ft)
678 struct smb_filename *smb_fname_tmp = NULL;
683 status = catia_string_replace_allocate(handle->conn,
684 smb_fname->base_name,
685 &name, vfs_translate_to_unix);
686 if (!NT_STATUS_IS_OK(status)) {
687 errno = map_errno_from_nt_status(status);
691 smb_fname_tmp = cp_smb_filename(talloc_tos(), smb_fname);
692 if (smb_fname_tmp == NULL) {
697 smb_fname_tmp->base_name = name;
698 ret = SMB_VFS_NEXT_NTIMES(handle, smb_fname_tmp, ft);
700 TALLOC_FREE(smb_fname_tmp);
706 catia_realpath(vfs_handle_struct *handle, const char *path)
708 char *mapped_name = NULL;
712 status = catia_string_replace_allocate(handle->conn, path,
713 &mapped_name, vfs_translate_to_unix);
714 if (!NT_STATUS_IS_OK(status)) {
715 errno = map_errno_from_nt_status(status);
719 ret = SMB_VFS_NEXT_REALPATH(handle, mapped_name);
720 TALLOC_FREE(mapped_name);
725 static int catia_chflags(struct vfs_handle_struct *handle,
726 const char *path, unsigned int flags)
728 char *mapped_name = NULL;
732 status = catia_string_replace_allocate(handle->conn, path,
733 &mapped_name, vfs_translate_to_unix);
734 if (!NT_STATUS_IS_OK(status)) {
735 errno = map_errno_from_nt_status(status);
739 ret = SMB_VFS_NEXT_CHFLAGS(handle, mapped_name, flags);
740 TALLOC_FREE(mapped_name);
746 catia_streaminfo(struct vfs_handle_struct *handle,
747 struct files_struct *fsp,
750 unsigned int *_num_streams,
751 struct stream_struct **_streams)
753 char *mapped_name = NULL;
756 unsigned int num_streams = 0;
757 struct stream_struct *streams = NULL;
762 status = catia_string_replace_allocate(handle->conn, path,
763 &mapped_name, vfs_translate_to_unix);
764 if (!NT_STATUS_IS_OK(status)) {
765 errno = map_errno_from_nt_status(status);
769 status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, mapped_name,
770 mem_ctx, &num_streams, &streams);
771 TALLOC_FREE(mapped_name);
772 if (!NT_STATUS_IS_OK(status)) {
777 * Translate stream names just like the base names
779 for (i = 0; i < num_streams; i++) {
781 * Strip ":" prefix and ":$DATA" suffix to get a
782 * "pure" stream name and only translate that.
784 void *old_ptr = streams[i].name;
785 char *stream_name = streams[i].name + 1;
786 char *stream_type = strrchr_m(stream_name, ':');
788 if (stream_type != NULL) {
793 status = catia_string_replace_allocate(handle->conn, stream_name,
794 &mapped_name, vfs_translate_to_windows);
795 if (!NT_STATUS_IS_OK(status)) {
796 TALLOC_FREE(streams);
800 if (stream_type != NULL) {
801 streams[i].name = talloc_asprintf(streams, ":%s:%s",
802 mapped_name, stream_type);
804 streams[i].name = talloc_asprintf(streams, ":%s",
807 TALLOC_FREE(mapped_name);
808 TALLOC_FREE(old_ptr);
809 if (streams[i].name == NULL) {
810 TALLOC_FREE(streams);
811 return NT_STATUS_NO_MEMORY;
815 *_num_streams = num_streams;
821 catia_get_nt_acl(struct vfs_handle_struct *handle,
822 const struct smb_filename *smb_fname,
823 uint32_t security_info,
825 struct security_descriptor **ppdesc)
827 char *mapped_name = NULL;
828 const char *path = smb_fname->base_name;
829 struct smb_filename *mapped_smb_fname = NULL;
832 status = catia_string_replace_allocate(handle->conn,
833 path, &mapped_name, vfs_translate_to_unix);
834 if (!NT_STATUS_IS_OK(status)) {
835 errno = map_errno_from_nt_status(status);
838 mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
842 if (mapped_smb_fname == NULL) {
843 TALLOC_FREE(mapped_name);
844 return NT_STATUS_NO_MEMORY;
847 status = SMB_VFS_NEXT_GET_NT_ACL(handle, mapped_smb_fname,
848 security_info, mem_ctx, ppdesc);
849 TALLOC_FREE(mapped_name);
850 TALLOC_FREE(mapped_smb_fname);
856 catia_chmod_acl(vfs_handle_struct *handle,
860 char *mapped_name = NULL;
864 status = catia_string_replace_allocate(handle->conn,
865 path, &mapped_name, vfs_translate_to_unix);
866 if (!NT_STATUS_IS_OK(status)) {
867 errno = map_errno_from_nt_status(status);
871 ret = SMB_VFS_NEXT_CHMOD_ACL(handle, mapped_name, mode);
872 TALLOC_FREE(mapped_name);
877 catia_sys_acl_get_file(vfs_handle_struct *handle,
882 char *mapped_name = NULL;
886 status = catia_string_replace_allocate(handle->conn,
887 path, &mapped_name, vfs_translate_to_unix);
888 if (!NT_STATUS_IS_OK(status)) {
889 errno = map_errno_from_nt_status(status);
893 ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, mapped_name, type, mem_ctx);
894 TALLOC_FREE(mapped_name);
900 catia_sys_acl_set_file(vfs_handle_struct *handle,
905 char *mapped_name = NULL;
909 status = catia_string_replace_allocate(handle->conn,
910 path, &mapped_name, vfs_translate_to_unix);
911 if (!NT_STATUS_IS_OK(status)) {
912 errno = map_errno_from_nt_status(status);
916 ret = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, mapped_name, type, theacl);
917 TALLOC_FREE(mapped_name);
923 catia_sys_acl_delete_def_file(vfs_handle_struct *handle,
926 char *mapped_name = NULL;
930 status = catia_string_replace_allocate(handle->conn,
931 path, &mapped_name, vfs_translate_to_unix);
932 if (!NT_STATUS_IS_OK(status)) {
933 errno = map_errno_from_nt_status(status);
937 ret = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, mapped_name);
938 TALLOC_FREE(mapped_name);
944 catia_getxattr(vfs_handle_struct *handle, const char *path,
945 const char *name, void *value, size_t size)
947 char *mapped_name = NULL;
951 status = catia_string_replace_allocate(handle->conn,
952 name, &mapped_name, vfs_translate_to_unix);
953 if (!NT_STATUS_IS_OK(status)) {
954 errno = map_errno_from_nt_status(status);
959 ret = SMB_VFS_NEXT_GETXATTR(handle, path, mapped_name, value, size);
960 TALLOC_FREE(mapped_name);
966 catia_listxattr(vfs_handle_struct *handle, const char *path,
967 char *list, size_t size)
969 char *mapped_name = NULL;
973 status = catia_string_replace_allocate(handle->conn,
974 path, &mapped_name, vfs_translate_to_unix);
975 if (!NT_STATUS_IS_OK(status)) {
976 errno = map_errno_from_nt_status(status);
981 ret = SMB_VFS_NEXT_LISTXATTR(handle, mapped_name, list, size);
982 TALLOC_FREE(mapped_name);
988 catia_removexattr(vfs_handle_struct *handle, const char *path,
991 char *mapped_name = NULL;
995 status = catia_string_replace_allocate(handle->conn,
996 name, &mapped_name, vfs_translate_to_unix);
997 if (!NT_STATUS_IS_OK(status)) {
998 errno = map_errno_from_nt_status(status);
1003 ret = SMB_VFS_NEXT_REMOVEXATTR(handle, path, mapped_name);
1004 TALLOC_FREE(mapped_name);
1010 catia_setxattr(vfs_handle_struct *handle, const char *path,
1011 const char *name, const void *value, size_t size,
1014 char *mapped_name = NULL;
1018 status = catia_string_replace_allocate(handle->conn,
1019 name, &mapped_name, vfs_translate_to_unix);
1020 if (!NT_STATUS_IS_OK(status)) {
1021 errno = map_errno_from_nt_status(status);
1026 ret = SMB_VFS_NEXT_SETXATTR(handle, path, mapped_name, value, size, flags);
1027 TALLOC_FREE(mapped_name);
1032 static struct vfs_fn_pointers vfs_catia_fns = {
1033 .mkdir_fn = catia_mkdir,
1034 .rmdir_fn = catia_rmdir,
1035 .opendir_fn = catia_opendir,
1036 .open_fn = catia_open,
1037 .rename_fn = catia_rename,
1038 .stat_fn = catia_stat,
1039 .lstat_fn = catia_lstat,
1040 .unlink_fn = catia_unlink,
1041 .chown_fn = catia_chown,
1042 .lchown_fn = catia_lchown,
1043 .chmod_fn = catia_chmod,
1044 .chdir_fn = catia_chdir,
1045 .ntimes_fn = catia_ntimes,
1046 .realpath_fn = catia_realpath,
1047 .chflags_fn = catia_chflags,
1048 .streaminfo_fn = catia_streaminfo,
1049 .translate_name_fn = catia_translate_name,
1050 .get_nt_acl_fn = catia_get_nt_acl,
1051 .chmod_acl_fn = catia_chmod_acl,
1052 .sys_acl_get_file_fn = catia_sys_acl_get_file,
1053 .sys_acl_set_file_fn = catia_sys_acl_set_file,
1054 .sys_acl_delete_def_file_fn = catia_sys_acl_delete_def_file,
1055 .getxattr_fn = catia_getxattr,
1056 .listxattr_fn = catia_listxattr,
1057 .removexattr_fn = catia_removexattr,
1058 .setxattr_fn = catia_setxattr,
1062 NTSTATUS vfs_catia_init(void)
1066 ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "catia",
1068 if (!NT_STATUS_IS_OK(ret))
1071 vfs_catia_debug_level = debug_add_class("catia");
1072 if (vfs_catia_debug_level == -1) {
1073 vfs_catia_debug_level = DBGC_VFS;
1074 DEBUG(0, ("vfs_catia: Couldn't register custom debugging "
1077 DEBUG(10, ("vfs_catia: Debug class number of "
1078 "'catia': %d\n", vfs_catia_debug_level));