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
;
213 } else if (global
->mappings
) {
214 share_level
->mappings
= global
->mappings
;
215 (*selected_out
) = share_level
;
222 static NTSTATUS
catia_string_replace_allocate(connection_struct
*conn
,
225 enum vfs_translate_direction direction
)
227 static smb_ucs2_t
*tmpbuf
= NULL
;
229 struct share_mapping_entry
*selected
;
230 struct char_mappings
*map
= NULL
;
231 size_t converted_size
;
232 TALLOC_CTX
*ctx
= talloc_tos();
234 if (!init_mappings(conn
, &selected
)) {
235 /* No mappings found. Just use the old name */
236 *mapped_name
= talloc_strdup(NULL
, name_in
);
239 return NT_STATUS_NO_MEMORY
;
244 if ((push_ucs2_talloc(ctx
, &tmpbuf
, name_in
,
245 &converted_size
)) == false) {
246 return map_nt_error_from_unix(errno
);
252 map
= selected
->mappings
[T_PICK((*ptr
))];
258 *ptr
= map
->entry
[T_OFFSET((*ptr
))][direction
];
261 if ((pull_ucs2_talloc(ctx
, mapped_name
, tmpbuf
,
262 &converted_size
)) == false) {
264 return map_nt_error_from_unix(errno
);
270 static DIR *catia_opendir(vfs_handle_struct
*handle
,
275 char *name_mapped
= NULL
;
279 status
= catia_string_replace_allocate(handle
->conn
, fname
,
280 &name_mapped
, vfs_translate_to_unix
);
281 if (!NT_STATUS_IS_OK(status
)) {
282 errno
= map_errno_from_nt_status(status
);
286 ret
= SMB_VFS_NEXT_OPENDIR(handle
, name_mapped
, mask
, attr
);
287 TALLOC_FREE(name_mapped
);
293 * TRANSLATE_NAME call which converts the given name to
294 * "WINDOWS displayable" name
296 static NTSTATUS
catia_translate_name(struct vfs_handle_struct
*handle
,
297 const char *orig_name
,
298 enum vfs_translate_direction direction
,
304 NTSTATUS status
, ret
;
307 * Copy the supplied name and free the memory for mapped_name,
308 * already allocated by the caller.
309 * We will be allocating new memory for mapped_name in
310 * catia_string_replace_allocate
312 name
= talloc_strdup(talloc_tos(), orig_name
);
315 return NT_STATUS_NO_MEMORY
;
317 status
= catia_string_replace_allocate(handle
->conn
, name
,
318 &mapped_name
, direction
);
321 if (!NT_STATUS_IS_OK(status
)) {
325 ret
= SMB_VFS_NEXT_TRANSLATE_NAME(handle
, mapped_name
, direction
,
326 mem_ctx
, pmapped_name
);
328 if (NT_STATUS_EQUAL(ret
, NT_STATUS_NONE_MAPPED
)) {
329 *pmapped_name
= talloc_move(mem_ctx
, &mapped_name
);
330 /* we need to return the former translation result here */
333 TALLOC_FREE(mapped_name
);
339 static int catia_open(vfs_handle_struct
*handle
,
340 struct smb_filename
*smb_fname
,
345 char *name_mapped
= NULL
;
350 tmp_base_name
= smb_fname
->base_name
;
351 status
= catia_string_replace_allocate(handle
->conn
,
352 smb_fname
->base_name
,
353 &name_mapped
, vfs_translate_to_unix
);
354 if (!NT_STATUS_IS_OK(status
)) {
355 errno
= map_errno_from_nt_status(status
);
359 smb_fname
->base_name
= name_mapped
;
360 ret
= SMB_VFS_NEXT_OPEN(handle
, smb_fname
, fsp
, flags
, mode
);
361 smb_fname
->base_name
= tmp_base_name
;
362 TALLOC_FREE(name_mapped
);
367 static int catia_rename(vfs_handle_struct
*handle
,
368 const struct smb_filename
*smb_fname_src
,
369 const struct smb_filename
*smb_fname_dst
)
371 TALLOC_CTX
*ctx
= talloc_tos();
372 struct smb_filename
*smb_fname_src_tmp
= NULL
;
373 struct smb_filename
*smb_fname_dst_tmp
= NULL
;
374 char *src_name_mapped
= NULL
;
375 char *dst_name_mapped
= NULL
;
379 status
= catia_string_replace_allocate(handle
->conn
,
380 smb_fname_src
->base_name
,
381 &src_name_mapped
, vfs_translate_to_unix
);
382 if (!NT_STATUS_IS_OK(status
)) {
383 errno
= map_errno_from_nt_status(status
);
387 status
= catia_string_replace_allocate(handle
->conn
,
388 smb_fname_dst
->base_name
,
389 &dst_name_mapped
, vfs_translate_to_unix
);
390 if (!NT_STATUS_IS_OK(status
)) {
391 errno
= map_errno_from_nt_status(status
);
395 /* Setup temporary smb_filename structs. */
396 smb_fname_src_tmp
= cp_smb_filename(ctx
, smb_fname_src
);
397 if (smb_fname_src_tmp
== NULL
) {
402 smb_fname_dst_tmp
= cp_smb_filename(ctx
, smb_fname_dst
);
403 if (smb_fname_dst_tmp
== NULL
) {
408 smb_fname_src_tmp
->base_name
= src_name_mapped
;
409 smb_fname_dst_tmp
->base_name
= dst_name_mapped
;
410 DEBUG(10, ("converted old name: %s\n",
411 smb_fname_str_dbg(smb_fname_src_tmp
)));
412 DEBUG(10, ("converted new name: %s\n",
413 smb_fname_str_dbg(smb_fname_dst_tmp
)));
415 ret
= SMB_VFS_NEXT_RENAME(handle
, smb_fname_src_tmp
,
418 TALLOC_FREE(src_name_mapped
);
419 TALLOC_FREE(dst_name_mapped
);
420 TALLOC_FREE(smb_fname_src_tmp
);
421 TALLOC_FREE(smb_fname_dst_tmp
);
425 static int catia_stat(vfs_handle_struct
*handle
,
426 struct smb_filename
*smb_fname
)
433 status
= catia_string_replace_allocate(handle
->conn
,
434 smb_fname
->base_name
,
435 &name
, vfs_translate_to_unix
);
436 if (!NT_STATUS_IS_OK(status
)) {
437 errno
= map_errno_from_nt_status(status
);
441 tmp_base_name
= smb_fname
->base_name
;
442 smb_fname
->base_name
= name
;
444 ret
= SMB_VFS_NEXT_STAT(handle
, smb_fname
);
445 smb_fname
->base_name
= tmp_base_name
;
451 static int catia_lstat(vfs_handle_struct
*handle
,
452 struct smb_filename
*smb_fname
)
459 status
= catia_string_replace_allocate(handle
->conn
,
460 smb_fname
->base_name
,
461 &name
, vfs_translate_to_unix
);
462 if (!NT_STATUS_IS_OK(status
)) {
463 errno
= map_errno_from_nt_status(status
);
467 tmp_base_name
= smb_fname
->base_name
;
468 smb_fname
->base_name
= name
;
470 ret
= SMB_VFS_NEXT_LSTAT(handle
, smb_fname
);
471 smb_fname
->base_name
= tmp_base_name
;
477 static int catia_unlink(vfs_handle_struct
*handle
,
478 const struct smb_filename
*smb_fname
)
480 struct smb_filename
*smb_fname_tmp
= NULL
;
485 status
= catia_string_replace_allocate(handle
->conn
,
486 smb_fname
->base_name
,
487 &name
, vfs_translate_to_unix
);
488 if (!NT_STATUS_IS_OK(status
)) {
489 errno
= map_errno_from_nt_status(status
);
493 /* Setup temporary smb_filename structs. */
494 smb_fname_tmp
= cp_smb_filename(talloc_tos(), smb_fname
);
495 if (smb_fname_tmp
== NULL
) {
500 smb_fname_tmp
->base_name
= name
;
501 ret
= SMB_VFS_NEXT_UNLINK(handle
, smb_fname_tmp
);
502 TALLOC_FREE(smb_fname_tmp
);
508 static int catia_chown(vfs_handle_struct
*handle
,
517 status
= catia_string_replace_allocate(handle
->conn
, path
,
518 &name
, vfs_translate_to_unix
);
519 if (!NT_STATUS_IS_OK(status
)) {
520 errno
= map_errno_from_nt_status(status
);
524 ret
= SMB_VFS_NEXT_CHOWN(handle
, name
, uid
, gid
);
530 static int catia_lchown(vfs_handle_struct
*handle
,
539 status
= catia_string_replace_allocate(handle
->conn
, path
,
540 &name
, vfs_translate_to_unix
);
541 if (!NT_STATUS_IS_OK(status
)) {
542 errno
= map_errno_from_nt_status(status
);
546 ret
= SMB_VFS_NEXT_LCHOWN(handle
, name
, uid
, gid
);
552 static int catia_chmod(vfs_handle_struct
*handle
, const char *path
, mode_t mode
)
558 status
= catia_string_replace_allocate(handle
->conn
, path
,
559 &name
, vfs_translate_to_unix
);
560 if (!NT_STATUS_IS_OK(status
)) {
561 errno
= map_errno_from_nt_status(status
);
565 ret
= SMB_VFS_NEXT_CHMOD(handle
, name
, mode
);
571 static int catia_rmdir(vfs_handle_struct
*handle
,
578 status
= catia_string_replace_allocate(handle
->conn
, path
,
579 &name
, vfs_translate_to_unix
);
580 if (!NT_STATUS_IS_OK(status
)) {
581 errno
= map_errno_from_nt_status(status
);
585 ret
= SMB_VFS_NEXT_RMDIR(handle
, name
);
591 static int catia_mkdir(vfs_handle_struct
*handle
,
599 status
= catia_string_replace_allocate(handle
->conn
, path
,
600 &name
, vfs_translate_to_unix
);
601 if (!NT_STATUS_IS_OK(status
)) {
602 errno
= map_errno_from_nt_status(status
);
606 ret
= SMB_VFS_NEXT_MKDIR(handle
, name
, mode
);
612 static int catia_chdir(vfs_handle_struct
*handle
,
619 status
= catia_string_replace_allocate(handle
->conn
, path
,
620 &name
, vfs_translate_to_unix
);
621 if (!NT_STATUS_IS_OK(status
)) {
622 errno
= map_errno_from_nt_status(status
);
626 ret
= SMB_VFS_NEXT_CHDIR(handle
, name
);
632 static int catia_ntimes(vfs_handle_struct
*handle
,
633 const struct smb_filename
*smb_fname
,
634 struct smb_file_time
*ft
)
636 struct smb_filename
*smb_fname_tmp
= NULL
;
641 status
= catia_string_replace_allocate(handle
->conn
,
642 smb_fname
->base_name
,
643 &name
, vfs_translate_to_unix
);
644 if (!NT_STATUS_IS_OK(status
)) {
645 errno
= map_errno_from_nt_status(status
);
649 smb_fname_tmp
= cp_smb_filename(talloc_tos(), smb_fname
);
650 if (smb_fname_tmp
== NULL
) {
655 smb_fname_tmp
->base_name
= name
;
656 ret
= SMB_VFS_NEXT_NTIMES(handle
, smb_fname_tmp
, ft
);
658 TALLOC_FREE(smb_fname_tmp
);
664 catia_realpath(vfs_handle_struct
*handle
, const char *path
)
666 char *mapped_name
= NULL
;
670 status
= catia_string_replace_allocate(handle
->conn
, path
,
671 &mapped_name
, vfs_translate_to_unix
);
672 if (!NT_STATUS_IS_OK(status
)) {
673 errno
= map_errno_from_nt_status(status
);
677 ret
= SMB_VFS_NEXT_REALPATH(handle
, mapped_name
);
678 TALLOC_FREE(mapped_name
);
683 static int catia_chflags(struct vfs_handle_struct
*handle
,
684 const char *path
, unsigned int flags
)
686 char *mapped_name
= NULL
;
690 status
= catia_string_replace_allocate(handle
->conn
, path
,
691 &mapped_name
, vfs_translate_to_unix
);
692 if (!NT_STATUS_IS_OK(status
)) {
693 errno
= map_errno_from_nt_status(status
);
697 ret
= SMB_VFS_NEXT_CHFLAGS(handle
, mapped_name
, flags
);
698 TALLOC_FREE(mapped_name
);
704 catia_streaminfo(struct vfs_handle_struct
*handle
,
705 struct files_struct
*fsp
,
708 unsigned int *num_streams
,
709 struct stream_struct
**streams
)
711 char *mapped_name
= NULL
;
714 status
= catia_string_replace_allocate(handle
->conn
, path
,
715 &mapped_name
, vfs_translate_to_unix
);
716 if (!NT_STATUS_IS_OK(status
)) {
717 errno
= map_errno_from_nt_status(status
);
721 status
= SMB_VFS_NEXT_STREAMINFO(handle
, fsp
, mapped_name
,
722 mem_ctx
, num_streams
,streams
);
723 TALLOC_FREE(mapped_name
);
729 catia_get_nt_acl(struct vfs_handle_struct
*handle
,
731 uint32 security_info
,
733 struct security_descriptor
**ppdesc
)
735 char *mapped_name
= NULL
;
738 status
= catia_string_replace_allocate(handle
->conn
,
739 path
, &mapped_name
, vfs_translate_to_unix
);
740 if (!NT_STATUS_IS_OK(status
)) {
741 errno
= map_errno_from_nt_status(status
);
744 status
= SMB_VFS_NEXT_GET_NT_ACL(handle
, mapped_name
,
745 security_info
, mem_ctx
, ppdesc
);
746 TALLOC_FREE(mapped_name
);
752 catia_chmod_acl(vfs_handle_struct
*handle
,
756 char *mapped_name
= NULL
;
760 status
= catia_string_replace_allocate(handle
->conn
,
761 path
, &mapped_name
, vfs_translate_to_unix
);
762 if (!NT_STATUS_IS_OK(status
)) {
763 errno
= map_errno_from_nt_status(status
);
767 ret
= SMB_VFS_NEXT_CHMOD_ACL(handle
, mapped_name
, mode
);
768 TALLOC_FREE(mapped_name
);
773 catia_sys_acl_get_file(vfs_handle_struct
*handle
,
778 char *mapped_name
= NULL
;
782 status
= catia_string_replace_allocate(handle
->conn
,
783 path
, &mapped_name
, vfs_translate_to_unix
);
784 if (!NT_STATUS_IS_OK(status
)) {
785 errno
= map_errno_from_nt_status(status
);
789 ret
= SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle
, mapped_name
, type
, mem_ctx
);
790 TALLOC_FREE(mapped_name
);
796 catia_sys_acl_set_file(vfs_handle_struct
*handle
,
801 char *mapped_name
= NULL
;
805 status
= catia_string_replace_allocate(handle
->conn
,
806 path
, &mapped_name
, vfs_translate_to_unix
);
807 if (!NT_STATUS_IS_OK(status
)) {
808 errno
= map_errno_from_nt_status(status
);
812 ret
= SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle
, mapped_name
, type
, theacl
);
813 TALLOC_FREE(mapped_name
);
819 catia_sys_acl_delete_def_file(vfs_handle_struct
*handle
,
822 char *mapped_name
= NULL
;
826 status
= catia_string_replace_allocate(handle
->conn
,
827 path
, &mapped_name
, vfs_translate_to_unix
);
828 if (!NT_STATUS_IS_OK(status
)) {
829 errno
= map_errno_from_nt_status(status
);
833 ret
= SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle
, mapped_name
);
834 TALLOC_FREE(mapped_name
);
840 catia_getxattr(vfs_handle_struct
*handle
, const char *path
,
841 const char *name
, void *value
, size_t size
)
843 char *mapped_name
= NULL
;
847 status
= catia_string_replace_allocate(handle
->conn
,
848 name
, &mapped_name
, vfs_translate_to_unix
);
849 if (!NT_STATUS_IS_OK(status
)) {
850 errno
= map_errno_from_nt_status(status
);
855 ret
= SMB_VFS_NEXT_GETXATTR(handle
, path
, mapped_name
, value
, size
);
856 TALLOC_FREE(mapped_name
);
862 catia_listxattr(vfs_handle_struct
*handle
, const char *path
,
863 char *list
, size_t size
)
865 char *mapped_name
= NULL
;
869 status
= catia_string_replace_allocate(handle
->conn
,
870 path
, &mapped_name
, vfs_translate_to_unix
);
871 if (!NT_STATUS_IS_OK(status
)) {
872 errno
= map_errno_from_nt_status(status
);
877 ret
= SMB_VFS_NEXT_LISTXATTR(handle
, mapped_name
, list
, size
);
878 TALLOC_FREE(mapped_name
);
884 catia_removexattr(vfs_handle_struct
*handle
, const char *path
,
887 char *mapped_name
= NULL
;
891 status
= catia_string_replace_allocate(handle
->conn
,
892 name
, &mapped_name
, vfs_translate_to_unix
);
893 if (!NT_STATUS_IS_OK(status
)) {
894 errno
= map_errno_from_nt_status(status
);
899 ret
= SMB_VFS_NEXT_REMOVEXATTR(handle
, path
, mapped_name
);
900 TALLOC_FREE(mapped_name
);
906 catia_setxattr(vfs_handle_struct
*handle
, const char *path
,
907 const char *name
, const void *value
, size_t size
,
910 char *mapped_name
= NULL
;
914 status
= catia_string_replace_allocate(handle
->conn
,
915 name
, &mapped_name
, vfs_translate_to_unix
);
916 if (!NT_STATUS_IS_OK(status
)) {
917 errno
= map_errno_from_nt_status(status
);
922 ret
= SMB_VFS_NEXT_SETXATTR(handle
, path
, mapped_name
, value
, size
, flags
);
923 TALLOC_FREE(mapped_name
);
928 static struct vfs_fn_pointers vfs_catia_fns
= {
929 .mkdir_fn
= catia_mkdir
,
930 .rmdir_fn
= catia_rmdir
,
931 .opendir_fn
= catia_opendir
,
932 .open_fn
= catia_open
,
933 .rename_fn
= catia_rename
,
934 .stat_fn
= catia_stat
,
935 .lstat_fn
= catia_lstat
,
936 .unlink_fn
= catia_unlink
,
937 .chown_fn
= catia_chown
,
938 .lchown_fn
= catia_lchown
,
939 .chmod_fn
= catia_chmod
,
940 .chdir_fn
= catia_chdir
,
941 .ntimes_fn
= catia_ntimes
,
942 .realpath_fn
= catia_realpath
,
943 .chflags_fn
= catia_chflags
,
944 .streaminfo_fn
= catia_streaminfo
,
945 .translate_name_fn
= catia_translate_name
,
946 .get_nt_acl_fn
= catia_get_nt_acl
,
947 .chmod_acl_fn
= catia_chmod_acl
,
948 .sys_acl_get_file_fn
= catia_sys_acl_get_file
,
949 .sys_acl_set_file_fn
= catia_sys_acl_set_file
,
950 .sys_acl_delete_def_file_fn
= catia_sys_acl_delete_def_file
,
951 .getxattr_fn
= catia_getxattr
,
952 .listxattr_fn
= catia_listxattr
,
953 .removexattr_fn
= catia_removexattr
,
954 .setxattr_fn
= catia_setxattr
,
957 NTSTATUS
vfs_catia_init(void)
961 ret
= smb_register_vfs(SMB_VFS_INTERFACE_VERSION
, "catia",
963 if (!NT_STATUS_IS_OK(ret
))
966 vfs_catia_debug_level
= debug_add_class("catia");
967 if (vfs_catia_debug_level
== -1) {
968 vfs_catia_debug_level
= DBGC_VFS
;
969 DEBUG(0, ("vfs_catia: Couldn't register custom debugging "
972 DEBUG(10, ("vfs_catia: Debug class number of "
973 "'catia': %d\n", vfs_catia_debug_level
));