summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-09-14 13:49:14 +0200
committerJeremy Allison <jra@samba.org>2013-10-08 14:42:25 -0700
commite0e5f67da522521a37622a5833b8699ae63e8c27 (patch)
treecd1d4c2dae26dcad9876c7ecd346848f99f2ecfe /source3/smbd
parentad2ba58f53a7fb6b87511288cb450f1327f1ccbf (diff)
downloadsamba-e0e5f67da522521a37622a5833b8699ae63e8c27.tar.gz
samba-e0e5f67da522521a37622a5833b8699ae63e8c27.tar.bz2
samba-e0e5f67da522521a37622a5833b8699ae63e8c27.zip
smbd: Convert set_share_mode to return bool for success
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 858d2befc2..55f2fb2164 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2681,9 +2681,13 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
fsp->oplock_type = NO_OPLOCK;
}
- set_share_mode(lck, fsp, get_current_uid(conn),
- req ? req->mid : 0,
- fsp->oplock_type);
+ if (!set_share_mode(lck, fsp, get_current_uid(conn),
+ req ? req->mid : 0,
+ fsp->oplock_type)) {
+ TALLOC_FREE(lck);
+ fd_close(fsp);
+ return NT_STATUS_NO_MEMORY;
+ }
/* Handle strange delete on close create semantics. */
if (create_options & FILE_DELETE_ON_CLOSE) {
@@ -3173,8 +3177,13 @@ static NTSTATUS open_directory(connection_struct *conn,
return status;
}
- set_share_mode(lck, fsp, get_current_uid(conn),
- req ? req->mid : 0, NO_OPLOCK);
+ if (!set_share_mode(lck, fsp, get_current_uid(conn),
+ req ? req->mid : 0, NO_OPLOCK)) {
+ TALLOC_FREE(lck);
+ fd_close(fsp);
+ file_free(req, fsp);
+ return NT_STATUS_NO_MEMORY;
+ }
/* For directories the delete on close bit at open time seems
always to be honored on close... See test 19 in Samba4 BASE-DELETE. */