vfs_fruit: deal with vfs_catia not being loaded
authorRalph Boehme <rb@sernet.de>
Sat, 27 Sep 2014 06:54:57 +0000 (08:54 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 30 Sep 2014 23:59:25 +0000 (01:59 +0200)
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Oct  1 01:59:25 CEST 2014 on sn-devel-104

source3/modules/vfs_fruit.c

index 242a6cbbc84c99a2a48cdce00e916c13209358d8..c1555f0d674e7a180bbf4538417e154646a744ef 100644 (file)
@@ -2242,7 +2242,13 @@ static ssize_t fruit_pread(vfs_handle_struct *handle,
                                        fsp->base_fsp->fsp_name->base_name,
                                        vfs_translate_to_unix,
                                        talloc_tos(), &name);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+               name = talloc_strdup(talloc_tos(), tmp_base_name);
+               if (name == NULL) {
+                       rc = -1;
+                       goto exit;
+               }
+       } else if (!NT_STATUS_IS_OK(status)) {
                errno = map_errno_from_nt_status(status);
                rc = -1;
                goto exit;
@@ -2332,7 +2338,13 @@ static ssize_t fruit_pwrite(vfs_handle_struct *handle,
                                        fsp->base_fsp->fsp_name->base_name,
                                        vfs_translate_to_unix,
                                        talloc_tos(), &name);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+               name = talloc_strdup(talloc_tos(), tmp_base_name);
+               if (name == NULL) {
+                       rc = -1;
+                       goto exit;
+               }
+       } else if (!NT_STATUS_IS_OK(status)) {
                errno = map_errno_from_nt_status(status);
                rc = -1;
                goto exit;
@@ -2613,7 +2625,13 @@ static int fruit_fstat(vfs_handle_struct *handle, files_struct *fsp,
                        vfs_translate_to_unix,
                        talloc_tos(), &name);
 
-               if (!NT_STATUS_IS_OK(status)) {
+               if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+                       name = talloc_strdup(talloc_tos(), tmp_base_name);
+                       if (name == NULL) {
+                               rc = -1;
+                               goto exit;
+                       }
+               } else if (!NT_STATUS_IS_OK(status)) {
                        errno = map_errno_from_nt_status(status);
                        rc = -1;
                        goto exit;