From 86558e0376558f730ba1a650af2f8b545ad96b4d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 12 Nov 2007 11:39:35 -0800 Subject: Fix bug #5073. Allow "delete readonly = yes" to correctly override deletion of a file. Fix from David Shaw Jeremy. (This used to be commit 5d1d650d192d4782421b5c3c2be1b632d4318279) --- source3/smbd/nttrans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 4bd4571171..f07d64eded 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -788,7 +788,8 @@ void reply_ntcreate_and_X(connection_struct *conn, && (create_disposition != FILE_CREATE) && (share_access & FILE_SHARE_DELETE) && (access_mask & DELETE_ACCESS)) { - if ((dos_mode(conn, fname, &sbuf) & FILE_ATTRIBUTE_READONLY) || + if (((dos_mode(conn, fname, &sbuf) & FILE_ATTRIBUTE_READONLY) + && !lp_delete_readonly(SNUM(conn))) || !can_delete_file_in_directory(conn, fname)) { TALLOC_FREE(case_state); reply_nterror(req, NT_STATUS_ACCESS_DENIED); -- cgit