1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

r17220: If we're going to fail a write with an errno, make

sure we return -1.
Jeremy.
(This used to be commit 89b83237b0)
This commit is contained in:
Jeremy Allison 2006-07-25 00:16:45 +00:00 committed by Gerald (Jerry) Carter
parent 8cc35cc8da
commit 120422f723
2 changed files with 5 additions and 1 deletions

View File

@ -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) {

View File

@ -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);