diff options
Diffstat (limited to 'source3/libsmb/libsmb_compat.c')
-rw-r--r-- | source3/libsmb/libsmb_compat.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_compat.c b/source3/libsmb/libsmb_compat.c index 5699e153bb..cfd5948e26 100644 --- a/source3/libsmb/libsmb_compat.c +++ b/source3/libsmb/libsmb_compat.c @@ -341,6 +341,10 @@ int smbc_fsetxattr(int fd, int flags) { SMBCFILE * file = find_fd(fd); + if (file == NULL) { + errno = EBADF; + return -1; + } return statcont->setxattr(statcont, file->fname, name, value, size, flags); } @@ -367,6 +371,10 @@ int smbc_fgetxattr(int fd, size_t size) { SMBCFILE * file = find_fd(fd); + if (file == NULL) { + errno = EBADF; + return -1; + } return statcont->getxattr(statcont, file->fname, name, value, size); } @@ -386,6 +394,10 @@ int smbc_fremovexattr(int fd, const char *name) { SMBCFILE * file = find_fd(fd); + if (file == NULL) { + errno = EBADF; + return -1; + } return statcont->removexattr(statcont, file->fname, name); } @@ -408,6 +420,10 @@ int smbc_flistxattr(int fd, size_t size) { SMBCFILE * file = find_fd(fd); + if (file == NULL) { + errno = EBADF; + return -1; + } return statcont->listxattr(statcont, file->fname, list, size); } |