vfs_streams_xattr: fix open implementation
authorRalph Boehme <slow@samba.org>
Thu, 23 Aug 2018 10:07:20 +0000 (12:07 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 31 Oct 2018 20:27:18 +0000 (21:27 +0100)
commit9f58997d7a1ab0358963a45cb8bf291e7afa8068
treeca89fd0979d111fa88c00984e1c27f2a7a362a44
parent3649f1a41a299b14609318ef52b44e2d53cba4b5
vfs_streams_xattr: fix open implementation

Since a long time the modules's open function happily returned success
when opening a non existent stream without O_CREAT.

This change fixes it to return -1 and errno=ENOATTR if

o get_ea_value() returns NT_STATUS_NOT_FOUND (eg mapped from
  getxattr() = -1, errno=ENOATTR) and

o flags doesn't contain O_CREAT

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_streams_xattr.c