summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-28 13:19:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:55 -0500
commita6ae640313a47ac2950c0948e4385fa934a5ef09 (patch)
tree3cc3cb8ec8c8cec020e85cd28e91c7dba128addf /source4/ntvfs
parente481385391a25c19d82ce93fbec11a973cf82e9f (diff)
downloadsamba-a6ae640313a47ac2950c0948e4385fa934a5ef09.tar.gz
samba-a6ae640313a47ac2950c0948e4385fa934a5ef09.tar.bz2
samba-a6ae640313a47ac2950c0948e4385fa934a5ef09.zip
r3323: more warning reductions
(This used to be commit 5921587ec26e4892efc678421277e4969417d7f5)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/posix/pvfs_qfileinfo.c3
-rw-r--r--source4/ntvfs/simple/vfs_simple.c49
2 files changed, 18 insertions, 34 deletions
diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c
index 04c196121a..db4951fff0 100644
--- a/source4/ntvfs/posix/pvfs_qfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_qfileinfo.c
@@ -31,6 +31,9 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx,
struct pvfs_filename *name, union smb_fileinfo *info)
{
switch (info->generic.level) {
+ case RAW_FILEINFO_GENERIC:
+ return NT_STATUS_INVALID_LEVEL;
+
case RAW_FILEINFO_GETATTR:
info->getattr.out.attrib = name->dos.attrib;
info->getattr.out.size = name->st.st_size;
diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c
index faf8f17b78..379d24f848 100644
--- a/source4/ntvfs/simple/vfs_simple.c
+++ b/source4/ntvfs/simple/vfs_simple.c
@@ -508,43 +508,24 @@ static NTSTATUS svfs_write(struct ntvfs_module_context *ntvfs,
{
ssize_t ret;
- CHECK_READ_ONLY(req);
+ if (wr->generic.level != RAW_WRITE_WRITEX) {
+ return ntvfs_map_write(req, wr, ntvfs);
+ }
- switch (wr->generic.level) {
- case RAW_WRITE_WRITEX:
- ret = pwrite(wr->writex.in.fnum,
- wr->writex.in.data,
- wr->writex.in.count,
- wr->writex.in.offset);
- if (ret == -1) {
- return map_nt_error_from_unix(errno);
- }
-
- wr->writex.out.nwritten = ret;
- wr->writex.out.remaining = 0; /* should fill this in? */
-
- return NT_STATUS_OK;
-
- case RAW_WRITE_WRITE:
- if (wr->write.in.count == 0) {
- /* a truncate! */
- ret = ftruncate(wr->write.in.fnum, wr->write.in.offset);
- } else {
- ret = pwrite(wr->write.in.fnum,
- wr->write.in.data,
- wr->write.in.count,
- wr->write.in.offset);
- }
- if (ret == -1) {
- return map_nt_error_from_unix(errno);
- }
-
- wr->write.out.nwritten = ret;
+ CHECK_READ_ONLY(req);
- return NT_STATUS_OK;
+ ret = pwrite(wr->writex.in.fnum,
+ wr->writex.in.data,
+ wr->writex.in.count,
+ wr->writex.in.offset);
+ if (ret == -1) {
+ return map_nt_error_from_unix(errno);
}
-
- return NT_STATUS_NOT_SUPPORTED;
+
+ wr->writex.out.nwritten = ret;
+ wr->writex.out.remaining = 0; /* should fill this in? */
+
+ return NT_STATUS_OK;
}
/*