summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-11-23 11:18:20 +0000
committerJeremy Allison <jra@samba.org>2001-11-23 11:18:20 +0000
commitd05bbf042209b737e42a5daa8d59236d351ec8d0 (patch)
tree343cca67678d4fa8a67157515f15494f89aaa19e /source3/smbd/nttrans.c
parentd2e279ecf2b767a1f5dc119484383f694680e691 (diff)
downloadsamba-d05bbf042209b737e42a5daa8d59236d351ec8d0.tar.gz
samba-d05bbf042209b737e42a5daa8d59236d351ec8d0.tar.bz2
samba-d05bbf042209b737e42a5daa8d59236d351ec8d0.zip
Fixed delete on close bug. Added core dump code to winbindd.
Jeremy. (This used to be commit a58d0f91f9ee7354c01a9c20cfe178d5dc02142d)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r--source3/smbd/nttrans.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index ae18fc9a53..2c3ac06f3c 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -330,7 +330,7 @@ static int map_create_disposition( uint32 create_disposition)
Utility function to map share modes.
****************************************************************************/
-static int map_share_mode( BOOL *pstat_open_only, char *fname,
+static int map_share_mode( BOOL *pstat_open_only, char *fname, uint32 create_options,
uint32 desired_access, uint32 share_access, uint32 file_attributes)
{
int smb_open_mode = -1;
@@ -423,6 +423,13 @@ static int map_share_mode( BOOL *pstat_open_only, char *fname,
DEBUG(10,("map_share_mode: DELETE_ACCESS requested. open_mode = %x\n", smb_open_mode));
}
+ if (create_options & FILE_DELETE_ON_CLOSE) {
+ /* Implicit delete access requested... */
+ smb_open_mode |= DELETE_ACCESS_REQUESTED;
+ smb_open_mode |= DELETE_ON_CLOSE_FLAG;
+ DEBUG(10,("map_share_mode: FILE_DELETE_ON_CLOSE requested. open_mode = %x\n", smb_open_mode));
+ }
+
/* Add in the requested share mode. */
switch( share_access & (FILE_SHARE_READ|FILE_SHARE_WRITE)) {
case FILE_SHARE_READ:
@@ -650,7 +657,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
*/
RESOLVE_DFSPATH(fname, conn, inbuf, outbuf);
- if((smb_open_mode = map_share_mode(&stat_open_only, fname, desired_access,
+ if((smb_open_mode = map_share_mode(&stat_open_only, fname, create_options, desired_access,
share_access,
file_attributes)) == -1) {
END_PROFILE(SMBntcreateX);
@@ -681,7 +688,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
if(create_options & FILE_DIRECTORY_FILE) {
oplock_request = 0;
- fsp = open_directory(conn, fname, &sbuf, smb_ofun, unixmode, &smb_action);
+ fsp = open_directory(conn, fname, &sbuf, smb_open_mode, smb_ofun, unixmode, &smb_action);
restore_case_semantics(file_attributes);
@@ -749,7 +756,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
}
oplock_request = 0;
- fsp = open_directory(conn, fname, &sbuf, smb_ofun, unixmode, &smb_action);
+ fsp = open_directory(conn, fname, &sbuf, smb_open_mode, smb_ofun, unixmode, &smb_action);
if(!fsp) {
restore_case_semantics(file_attributes);
@@ -1157,7 +1164,7 @@ static int call_nt_transact_create(connection_struct *conn,
* and the share access.
*/
- if((smb_open_mode = map_share_mode( &stat_open_only, fname, desired_access,
+ if((smb_open_mode = map_share_mode( &stat_open_only, fname, create_options, desired_access,
share_access, file_attributes)) == -1)
return ERROR_DOS(ERRDOS,ERRbadaccess);
@@ -1190,7 +1197,7 @@ static int call_nt_transact_create(connection_struct *conn,
* CreateDirectory() call.
*/
- fsp = open_directory(conn, fname, &sbuf, smb_ofun, unixmode, &smb_action);
+ fsp = open_directory(conn, fname, &sbuf, smb_open_mode, smb_ofun, unixmode, &smb_action);
if(!fsp) {
restore_case_semantics(file_attributes);
@@ -1226,7 +1233,7 @@ static int call_nt_transact_create(connection_struct *conn,
}
oplock_request = 0;
- fsp = open_directory(conn, fname, &sbuf, smb_ofun, unixmode, &smb_action);
+ fsp = open_directory(conn, fname, &sbuf, smb_open_mode, smb_ofun, unixmode, &smb_action);
if(!fsp) {
restore_case_semantics(file_attributes);