diff options
author | Ralph Boehme <rb@sernet.de> | 2014-09-27 08:03:12 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-09-30 23:35:08 +0200 |
commit | 04ebed138643449f35a0a9c9be82a57faa653dd1 (patch) | |
tree | 4d761ba60f45598b864c9e5461c50395a1a9ae4b | |
parent | 26ff9f348731ba0b2b47fec5ea8c10f83b4fad3b (diff) | |
download | samba-04ebed138643449f35a0a9c9be82a57faa653dd1.tar.gz |
vfs_fruit: fix possible uninitialized use
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | source3/modules/vfs_fruit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 0441d5ebd48..dd404909847 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -755,11 +755,14 @@ static ssize_t ad_header_read_rsrc(struct adouble *ad, const char *path) struct adouble *meta_ad = NULL; SMB_STRUCT_STAT sbuf; bool ok; - int saved_errno; + int saved_errno = 0; SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config, struct fruit_config_data, return -1); + /* Try rw first so we can use the fd in ad_convert() */ + mode = O_RDWR; + if (ad->ad_fsp && ad->ad_fsp->fh && (ad->ad_fsp->fh->fd != -1)) { fd = ad->ad_fsp->fh->fd; } else { @@ -772,9 +775,6 @@ static ssize_t ad_header_read_rsrc(struct adouble *ad, const char *path) } } - /* Try rw first so we can use the fd in ad_convert() */ - mode = O_RDWR; - retry: if (config->rsrc == FRUIT_RSRC_XATTR) { #ifndef HAVE_ATTROPEN |