summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_streams.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-17 12:36:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:56 -0500
commit696fdc8cf91cc1660725fd93c2b91ec6b65d06b5 (patch)
tree5bcd9e4d35632dfa6c105fa81ec9c7ba12b800ec /source4/ntvfs/posix/pvfs_streams.c
parent91e94014beb145541c051b4df28dde7ad0899da5 (diff)
downloadsamba-696fdc8cf91cc1660725fd93c2b91ec6b65d06b5.tar.gz
samba-696fdc8cf91cc1660725fd93c2b91ec6b65d06b5.tar.bz2
samba-696fdc8cf91cc1660725fd93c2b91ec6b65d06b5.zip
r3806: added support to smb_server and pvfs for the NTTRANS Create call. This
call has an optional sec_desc and ea_list. (This used to be commit 8379ad14e3d51a848a99865d9ce8d56a301e8a3c)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_streams.c')
-rw-r--r--source4/ntvfs/posix/pvfs_streams.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_streams.c b/source4/ntvfs/posix/pvfs_streams.c
index 13a4ca1265..12f783e172 100644
--- a/source4/ntvfs/posix/pvfs_streams.c
+++ b/source4/ntvfs/posix/pvfs_streams.c
@@ -271,6 +271,11 @@ ssize_t pvfs_stream_write(struct pvfs_state *pvfs,
if (count == 0) {
return 0;
}
+ if (offset > XATTR_MAX_STREAM_SIZE) {
+ errno = ENOSPC;
+ return -1;
+ }
+
/* we have to load the existing stream, then modify, then save */
status = pvfs_xattr_load(pvfs, h, h->name->full_name, h->fd, XATTR_DOSSTREAM_PREFIX,
h->name->stream_name, offset+count, &blob);
@@ -320,6 +325,11 @@ NTSTATUS pvfs_stream_truncate(struct pvfs_state *pvfs,
{
NTSTATUS status;
DATA_BLOB blob;
+
+ if (length > XATTR_MAX_STREAM_SIZE) {
+ return NT_STATUS_DISK_FULL;
+ }
+
/* we have to load the existing stream, then modify, then save */
status = pvfs_xattr_load(pvfs, name, name->full_name, fd, XATTR_DOSSTREAM_PREFIX,
name->stream_name, length, &blob);