diff options
author | Jeremy Allison <jra@samba.org> | 2001-03-30 08:57:24 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-03-30 08:57:24 +0000 |
commit | 51987684bd231c744da2e5f3705fd236d5616173 (patch) | |
tree | f3b5715273b93a609ffd06b4d50a557ab3625c22 /source/libsmb/clifile.c | |
parent | 54960b9c8d6be6646a0c0e8ef9ee6c61a4b69cf8 (diff) | |
download | samba-51987684bd231c744da2e5f3705fd236d5616173.tar.gz samba-51987684bd231c744da2e5f3705fd236d5616173.tar.xz samba-51987684bd231c744da2e5f3705fd236d5616173.zip |
This is a big, rather ugly patch. Whilst investigating the files not truncated
when copying to a full disk problem, I discovered that we were not allowing
the delete on close flag to be set properly, this led to other things, and
after investigation of the proper delete on close semantics and their relationship
to the file_share_delete flag I discovered there were some cases where we
weren't doing the deny modes properly. And this after only 5 years working
on them..... :-) :-).
So here's the latest attempt. I realised the delete on close flag needs to
be set across all smbds with a dev/ino pair open - in addition, the delete
on close flag, allow share delete and delete access requested all need to
be stored in the share mode tdb.
The "delete_on_close" entry in the fsp struct is now redundant and should
really be removed. This may also mean we can get rid of the "iterate_fsp"
calls that I didn't like adding in the first place. Whilst doing this patch,
I also discovered we needed to do the se_map_generic() call for file opens
and POSIX ACL mapping, so I added that also.
This code, although ugly, now passes the deny mode torture tests plus the
delete on close tests I added. I do need to add one more multiple connection
delete on close test to make sure I got the semantics exactly right, plus we
should also (as Andrew suggested) move to random testing here.
The good news is that NT should now correctly delete the file on disk
full error when copying to a disk :-).
Jeremy.
Diffstat (limited to 'source/libsmb/clifile.c')
-rw-r--r-- | source/libsmb/clifile.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/libsmb/clifile.c b/source/libsmb/clifile.c index e90bd7c41fa..d62a0a417a6 100644 --- a/source/libsmb/clifile.c +++ b/source/libsmb/clifile.c @@ -164,6 +164,9 @@ BOOL cli_rmdir(struct cli_state *cli, char *dname) } return True; +} + +/**************************************************************************** Set or clear the delete on close flag. ****************************************************************************/ @@ -183,7 +186,7 @@ int cli_nt_delete_on_close(struct cli_state *cli, int fnum, BOOL flag) data = flag ? 1 : 0; if (!cli_send_trans(cli, SMBtrans2, - NULL, 0, /* name, length */ + NULL, /* name */ -1, 0, /* fid, flags */ &setup, 1, 0, /* setup, length, max */ param, param_len, 2, /* param, length, max */ @@ -205,9 +208,6 @@ int cli_nt_delete_on_close(struct cli_state *cli, int fnum, BOOL flag) } /**************************************************************************** -} - -/**************************************************************************** open a file - exposing the full horror of the NT API :-). Used in smbtorture. ****************************************************************************/ |