diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-11-17 22:13:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:57 -0500 |
commit | cae123912c15ad7d7ecd44a6d468f368aaeab95c (patch) | |
tree | 9154f947fcddb687c2c725b98d850079ec38227f | |
parent | 6695019d027f19f7ebe97435fdb9826a7868768f (diff) | |
download | samba-cae123912c15ad7d7ecd44a6d468f368aaeab95c.tar.gz samba-cae123912c15ad7d7ecd44a6d468f368aaeab95c.tar.bz2 samba-cae123912c15ad7d7ecd44a6d468f368aaeab95c.zip |
r3828: added testing of opening an existing file with EAs (the EAs are ignored)
(This used to be commit 6d53c6a0aed31c87b47e5248f22b1e5767fad342)
-rw-r--r-- | source4/torture/raw/eas.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c index c76d8a9f58..57ca8de35c 100644 --- a/source4/torture/raw/eas.c +++ b/source4/torture/raw/eas.c @@ -191,7 +191,7 @@ done: /* test using NTTRANS CREATE to create a file with an initial EA set */ -static BOOL test_open_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { NTSTATUS status; union smb_open io; @@ -245,6 +245,26 @@ static BOOL test_open_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) ret &= check_ea(cli, mem_ctx, fname, "2nd EA", "Second Value"); ret &= check_ea(cli, mem_ctx, fname, "and 3rd", "final value"); + smbcli_close(cli->tree, fnum); + + printf("Trying to add EAs on non-create\n"); + io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN; + io.ntcreatex.in.fname = fname; + + ea_list.num_eas = 1; + eas[0].flags = 0; + eas[0].name.s = "Fourth EA"; + eas[0].value = data_blob_string_const("Value Four"); + + status = smb_raw_open(cli->tree, mem_ctx, &io); + CHECK_STATUS(status, NT_STATUS_OK); + fnum = io.ntcreatex.out.fnum; + + ret &= check_ea(cli, mem_ctx, fname, "1st EA", "Value One"); + ret &= check_ea(cli, mem_ctx, fname, "2nd EA", "Second Value"); + ret &= check_ea(cli, mem_ctx, fname, "and 3rd", "final value"); + ret &= check_ea(cli, mem_ctx, fname, "Fourth EA", NULL); + done: smbcli_close(cli->tree, fnum); return ret; @@ -270,7 +290,7 @@ BOOL torture_raw_eas(void) } ret &= test_eas(cli, mem_ctx); - ret &= test_open_eas(cli, mem_ctx); + ret &= test_nttrans_create(cli, mem_ctx); smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR); |