summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-02 15:07:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:51 -0500
commit6edd999dc1fe4894b2fb9f02fb4c215adf3aa795 (patch)
tree184f6cc2135b090f760d095d69a7963b0ede3390 /source3/smbd
parent58b63b65fcf3dbd14f985f99038733c8a0a2f14f (diff)
downloadsamba-6edd999dc1fe4894b2fb9f02fb4c215adf3aa795.tar.gz
samba-6edd999dc1fe4894b2fb9f02fb4c215adf3aa795.tar.bz2
samba-6edd999dc1fe4894b2fb9f02fb4c215adf3aa795.zip
r20479: Both remaining calls of can_delete called it with check_is_at_open==False,
remove that parameter. Volker (This used to be commit e51b7648703f3a85b840501dd4199600a5a7e44f)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index cb25b69a31..a65979e804 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1889,8 +1889,7 @@ static NTSTATUS can_rename(connection_struct *conn, char *fname, uint16 dirtype,
********************************************************************/
static NTSTATUS can_delete(connection_struct *conn, char *fname,
- uint32 dirtype, BOOL bad_path,
- BOOL check_is_at_open)
+ uint32 dirtype, BOOL bad_path)
{
SMB_STRUCT_STAT sbuf;
uint32 fattr;
@@ -1938,7 +1937,7 @@ static NTSTATUS can_delete(connection_struct *conn, char *fname,
from Windows Explorer).
*/
- if (!check_is_at_open && !lp_delete_readonly(SNUM(conn))) {
+ if (!lp_delete_readonly(SNUM(conn))) {
if (fattr & aRONLY) {
return NT_STATUS_CANNOT_DELETE;
}
@@ -1947,29 +1946,22 @@ static NTSTATUS can_delete(connection_struct *conn, char *fname,
return NT_STATUS_NO_SUCH_FILE;
}
- if (check_is_at_open) {
- if (!can_delete_file_in_directory(conn, fname)) {
- return NT_STATUS_ACCESS_DENIED;
- }
- } else {
- /* On open checks the open itself will check the share mode, so
- don't do it here as we'll get it wrong. */
-
- status = open_file_ntcreate(conn, fname, &sbuf,
- DELETE_ACCESS,
- FILE_SHARE_NONE,
- FILE_OPEN,
- 0,
- FILE_ATTRIBUTE_NORMAL,
- 0,
- NULL, &fsp);
-
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ /* On open checks the open itself will check the share mode, so
+ don't do it here as we'll get it wrong. */
+
+ status = open_file_ntcreate(conn, fname, &sbuf,
+ DELETE_ACCESS,
+ FILE_SHARE_NONE,
+ FILE_OPEN,
+ 0,
+ FILE_ATTRIBUTE_NORMAL,
+ 0,
+ NULL, &fsp);
+
+ if (NT_STATUS_IS_OK(status)) {
close_file(fsp,NORMAL_CLOSE);
}
- return NT_STATUS_OK;
+ return status;
}
/****************************************************************************
@@ -2027,7 +2019,7 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype,
pstrcat(directory,"/");
pstrcat(directory,mask);
- error = can_delete(conn,directory,dirtype,bad_path,False);
+ error = can_delete(conn,directory,dirtype,bad_path);
if (!NT_STATUS_IS_OK(error))
return error;
@@ -2093,7 +2085,8 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype,
}
slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname);
- error = can_delete(conn,fname,dirtype,bad_path,False);
+ error = can_delete(conn, fname, dirtype,
+ bad_path);
if (!NT_STATUS_IS_OK(error)) {
continue;
}