summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-25 00:16:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:19 -0500
commit120422f7233446e8ca366ee7c4593cdbead79508 (patch)
tree0405e5467312b4dd06e6ff7b9c321a59da73f28f /source3
parent8cc35cc8da75f1e831f0b84fc667ec0c9bff6b4b (diff)
downloadsamba-120422f7233446e8ca366ee7c4593cdbead79508.tar.gz
samba-120422f7233446e8ca366ee7c4593cdbead79508.tar.bz2
samba-120422f7233446e8ca366ee7c4593cdbead79508.zip
r17220: If we're going to fail a write with an errno, make
sure we return -1. Jeremy. (This used to be commit 89b83237b03066785ca4bf3b9d120519bddeffad)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/fileio.c2
-rw-r--r--source3/smbd/reply.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 375bfbe7cf..e0945be889 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -214,7 +214,7 @@ ssize_t write_file(files_struct *fsp, const char *data, SMB_OFF_T pos, size_t n)
if (!fsp->can_write) {
errno = EPERM;
- return(0);
+ return -1;
}
if (!fsp->modified) {
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index edaf5d8062..e38edadee4 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2807,6 +2807,10 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
}
nwritten = write_file(fsp,inbuf+4,startpos+nwritten,numtowrite);
+ if (nwritten == -1) {
+ END_PROFILE(SMBwritebraw);
+ return(UNIXERROR(ERRHRD,ERRdiskfull));
+ }
if (nwritten < (ssize_t)numtowrite) {
SCVAL(outbuf,smb_rcls,ERRHRD);