diff options
author | Jeremy Allison <jra@samba.org> | 2005-11-15 18:54:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:25 -0500 |
commit | d35ca87bc2c81468f278318fabd09e76ba1f0503 (patch) | |
tree | 8eb2c54ac5603450e72fcd2ff426bc57d60394d8 /source3/lib | |
parent | bc5921d40e6a8f567c09dbb8a45d49afa98758ac (diff) | |
download | samba-d35ca87bc2c81468f278318fabd09e76ba1f0503.tar.gz samba-d35ca87bc2c81468f278318fabd09e76ba1f0503.tar.bz2 samba-d35ca87bc2c81468f278318fabd09e76ba1f0503.zip |
r11732: Remember to return early if -1 returned from *BSD EA call.
Pointed out by timur@com.bat.ru.
Jeremy.
(This used to be commit 081e458801b626d6f9e58ba16a25c1b99b83eb55)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/system.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index c59fe5c34d..fead58faae 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -1387,6 +1387,10 @@ ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t si */ retval = extattr_get_file(path, attrnamespace, attrname, NULL, 0); + if (retval == -1) { + return -1; + } + if(retval > size) { errno = ERANGE; return -1; @@ -1422,6 +1426,10 @@ ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t s retval = extattr_get_link(path, attrnamespace, attrname, NULL, 0); + if (retval == -1) { + return -1; + } + if(retval > size) { errno = ERANGE; return -1; @@ -1457,6 +1465,10 @@ ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size) retval = extattr_get_fd(filedes, attrnamespace, attrname, NULL, 0); + if (retval == -1) { + return -1; + } + if(retval > size) { errno = ERANGE; return -1; |