From 696fdc8cf91cc1660725fd93c2b91ec6b65d06b5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Nov 2004 12:36:14 +0000 Subject: 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) --- source4/ntvfs/posix/pvfs_streams.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/ntvfs/posix/pvfs_streams.c') 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); -- cgit