1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r9042: fixed the valgrind error in the RAW-SFILEINFO test

(This used to be commit eaf079e33f)
This commit is contained in:
Andrew Tridgell 2005-08-04 04:20:26 +00:00 committed by Gerald (Jerry) Carter
parent df9b8edff5
commit 8a0b044d20
2 changed files with 11 additions and 1 deletions

View File

@ -174,6 +174,14 @@ BOOL torture_raw_sfileinfo(void)
dump_all_info(mem_ctx, &finfo1); \
}} while (0)
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
ret = False; \
goto done; \
}} while (0)
printf("test setattr\n");
sfinfo.setattr.in.attrib = FILE_ATTRIBUTE_READONLY;
@ -485,6 +493,7 @@ BOOL torture_raw_sfileinfo(void)
printf("Trying rename with a root fid\n");
status = create_directory_handle(cli->tree, BASEDIR, &d_fnum);
CHECK_STATUS(status, NT_STATUS_OK);
sfinfo.rename_information.in.new_name = fnum_fname_new+strlen(BASEDIR)+1;
sfinfo.rename_information.in.root_fid = d_fnum;
CHECK_CALL_FNUM(RENAME_INFORMATION, NT_STATUS_INVALID_PARAMETER);

View File

@ -58,7 +58,7 @@ NTSTATUS create_directory_handle(struct smbcli_tree *tree, const char *dname, in
io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE;
io.ntcreatex.in.alloc_size = 0;
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = dname;
@ -73,6 +73,7 @@ NTSTATUS create_directory_handle(struct smbcli_tree *tree, const char *dname, in
return status;
}
/*
sometimes we need a fairly complex file to work with, so we can test
all possible attributes.