2 Unix SMB/CIFS implementation.
4 simple NTVFS filesystem backend
6 Copyright (C) Andrew Tridgell 2003
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 this implements a very simple NTVFS filesystem backend.
25 this backend largely ignores the POSIX -> CIFS mappings, just doing absolutely
26 minimal work to give a working backend.
37 connect to a share - used when a tree_connect operation comes
38 in. For a disk based backend we needs to ensure that the base
39 directory exists (tho it doesn't need to be accessible by the user,
42 static NTSTATUS svfs_connect(struct request_context *req, const char *sharename)
45 struct tcon_context *conn = req->conn;
46 struct svfs_private *private;
48 conn->ntvfs_private = talloc(conn->mem_ctx, sizeof(struct svfs_private));
50 private = conn->ntvfs_private;
52 private->next_search_handle = 0;
53 private->connectpath = talloc_strdup(conn->mem_ctx, lp_pathname(conn->service));
55 /* the directory must exist */
56 if (stat(private->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) {
57 DEBUG(0,("'%s' is not a directory, when connecting to [%s]\n",
58 private->connectpath, sharename));
59 return NT_STATUS_BAD_NETWORK_NAME;
62 conn->fs_type = talloc_strdup(conn->mem_ctx, "NTFS");
63 conn->dev_type = talloc_strdup(conn->mem_ctx, "A:");
69 disconnect from a share
71 static NTSTATUS svfs_disconnect(struct tcon_context *req)
77 delete a file - the dirtype specifies the file types to include in the search.
78 The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
80 static NTSTATUS svfs_unlink(struct request_context *req, struct smb_unlink *unl)
84 unix_path = svfs_unix_path(req, unl->in.pattern);
86 /* ignoring wildcards ... */
87 if (unlink(unix_path) == -1) {
88 return map_nt_error_from_unix(errno);
96 ioctl interface - we don't do any
98 static NTSTATUS svfs_ioctl(struct request_context *req, union smb_ioctl *io)
100 return NT_STATUS_INVALID_PARAMETER;
104 check if a directory exists
106 static NTSTATUS svfs_chkpath(struct request_context *req, struct smb_chkpath *cp)
111 unix_path = svfs_unix_path(req, cp->in.path);
113 if (stat(unix_path, &st) == -1) {
114 return map_nt_error_from_unix(errno);
117 if (!S_ISDIR(st.st_mode)) {
118 return NT_STATUS_NOT_A_DIRECTORY;
125 approximately map a struct stat to a generic fileinfo struct
127 static NTSTATUS svfs_map_fileinfo(struct request_context *req, union smb_fileinfo *info, struct stat *st)
129 unix_to_nt_time(&info->generic.out.create_time, st->st_ctime);
130 unix_to_nt_time(&info->generic.out.access_time, st->st_atime);
131 unix_to_nt_time(&info->generic.out.write_time, st->st_mtime);
132 unix_to_nt_time(&info->generic.out.change_time, st->st_mtime);
133 info->generic.out.alloc_size = st->st_size;
134 info->generic.out.size = st->st_size;
135 info->generic.out.attrib = svfs_unix_to_dos_attrib(st->st_mode);
136 info->generic.out.alloc_size = st->st_blksize * st->st_blocks;
137 info->generic.out.nlink = st->st_nlink;
138 info->generic.out.directory = S_ISDIR(st->st_mode) ? 1 : 0;
139 info->generic.out.file_id = svfs_file_id(st);
140 /* REWRITE: TODO stuff in here */
141 info->generic.out.delete_pending = 0;
142 info->generic.out.ea_size = 0;
143 info->generic.out.num_eas = 0;
144 info->generic.out.fname.s = talloc_strdup(req->mem_ctx, "TODO - STORE FILENAME");
145 info->generic.out.alt_fname.s = talloc_strdup(req->mem_ctx, "TODO - STORE ALT_FN");
146 info->generic.out.ex_attrib = 0;
147 info->generic.out.compressed_size = 0;
148 info->generic.out.format = 0;
149 info->generic.out.unit_shift = 0;
150 info->generic.out.chunk_shift = 0;
151 info->generic.out.cluster_shift = 0;
153 info->generic.out.access_flags = 0;
154 info->generic.out.position = 0;
155 info->generic.out.mode = 0;
156 info->generic.out.alignment_requirement = 0;
157 info->generic.out.reparse_tag = 0;
158 info->generic.out.num_streams = 0;
159 /* setup a single data stream */
160 info->generic.out.num_streams = 1;
161 info->generic.out.streams = talloc(req->mem_ctx, sizeof(info->stream_info.out.streams[0]));
162 if (!info->generic.out.streams) {
163 return NT_STATUS_NO_MEMORY;
165 info->generic.out.streams[0].size = st->st_size;
166 info->generic.out.streams[0].alloc_size = st->st_size;
167 info->generic.out.streams[0].stream_name.s = talloc_strdup(req->mem_ctx,"::$DATA");
174 return info on a pathname
176 static NTSTATUS svfs_qpathinfo(struct request_context *req, union smb_fileinfo *info)
181 DEBUG(19,("svfs_qpathinfo: file %s level 0x%x\n", info->generic.in.fname, info->generic.level));
182 if (info->generic.level != RAW_FILEINFO_GENERIC) {
183 return ntvfs_map_qpathinfo(req, info);
186 unix_path = svfs_unix_path(req, info->generic.in.fname);
187 DEBUG(19,("svfs_qpathinfo: file %s\n", unix_path));
188 if (stat(unix_path, &st) == -1) {
189 DEBUG(19,("svfs_qpathinfo: file %s errno=%d\n", unix_path, errno));
192 return map_nt_error_from_unix(errno);
194 DEBUG(19,("svfs_qpathinfo: file %s, stat done\n", unix_path));
195 return svfs_map_fileinfo(req, info, &st);
199 query info on a open file
201 static NTSTATUS svfs_qfileinfo(struct request_context *req, union smb_fileinfo *info)
205 if (info->generic.level != RAW_FILEINFO_GENERIC) {
206 return ntvfs_map_qfileinfo(req, info);
209 if (fstat(info->generic.in.fnum, &st) == -1) {
212 return map_nt_error_from_unix(errno);
215 return svfs_map_fileinfo(req, info, &st);
222 static NTSTATUS svfs_open(struct request_context *req, union smb_open *io)
228 if (io->generic.level != RAW_OPEN_GENERIC) {
229 return ntvfs_map_open(req, io);
232 unix_path = svfs_unix_path(req, io->ntcreatex.in.fname);
234 switch (io->generic.in.open_disposition) {
235 case NTCREATEX_DISP_SUPERSEDE:
236 flags = O_RDWR | O_CREAT | O_TRUNC;
238 case NTCREATEX_DISP_OPEN:
241 case NTCREATEX_DISP_CREATE:
242 flags = O_RDWR | O_CREAT | O_EXCL;
244 case NTCREATEX_DISP_OPEN_IF:
245 flags = O_RDWR | O_CREAT;
247 case NTCREATEX_DISP_OVERWRITE:
250 case NTCREATEX_DISP_OVERWRITE_IF:
251 flags = O_RDWR | O_CREAT | O_TRUNC;
258 if (io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY) {
259 flags = O_RDONLY | O_DIRECTORY;
260 switch (io->generic.in.open_disposition) {
261 case NTCREATEX_DISP_CREATE:
262 if (mkdir(unix_path, 0755) == -1) {
263 DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno));
264 return map_nt_error_from_unix(errno);
267 case NTCREATEX_DISP_OPEN_IF:
268 if (mkdir(unix_path, 0755) == -1 && errno != EEXIST) {
269 DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno));
270 return map_nt_error_from_unix(errno);
275 DEBUG(9,("svfs_open: file %s flags=0x%x\n", unix_path, flags));
276 fd = open(unix_path, flags, 0644);
277 DEBUG(9,("svfs_open: fd=%d errno=%d\n", fd, errno));
281 return map_nt_error_from_unix(errno);
284 if (fstat(fd, &st) == -1) {
285 DEBUG(9,("svfs_open: fstat errno=%d\n", errno));
289 return map_nt_error_from_unix(errno);
292 ZERO_STRUCT(io->generic.out);
294 unix_to_nt_time(&io->generic.out.create_time, st.st_ctime);
295 unix_to_nt_time(&io->generic.out.access_time, st.st_atime);
296 unix_to_nt_time(&io->generic.out.write_time, st.st_mtime);
297 unix_to_nt_time(&io->generic.out.change_time, st.st_mtime);
298 io->generic.out.fnum = fd;
299 io->generic.out.alloc_size = st.st_size;
300 io->generic.out.size = st.st_size;
301 io->generic.out.attrib = svfs_unix_to_dos_attrib(st.st_mode);
302 io->generic.out.is_directory = S_ISDIR(st.st_mode) ? 1 : 0;
310 static NTSTATUS svfs_mkdir(struct request_context *req, union smb_mkdir *md)
314 if (md->generic.level != RAW_MKDIR_MKDIR) {
315 return NT_STATUS_INVALID_LEVEL;
318 unix_path = svfs_unix_path(req, md->mkdir.in.path);
320 if (mkdir(unix_path, 0777) == -1) {
321 return map_nt_error_from_unix(errno);
330 static NTSTATUS svfs_rmdir(struct request_context *req, struct smb_rmdir *rd)
334 unix_path = svfs_unix_path(req, rd->in.path);
336 if (rmdir(unix_path) == -1) {
337 return map_nt_error_from_unix(errno);
344 rename a set of files
346 static NTSTATUS svfs_rename(struct request_context *req, union smb_rename *ren)
348 char *unix_path1, *unix_path2;
350 if (ren->generic.level != RAW_RENAME_RENAME) {
351 return NT_STATUS_INVALID_LEVEL;
354 unix_path1 = svfs_unix_path(req, ren->rename.in.pattern1);
355 unix_path2 = svfs_unix_path(req, ren->rename.in.pattern2);
357 if (rename(unix_path1, unix_path2) != 0) {
358 return map_nt_error_from_unix(errno);
367 static NTSTATUS svfs_copy(struct request_context *req, struct smb_copy *cp)
369 return NT_STATUS_NOT_SUPPORTED;
375 static NTSTATUS svfs_read(struct request_context *req, union smb_read *rd)
379 if (rd->generic.level != RAW_READ_READX) {
380 return NT_STATUS_NOT_SUPPORTED;
383 ret = pread(rd->readx.in.fnum,
386 rd->readx.in.offset);
388 return map_nt_error_from_unix(errno);
391 rd->readx.out.nread = ret;
392 rd->readx.out.remaining = 0; /* should fill this in? */
393 rd->readx.out.compaction_mode = 0;
401 static NTSTATUS svfs_write(struct request_context *req, union smb_write *wr)
405 switch (wr->generic.level) {
406 case RAW_WRITE_WRITEX:
407 ret = pwrite(wr->writex.in.fnum,
410 wr->writex.in.offset);
412 return map_nt_error_from_unix(errno);
415 wr->writex.out.nwritten = ret;
416 wr->writex.out.remaining = 0; /* should fill this in? */
420 case RAW_WRITE_WRITE:
421 if (wr->write.in.count == 0) {
423 ret = ftruncate(wr->write.in.fnum, wr->write.in.offset);
425 ret = pwrite(wr->write.in.fnum,
428 wr->write.in.offset);
431 return map_nt_error_from_unix(errno);
434 wr->write.out.nwritten = ret;
439 return NT_STATUS_NOT_SUPPORTED;
445 static NTSTATUS svfs_seek(struct request_context *req, struct smb_seek *io)
447 return NT_STATUS_NOT_SUPPORTED;
453 static NTSTATUS svfs_flush(struct request_context *req, struct smb_flush *io)
462 static NTSTATUS svfs_close(struct request_context *req, union smb_close *io)
464 if (io->generic.level != RAW_CLOSE_CLOSE) {
465 /* we need a mapping function */
466 return NT_STATUS_INVALID_LEVEL;
469 if (close(io->close.in.fnum) != 0) {
470 return map_nt_error_from_unix(errno);
477 exit - closing files?
479 static NTSTATUS svfs_exit(struct request_context *req)
481 return NT_STATUS_NOT_SUPPORTED;
487 static NTSTATUS svfs_lock(struct request_context *req, union smb_lock *lck)
489 DEBUG(0,("REWRITE: not doing byte range locking!\n"));
494 set info on a pathname
496 static NTSTATUS svfs_setpathinfo(struct request_context *req, union smb_setfileinfo *st)
498 return NT_STATUS_NOT_SUPPORTED;
502 set info on a open file
504 static NTSTATUS svfs_setfileinfo(struct request_context *req,
505 union smb_setfileinfo *info)
507 struct utimbuf unix_times;
510 switch (info->generic.level) {
511 case RAW_SFILEINFO_END_OF_FILE_INFO:
512 case RAW_SFILEINFO_END_OF_FILE_INFORMATION:
513 if (ftruncate(info->end_of_file_info.file.fnum,
514 info->end_of_file_info.in.size) != 0) {
515 return map_nt_error_from_unix(errno);
518 case RAW_SFILEINFO_SETATTRE:
519 unix_times.actime = info->setattre.in.access_time;
520 unix_times.modtime = info->setattre.in.write_time;
521 fd = info->setattre.file.fnum;
523 if (unix_times.actime == 0 && unix_times.modtime == 0) {
527 /* set modify time = to access time if modify time was 0 */
528 if (unix_times.actime != 0 && unix_times.modtime == 0) {
529 unix_times.modtime = unix_times.actime;
532 /* Set the date on this file */
533 if (svfs_file_utime(fd, &unix_times) != 0) {
534 return NT_STATUS_ACCESS_DENIED;
543 return filesystem space info
545 static NTSTATUS svfs_fsinfo(struct request_context *req, union smb_fsinfo *fs)
547 struct svfs_private *private = req->conn->ntvfs_private;
550 if (fs->generic.level != RAW_QFS_GENERIC) {
551 return ntvfs_map_fsinfo(req, fs);
554 if (sys_fsusage(private->connectpath,
555 &fs->generic.out.blocks_free,
556 &fs->generic.out.blocks_total) == -1) {
557 return map_nt_error_from_unix(errno);
560 fs->generic.out.block_size = 512;
562 if (stat(private->connectpath, &st) != 0) {
563 return NT_STATUS_DISK_CORRUPT_ERROR;
566 fs->generic.out.fs_id = st.st_ino;
567 unix_to_nt_time(&fs->generic.out.create_time, st.st_ctime);
568 fs->generic.out.serial_number = st.st_ino;
569 fs->generic.out.fs_attr = 0;
570 fs->generic.out.max_file_component_length = 255;
571 fs->generic.out.device_type = 0;
572 fs->generic.out.device_characteristics = 0;
573 fs->generic.out.quota_soft = 0;
574 fs->generic.out.quota_hard = 0;
575 fs->generic.out.quota_flags = 0;
576 fs->generic.out.volume_name = talloc_strdup(req->mem_ctx, lp_servicename(req->conn->service));
577 fs->generic.out.fs_type = req->conn->fs_type;
584 return filesystem attribute info
586 static NTSTATUS svfs_fsattr(struct request_context *req, union smb_fsattr *fs)
589 struct svfs_private *private = req->conn->ntvfs_private;
591 if (fs->generic.level != RAW_FSATTR_GENERIC) {
592 return ntvfs_map_fsattr(req, fs);
595 if (stat(private->connectpath, &st) != 0) {
596 return map_nt_error_from_unix(errno);
599 unix_to_nt_time(&fs->generic.out.create_time, st.st_ctime);
600 fs->generic.out.fs_attr =
601 FILE_CASE_PRESERVED_NAMES |
602 FILE_CASE_SENSITIVE_SEARCH |
603 FILE_PERSISTENT_ACLS;
604 fs->generic.out.max_file_component_length = 255;
605 fs->generic.out.serial_number = 1;
606 fs->generic.out.fs_type = talloc_strdup(req->mem_ctx, "NTFS");
607 fs->generic.out.volume_name = talloc_strdup(req->mem_ctx,
608 lp_servicename(req->conn->service));
615 return print queue info
617 static NTSTATUS svfs_lpq(struct request_context *req, union smb_lpq *lpq)
619 return NT_STATUS_NOT_SUPPORTED;
623 list files in a directory matching a wildcard pattern
625 static NTSTATUS svfs_search_first(struct request_context *req, union smb_search_first *io,
626 void *search_private,
627 BOOL (*callback)(void *, union smb_search_data *))
629 struct svfs_dir *dir;
631 struct svfs_private *private = req->conn->ntvfs_private;
632 struct search_state *search;
633 union smb_search_data file;
637 if (io->generic.level != RAW_SEARCH_BOTH_DIRECTORY_INFO) {
638 return NT_STATUS_NOT_SUPPORTED;
641 mem_ctx = talloc_init("svfs_search");
643 search = talloc_zero(mem_ctx, sizeof(struct search_state));
645 return NT_STATUS_NO_MEMORY;
648 max_count = io->t2ffirst.in.max_count;
650 dir = svfs_list(mem_ctx, req, io->t2ffirst.in.pattern);
652 talloc_destroy_pool(mem_ctx);
653 return NT_STATUS_FOOBAR;
656 search->mem_ctx = mem_ctx;
657 search->handle = private->next_search_handle;
660 if (dir->count < max_count) {
661 max_count = dir->count;
664 for (i=0; i < max_count;i++) {
666 unix_to_nt_time(&file.both_directory_info.create_time, dir->files[i].st.st_ctime);
667 unix_to_nt_time(&file.both_directory_info.access_time, dir->files[i].st.st_atime);
668 unix_to_nt_time(&file.both_directory_info.write_time, dir->files[i].st.st_mtime);
669 unix_to_nt_time(&file.both_directory_info.change_time, dir->files[i].st.st_mtime);
670 file.both_directory_info.name.s = dir->files[i].name;
671 file.both_directory_info.short_name.s = dir->files[i].name;
672 file.both_directory_info.size = dir->files[i].st.st_size;
673 file.both_directory_info.attrib = svfs_unix_to_dos_attrib(dir->files[i].st.st_mode);
675 if (!callback(search_private, &file)) {
680 search->current_index = i;
682 io->t2ffirst.out.count = i;
683 io->t2ffirst.out.handle = search->handle;
684 io->t2ffirst.out.end_of_search = (i == dir->count) ? 1 : 0;
686 /* work out if we are going to keep the search state */
687 if ((io->t2ffirst.in.flags & FLAG_TRANS2_FIND_CLOSE) ||
688 ((io->t2ffirst.in.flags & FLAG_TRANS2_FIND_CLOSE_IF_END) && (i == dir->count))) {
689 talloc_destroy(search->mem_ctx);
691 private->next_search_handle++;
692 DLIST_ADD(private->search, search);
698 /* continue a search */
699 static NTSTATUS svfs_search_next(struct request_context *req, union smb_search_next *io,
700 void *search_private,
701 BOOL (*callback)(void *, union smb_search_data *))
703 struct svfs_dir *dir;
705 struct svfs_private *private = req->conn->ntvfs_private;
706 struct search_state *search;
707 union smb_search_data file;
710 if (io->generic.level != RAW_SEARCH_BOTH_DIRECTORY_INFO) {
711 return NT_STATUS_NOT_SUPPORTED;
714 for (search=private->search; search; search = search->next) {
715 if (search->handle == io->t2fnext.in.handle) break;
719 /* we didn't find the search handle */
720 return NT_STATUS_FOOBAR;
725 /* the client might be asking for something other than just continuing
727 if (!(io->t2fnext.in.flags & FLAG_TRANS2_FIND_CONTINUE) &&
728 (io->t2fnext.in.flags & FLAG_TRANS2_FIND_REQUIRE_RESUME) &&
729 io->t2fnext.in.last_name && *io->t2fnext.in.last_name) {
730 /* look backwards first */
731 for (i=search->current_index; i > 0; i--) {
732 if (strcmp(io->t2fnext.in.last_name, dir->files[i-1].name) == 0) {
733 search->current_index = i;
738 /* then look forwards */
739 for (i=search->current_index+1; i <= dir->count; i++) {
740 if (strcmp(io->t2fnext.in.last_name, dir->files[i-1].name) == 0) {
741 search->current_index = i;
748 max_count = search->current_index + io->t2fnext.in.max_count;
750 if (max_count > dir->count) {
751 max_count = dir->count;
754 for (i = search->current_index; i < max_count;i++) {
756 unix_to_nt_time(&file.both_directory_info.create_time, dir->files[i].st.st_ctime);
757 unix_to_nt_time(&file.both_directory_info.access_time, dir->files[i].st.st_atime);
758 unix_to_nt_time(&file.both_directory_info.write_time, dir->files[i].st.st_mtime);
759 unix_to_nt_time(&file.both_directory_info.change_time, dir->files[i].st.st_mtime);
760 file.both_directory_info.name.s = dir->files[i].name;
761 file.both_directory_info.short_name.s = dir->files[i].name;
762 file.both_directory_info.size = dir->files[i].st.st_size;
763 file.both_directory_info.attrib = svfs_unix_to_dos_attrib(dir->files[i].st.st_mode);
765 if (!callback(search_private, &file)) {
770 io->t2fnext.out.count = i - search->current_index;
771 io->t2fnext.out.end_of_search = (i == dir->count) ? 1 : 0;
773 search->current_index = i;
775 /* work out if we are going to keep the search state */
776 if ((io->t2fnext.in.flags & FLAG_TRANS2_FIND_CLOSE) ||
777 ((io->t2fnext.in.flags & FLAG_TRANS2_FIND_CLOSE_IF_END) && (i == dir->count))) {
778 DLIST_REMOVE(private->search, search);
779 talloc_destroy(search->mem_ctx);
786 static NTSTATUS svfs_search_close(struct request_context *req, union smb_search_close *io)
788 struct svfs_private *private = req->conn->ntvfs_private;
789 struct search_state *search;
791 for (search=private->search; search; search = search->next) {
792 if (search->handle == io->findclose.in.handle) break;
796 /* we didn't find the search handle */
797 return NT_STATUS_FOOBAR;
800 DLIST_REMOVE(private->search, search);
801 talloc_destroy(search->mem_ctx);
806 /* SMBtrans - not used on file shares */
807 static NTSTATUS svfs_trans(struct request_context *req, struct smb_trans2 *trans2)
809 return NT_STATUS_ACCESS_DENIED;
814 initialialise the POSIX disk backend, registering ourselves with the ntvfs subsystem
816 NTSTATUS ntvfs_simple_init(void)
819 struct ntvfs_ops ops;
823 /* fill in the name and type */
825 ops.type = NTVFS_DISK;
827 /* fill in all the operations */
828 ops.connect = svfs_connect;
829 ops.disconnect = svfs_disconnect;
830 ops.unlink = svfs_unlink;
831 ops.chkpath = svfs_chkpath;
832 ops.qpathinfo = svfs_qpathinfo;
833 ops.setpathinfo = svfs_setpathinfo;
834 ops.open = svfs_open;
835 ops.mkdir = svfs_mkdir;
836 ops.rmdir = svfs_rmdir;
837 ops.rename = svfs_rename;
838 ops.copy = svfs_copy;
839 ops.ioctl = svfs_ioctl;
840 ops.read = svfs_read;
841 ops.write = svfs_write;
842 ops.seek = svfs_seek;
843 ops.flush = svfs_flush;
844 ops.close = svfs_close;
845 ops.exit = svfs_exit;
846 ops.lock = svfs_lock;
847 ops.setfileinfo = svfs_setfileinfo;
848 ops.qfileinfo = svfs_qfileinfo;
849 ops.fsinfo = svfs_fsinfo;
851 ops.search_first = svfs_search_first;
852 ops.search_next = svfs_search_next;
853 ops.search_close = svfs_search_close;
854 ops.trans = svfs_trans;
856 /* register ourselves with the NTVFS subsystem. We register under the name 'default'
857 as we wish to be the default backend */
858 ret = register_backend("ntvfs", &ops);
860 if (!NT_STATUS_IS_OK(ret)) {
861 DEBUG(0,("Failed to register POSIX backend!\n"));