vfs_fruit: fix error returns in ad_convert_xattr()
authorRalph Boehme <slow@samba.org>
Fri, 5 Oct 2018 14:52:32 +0000 (16:52 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Oct 2018 10:59:19 +0000 (12:59 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13649

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f91e0c857a5a44a5eab7696fafda758044739978)

source3/modules/vfs_fruit.c

index ce813ab94c01420667b71afc433165862d20793e..89f66a70229241ae1b09a09d86f91886ba540ba6 100644 (file)
@@ -985,14 +985,14 @@ static bool ad_convert_xattr(struct adouble *ad,
                    !NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED))
                {
                        DBG_ERR("string_replace_allocate failed\n");
-                       return -1;
+                       return false;
                }
 
                tmp = mapped_name;
                mapped_name = talloc_asprintf(talloc_tos(), ":%s", tmp);
                TALLOC_FREE(tmp);
                if (mapped_name == NULL) {
-                       return -1;
+                       return false;
                }
 
                stream_name = synthetic_smb_fname(talloc_tos(),
@@ -1003,7 +1003,7 @@ static bool ad_convert_xattr(struct adouble *ad,
                TALLOC_FREE(mapped_name);
                if (stream_name == NULL) {
                        DBG_ERR("synthetic_smb_fname failed\n");
-                       return -1;
+                       return false;
                }
 
                DBG_DEBUG("stream_name: %s\n", smb_fname_str_dbg(stream_name));
@@ -1030,7 +1030,7 @@ static bool ad_convert_xattr(struct adouble *ad,
                TALLOC_FREE(stream_name);
                if (!NT_STATUS_IS_OK(status)) {
                        DBG_ERR("SMB_VFS_CREATE_FILE failed\n");
-                       return -1;
+                       return false;
                }
 
                nwritten = SMB_VFS_PWRITE(fsp,
@@ -1042,12 +1042,12 @@ static bool ad_convert_xattr(struct adouble *ad,
                        saved_errno = errno;
                        close_file(NULL, fsp, ERROR_CLOSE);
                        errno = saved_errno;
-                       return -1;
+                       return false;
                }
 
                status = close_file(NULL, fsp, NORMAL_CLOSE);
                if (!NT_STATUS_IS_OK(status)) {
-                       return -1;
+                       return false;
                }
                fsp = NULL;
        }