s3: Fix reading beyond the end of a named stream in xattr_streams
authorVolker Lendecke <vl@samba.org>
Wed, 16 Sep 2009 01:20:49 +0000 (03:20 +0200)
committerKarolin Seeger <kseeger@samba.org>
Sat, 19 Sep 2009 16:53:13 +0000 (18:53 +0200)
This was found thanks to a test by Sivani from Microsoft against Samba at the
SDC plugfest
(cherry picked from commit 444a05c28df693a745809fef73ae583a78be7c8f)

Fix bug #6731.

source3/modules/vfs_streams_xattr.c

index 3d5478d7a259a3ff3a864a4a98d916b85b2fb5fd..c5a7c697da263c4d9df082bc43558b6633bc66a7 100644 (file)
@@ -867,8 +867,7 @@ static ssize_t streams_xattr_pread(vfs_handle_struct *handle,
 
         /* Attempt to read past EOF. */
         if (length <= offset) {
-                errno = EINVAL;
-                return -1;
+                return 0;
         }
 
         overlap = (offset + n) > length ? (length - offset) : n;