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:
parent
8cc35cc8da
commit
120422f723
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user