summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/qfileinfo.c9
-rw-r--r--source4/torture/raw/search.c70
-rw-r--r--source4/torture/raw/setfileinfo.c10
3 files changed, 57 insertions, 32 deletions
diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c
index 0f7b2dfb63..5d3f543c0f 100644
--- a/source4/torture/raw/qfileinfo.c
+++ b/source4/torture/raw/qfileinfo.c
@@ -660,8 +660,13 @@ BOOL torture_raw_qfileinfo(int dummy)
} \
} while (0)
- NAME_PATH_CHECK("INTERNAL_INFORMATION", internal_information, device);
- NAME_PATH_CHECK("INTERNAL_INFORMATION", internal_information, inode);
+
+ s1 = fnum_find("INTERNAL_INFORMATION");
+ if (s1) {
+ printf("file_id=%.0f\n", (double)s1->internal_information.out.file_id);
+ }
+
+ NAME_PATH_CHECK("INTERNAL_INFORMATION", internal_information, file_id);
NAME_PATH_CHECK("POSITION_INFORMATION", position_information, position);
printf("fnum pos = %.0f, fname pos = %.0f\n",
(double)s2->position_information.out.position,
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index ab69b5af42..301a9f0077 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -74,16 +74,16 @@ static struct {
NTSTATUS status;
union smb_search_data data;
} levels[] = {
- {"SEARCH", RAW_SEARCH_SEARCH, },
- {"STANDARD", RAW_SEARCH_STANDARD, },
- {"EA_SIZE", RAW_SEARCH_EA_SIZE, },
- {"DIRECTORY_INFO", RAW_SEARCH_DIRECTORY_INFO, },
- {"FULL_DIRECTORY_INFO", RAW_SEARCH_FULL_DIRECTORY_INFO, },
- {"NAME_INFO", RAW_SEARCH_NAME_INFO, },
- {"BOTH_DIRECTORY_INFO", RAW_SEARCH_BOTH_DIRECTORY_INFO, },
- {"LEVEL_261", RAW_SEARCH_261, },
- {"LEVEL_262", RAW_SEARCH_262, },
- {"UNIX_INFO", RAW_SEARCH_UNIX_INFO, CAP_UNIX}
+ {"SEARCH", RAW_SEARCH_SEARCH, },
+ {"STANDARD", RAW_SEARCH_STANDARD, },
+ {"EA_SIZE", RAW_SEARCH_EA_SIZE, },
+ {"DIRECTORY_INFO", RAW_SEARCH_DIRECTORY_INFO, },
+ {"FULL_DIRECTORY_INFO", RAW_SEARCH_FULL_DIRECTORY_INFO, },
+ {"NAME_INFO", RAW_SEARCH_NAME_INFO, },
+ {"BOTH_DIRECTORY_INFO", RAW_SEARCH_BOTH_DIRECTORY_INFO, },
+ {"ID_FULL_DIRECTORY_INFO", RAW_SEARCH_ID_FULL_DIRECTORY_INFO, },
+ {"ID_BOTH_DIRECTORY_INFO", RAW_SEARCH_ID_BOTH_DIRECTORY_INFO, },
+ {"UNIX_INFO", RAW_SEARCH_UNIX_INFO, CAP_UNIX}
};
/* find a level in the table by name */
@@ -109,7 +109,7 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const char *fname = "\\torture_search.txt";
NTSTATUS status;
int i;
- union smb_fileinfo all_info, alt_info, name_info;
+ union smb_fileinfo all_info, alt_info, name_info, internal_info;
union smb_search_data *s;
printf("Testing one file searches\n");
@@ -162,6 +162,15 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
goto done;
}
+ internal_info.generic.level = RAW_FILEINFO_INTERNAL_INFORMATION;
+ internal_info.generic.in.fname = fname;
+ status = smb_raw_pathinfo(cli->tree, mem_ctx, &internal_info);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("RAW_FILEINFO_INTERNAL_INFORMATION failed - %s\n", nt_errstr(status));
+ ret = False;
+ goto done;
+ }
+
name_info.generic.level = RAW_FILEINFO_NAME_INFO;
name_info.generic.in.fname = fname;
status = smb_raw_pathinfo(cli->tree, mem_ctx, &name_info);
@@ -254,8 +263,8 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_VAL("DIRECTORY_INFO", directory_info, attrib, all_info, all_info, attrib);
CHECK_VAL("FULL_DIRECTORY_INFO", full_directory_info, attrib, all_info, all_info, attrib);
CHECK_VAL("BOTH_DIRECTORY_INFO", both_directory_info, attrib, all_info, all_info, attrib);
- CHECK_VAL("LEVEL_261", level_261, attrib, all_info, all_info, attrib);
- CHECK_VAL("LEVEL_262", level_262, attrib, all_info, all_info, attrib);
+ CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info, attrib, all_info, all_info, attrib);
+ CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, attrib, all_info, all_info, attrib);
CHECK_TIME("SEARCH", search, write_time, all_info, all_info, write_time);
CHECK_TIME("STANDARD", standard, write_time, all_info, all_info, write_time);
@@ -268,26 +277,26 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_NTTIME("DIRECTORY_INFO", directory_info, write_time, all_info, all_info, write_time);
CHECK_NTTIME("FULL_DIRECTORY_INFO", full_directory_info, write_time, all_info, all_info, write_time);
CHECK_NTTIME("BOTH_DIRECTORY_INFO", both_directory_info, write_time, all_info, all_info, write_time);
- CHECK_NTTIME("LEVEL_261", level_261, write_time, all_info, all_info, write_time);
- CHECK_NTTIME("LEVEL_262", level_262, write_time, all_info, all_info, write_time);
+ CHECK_NTTIME("ID_FULL_DIRECTORY_INFO", id_full_directory_info, write_time, all_info, all_info, write_time);
+ CHECK_NTTIME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, write_time, all_info, all_info, write_time);
CHECK_NTTIME("DIRECTORY_INFO", directory_info, create_time, all_info, all_info, create_time);
CHECK_NTTIME("FULL_DIRECTORY_INFO", full_directory_info, create_time, all_info, all_info, create_time);
CHECK_NTTIME("BOTH_DIRECTORY_INFO", both_directory_info, create_time, all_info, all_info, create_time);
- CHECK_NTTIME("LEVEL_261", level_261, create_time, all_info, all_info, create_time);
- CHECK_NTTIME("LEVEL_262", level_262, create_time, all_info, all_info, create_time);
+ CHECK_NTTIME("ID_FULL_DIRECTORY_INFO", id_full_directory_info, create_time, all_info, all_info, create_time);
+ CHECK_NTTIME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, create_time, all_info, all_info, create_time);
CHECK_NTTIME("DIRECTORY_INFO", directory_info, access_time, all_info, all_info, access_time);
CHECK_NTTIME("FULL_DIRECTORY_INFO", full_directory_info, access_time, all_info, all_info, access_time);
CHECK_NTTIME("BOTH_DIRECTORY_INFO", both_directory_info, access_time, all_info, all_info, access_time);
- CHECK_NTTIME("LEVEL_261", level_261, access_time, all_info, all_info, access_time);
- CHECK_NTTIME("LEVEL_262", level_262, access_time, all_info, all_info, access_time);
+ CHECK_NTTIME("ID_FULL_DIRECTORY_INFO", id_full_directory_info, access_time, all_info, all_info, access_time);
+ CHECK_NTTIME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, access_time, all_info, all_info, access_time);
CHECK_NTTIME("DIRECTORY_INFO", directory_info, create_time, all_info, all_info, create_time);
CHECK_NTTIME("FULL_DIRECTORY_INFO", full_directory_info, create_time, all_info, all_info, create_time);
CHECK_NTTIME("BOTH_DIRECTORY_INFO", both_directory_info, create_time, all_info, all_info, create_time);
- CHECK_NTTIME("LEVEL_261", level_261, create_time, all_info, all_info, create_time);
- CHECK_NTTIME("LEVEL_262", level_262, create_time, all_info, all_info, create_time);
+ CHECK_NTTIME("ID_FULL_DIRECTORY_INFO", id_full_directory_info, create_time, all_info, all_info, create_time);
+ CHECK_NTTIME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, create_time, all_info, all_info, create_time);
CHECK_VAL("SEARCH", search, size, all_info, all_info, size);
CHECK_VAL("STANDARD", standard, size, all_info, all_info, size);
@@ -295,22 +304,22 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_VAL("DIRECTORY_INFO", directory_info, size, all_info, all_info, size);
CHECK_VAL("FULL_DIRECTORY_INFO", full_directory_info, size, all_info, all_info, size);
CHECK_VAL("BOTH_DIRECTORY_INFO", both_directory_info, size, all_info, all_info, size);
- CHECK_VAL("LEVEL_261", level_261, size, all_info, all_info, size);
- CHECK_VAL("LEVEL_262", level_262, size, all_info, all_info, size);
+ CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info, size, all_info, all_info, size);
+ CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, size, all_info, all_info, size);
CHECK_VAL("STANDARD", standard, alloc_size, all_info, all_info, alloc_size);
CHECK_VAL("EA_SIZE", ea_size, alloc_size, all_info, all_info, alloc_size);
CHECK_VAL("DIRECTORY_INFO", directory_info, alloc_size, all_info, all_info, alloc_size);
CHECK_VAL("FULL_DIRECTORY_INFO", full_directory_info, alloc_size, all_info, all_info, alloc_size);
CHECK_VAL("BOTH_DIRECTORY_INFO", both_directory_info, alloc_size, all_info, all_info, alloc_size);
- CHECK_VAL("LEVEL_261", level_261, alloc_size, all_info, all_info, alloc_size);
- CHECK_VAL("LEVEL_262", level_262, alloc_size, all_info, all_info, alloc_size);
+ CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info, alloc_size, all_info, all_info, alloc_size);
+ CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, alloc_size, all_info, all_info, alloc_size);
CHECK_VAL("EA_SIZE", ea_size, ea_size, all_info, all_info, ea_size);
CHECK_VAL("FULL_DIRECTORY_INFO", full_directory_info, ea_size, all_info, all_info, ea_size);
CHECK_VAL("BOTH_DIRECTORY_INFO", both_directory_info, ea_size, all_info, all_info, ea_size);
- CHECK_VAL("LEVEL_261", level_261, ea_size, all_info, all_info, ea_size);
- CHECK_VAL("LEVEL_262", level_262, ea_size, all_info, all_info, ea_size);
+ CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info, ea_size, all_info, all_info, ea_size);
+ CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, ea_size, all_info, all_info, ea_size);
CHECK_STR("SEARCH", search, name, alt_info, alt_name_info, fname);
CHECK_WSTR("BOTH_DIRECTORY_INFO", both_directory_info, short_name, alt_info, alt_name_info, fname, STR_UNICODE);
@@ -321,8 +330,11 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_NAME("FULL_DIRECTORY_INFO", full_directory_info, name, fname+1, STR_TERMINATE_ASCII);
CHECK_NAME("NAME_INFO", name_info, name, fname+1, STR_TERMINATE_ASCII);
CHECK_NAME("BOTH_DIRECTORY_INFO", both_directory_info, name, fname+1, STR_TERMINATE_ASCII);
- CHECK_NAME("LEVEL_261", level_261, name, fname+1, STR_TERMINATE_ASCII);
- CHECK_NAME("LEVEL_262", level_262, name, fname+1, STR_TERMINATE_ASCII);
+ CHECK_NAME("ID_FULL_DIRECTORY_INFO", id_full_directory_info, name, fname+1, STR_TERMINATE_ASCII);
+ CHECK_NAME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, name, fname+1, STR_TERMINATE_ASCII);
+
+ CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info, file_id, internal_info, internal_information, file_id);
+ CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, file_id, internal_info, internal_information, file_id);
done:
smb_raw_exit(cli->session);
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c
index 7645289128..0871d25bc5 100644
--- a/source4/torture/raw/setfileinfo.c
+++ b/source4/torture/raw/setfileinfo.c
@@ -31,7 +31,7 @@ BOOL torture_raw_sfileinfo(int dummy)
struct cli_state *cli;
BOOL ret = True;
TALLOC_CTX *mem_ctx;
- int fnum_saved, fnum2, fnum = -1;
+ int fnum_saved, d_fnum, fnum2, fnum = -1;
char *fnum_fname;
char *fnum_fname_new;
char *path_fname;
@@ -478,6 +478,13 @@ BOOL torture_raw_sfileinfo(int dummy)
sfinfo.rename_information.in.new_name = path_fname+strlen(BASEDIR)+1;
CHECK_CALL_PATH(RENAME_INFORMATION, NT_STATUS_OK);
CHECK_STR(NAME_INFO, name_info, fname.s, path_fname);
+
+ printf("Trying rename with a root fid\n");
+ d_fnum = create_directory_handle(cli->tree, BASEDIR);
+ 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);
+ CHECK_STR(NAME_INFO, name_info, fname.s, fnum_fname);
#endif
#if 0
@@ -491,6 +498,7 @@ BOOL torture_raw_sfileinfo(int dummy)
#endif
done:
+ smb_raw_exit(cli->session);
cli_close(cli, fnum);
if (!cli_unlink(cli, fnum_fname)) {
printf("Failed to delete %s - %s\n", fnum_fname, cli_errstr(cli));