*/
#include "includes.h"
-#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/raw/raw_proto.h"
#include "libcli/libcli.h"
#include "torture/util.h"
-#include "librpc/rpc/dcerpc.h"
-#include "torture/rpc/rpc.h"
-#include "torture/raw/proto.h"
+#include "torture/rpc/torture_rpc.h"
#include "param/param.h"
+#include "torture/raw/proto.h"
static struct {
const char *name;
enum smb_fileinfo_level level;
- uint_t only_paths:1;
- uint_t only_handles:1;
+ unsigned int only_paths:1;
+ unsigned int only_handles:1;
uint32_t capability_mask;
- uint_t expected_ipc_access_denied:1;
+ unsigned int expected_ipc_access_denied:1;
NTSTATUS expected_ipc_fnum_status;
NTSTATUS fnum_status, fname_status;
union smb_fileinfo fnum_finfo, fname_finfo;
{
time_t t2 = nt_time_to_unix(nt);
if (abs(t2 - t) <= 2) return 0;
- return t2 - t;
+ return t2 > t ? 1 : -1;
}
/* local macros to make the code below more readable */
#define VAL_EQUAL(n1, v1, n2, v2) do {if (s1->n1.out.v1 != s2->n2.out.v2) { \
printf("%s/%s [%u] != %s/%s [%u] at %s(%d)\n", \
- #n1, #v1, (uint_t)s1->n1.out.v1, \
- #n2, #v2, (uint_t)s2->n2.out.v2, \
+ #n1, #v1, (unsigned int)s1->n1.out.v1, \
+ #n2, #v2, (unsigned int)s2->n2.out.v2, \
__FILE__, __LINE__); \
ret = false; \
}} while(0)
#define VAL_UNKNOWN(n1, v1) do {if (s1->n1.out.v1 != 0) { \
printf("%s/%s non-zero unknown - %u (0x%x) at %s(%d)\n", \
#n1, #v1, \
- (uint_t)s1->n1.out.v1, \
- (uint_t)s1->n1.out.v1, \
+ (unsigned int)s1->n1.out.v1, \
+ (unsigned int)s1->n1.out.v1, \
__FILE__, __LINE__); \
ret = false; \
}} while(0)
if (is_ipc) {
if (levels[i].expected_ipc_access_denied && NT_STATUS_EQUAL(NT_STATUS_ACCESS_DENIED, levels[i].fname_status)) {
+ } else if (!levels[i].only_handles &&
+ NT_STATUS_EQUAL(levels[i].fname_status,
+ NT_STATUS_NOT_SUPPORTED)) {
+ torture_warning(torture, "fname level %s %s",
+ levels[i].name,
+ nt_errstr(levels[i].fname_status));
+ continue;
} else if (!levels[i].only_handles && !NT_STATUS_EQUAL(NT_STATUS_INVALID_DEVICE_REQUEST, levels[i].fname_status)) {
printf("ERROR: fname level %s failed, expected NT_STATUS_INVALID_DEVICE_REQUEST - %s\n",
levels[i].name, nt_errstr(levels[i].fname_status));
count++;
}
+ if (!levels[i].only_paths &&
+ (NT_STATUS_EQUAL(levels[i].fnum_status,
+ NT_STATUS_NOT_SUPPORTED) ||
+ NT_STATUS_EQUAL(levels[i].fnum_status,
+ NT_STATUS_NOT_IMPLEMENTED))) {
+ torture_warning(torture, "fnum level %s %s",
+ levels[i].name,
+ nt_errstr(levels[i].fnum_status));
+ continue;
+ }
if (!levels[i].only_paths && !NT_STATUS_EQUAL(levels[i].expected_ipc_fnum_status, levels[i].fnum_status)) {
printf("ERROR: fnum level %s failed, expected %s - %s\n",
levels[i].name, nt_errstr(levels[i].expected_ipc_fnum_status),
count++;
}
} else {
+ if (!levels[i].only_paths &&
+ (NT_STATUS_EQUAL(levels[i].fnum_status,
+ NT_STATUS_NOT_SUPPORTED) ||
+ NT_STATUS_EQUAL(levels[i].fnum_status,
+ NT_STATUS_NOT_IMPLEMENTED))) {
+ torture_warning(torture, "fnum level %s %s",
+ levels[i].name,
+ nt_errstr(levels[i].fnum_status));
+ continue;
+ }
+
+ if (!levels[i].only_handles &&
+ (NT_STATUS_EQUAL(levels[i].fname_status,
+ NT_STATUS_NOT_SUPPORTED) ||
+ NT_STATUS_EQUAL(levels[i].fname_status,
+ NT_STATUS_NOT_IMPLEMENTED))) {
+ torture_warning(torture, "fname level %s %s",
+ levels[i].name,
+ nt_errstr(levels[i].fname_status));
+ continue;
+ }
+
if (!levels[i].only_paths && !NT_STATUS_IS_OK(levels[i].fnum_status)) {
printf("ERROR: fnum level %s failed - %s\n",
levels[i].name, nt_errstr(levels[i].fnum_status));
s1 = fnum_find(sname); \
if (s1 && s1->stype.out.tfield != correct_size) { \
printf("(%d) handle %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \
- (uint_t)s1->stype.out.tfield, \
- (uint_t)correct_size); \
+ (unsigned int)s1->stype.out.tfield, \
+ (unsigned int)correct_size); \
ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && s1->stype.out.tfield != correct_size) { \
printf("(%d) path %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \
- (uint_t)s1->stype.out.tfield, \
- (uint_t)correct_size); \
+ (unsigned int)s1->stype.out.tfield, \
+ (unsigned int)correct_size); \
ret = false; \
}} while (0)
s1 = fnum_find("STANDARD_INFO");
correct_size = s1->standard_info.out.size;
- torture_comment(torture, "size: %u\n", (uint_t)correct_size);
+ torture_comment(torture, "size: %u\n", (unsigned int)correct_size);
SIZE_CHECK("GETATTR", getattr, size);
SIZE_CHECK("GETATTRE", getattre, size);
s1 = fnum_find("STANDARD_INFO");
correct_size = s1->standard_info.out.alloc_size;
- torture_comment(torture, "alloc_size: %u\n", (uint_t)correct_size);
+ torture_comment(torture, "alloc_size: %u\n", (unsigned int)correct_size);
SIZE_CHECK("GETATTRE", getattre, alloc_size);
SIZE_CHECK("STANDARD", standard, alloc_size);
s1 = fnum_find(sname); \
if (s1 && s1->stype.out.tfield != correct_attrib) { \
printf("(%d) handle %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \
- (uint_t)s1->stype.out.tfield, \
- (uint_t)correct_attrib); \
+ (unsigned int)s1->stype.out.tfield, \
+ (unsigned int)correct_attrib); \
ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && s1->stype.out.tfield != correct_attrib) { \
printf("(%d) path %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \
- (uint_t)s1->stype.out.tfield, \
- (uint_t)correct_attrib); \
+ (unsigned int)s1->stype.out.tfield, \
+ (unsigned int)correct_attrib); \
ret = false; \
}} while (0)
s1 = fnum_find("BASIC_INFO");
correct_attrib = s1->basic_info.out.attrib;
- torture_comment(torture, "attrib: 0x%x\n", (uint_t)correct_attrib);
+ torture_comment(torture, "attrib: 0x%x\n", (unsigned int)correct_attrib);
ATTRIB_CHECK("GETATTR", getattr, attrib);
if (!is_ipc) {
s1 = fnum_find("ALT_NAME_INFO");
if (s1) {
correct_name = s1->alt_name_info.out.fname.s;
+ }
+
+ if (!correct_name) {
+ torture_comment(torture, "no alternate name information\n");
+ } else {
torture_comment(torture, "alt_name: %s\n", correct_name);
NAME_CHECK("ALT_NAME_INFO", alt_name_info, fname, STR_UNICODE);
s1 = fnum_find("BASIC_INFO");
if (s1 && is_ipc) {
if (s1->basic_info.out.attrib != FILE_ATTRIBUTE_NORMAL) {
- printf("(%d) attrib basic_info/nlink incorrect - %d should be %d\n", __LINE__, s1->basic_info.out.attrib, FILE_ATTRIBUTE_NORMAL);
+ printf("(%d) attrib basic_info/nlink incorrect - %d should be %d\n", __LINE__, s1->basic_info.out.attrib, (int)FILE_ATTRIBUTE_NORMAL);
ret = false;
}
}
if (s1 && s1->stype.out.tfield != 0) { \
printf("(%d) handle %s/%s unknown != 0 (0x%x)\n", __LINE__, \
#stype, #tfield, \
- (uint_t)s1->stype.out.tfield); \
+ (unsigned int)s1->stype.out.tfield); \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && s1->stype.out.tfield != 0) { \
printf("(%d) path %s/%s unknown != 0 (0x%x)\n", __LINE__, \
#stype, #tfield, \
- (uint_t)s1->stype.out.tfield); \
+ (unsigned int)s1->stype.out.tfield); \
}} while (0)
#endif
/* now get a bit fancier .... */
struct smbcli_tree *ipc_tree;
NTSTATUS status;
- if (!(p = dcerpc_pipe_init(torture, cli->tree->session->transport->socket->event.ctx,
- lp_iconv_convenience(torture->lp_ctx)))) {
+ if (!(p = dcerpc_pipe_init(torture, cli->tree->session->transport->socket->event.ctx))) {
return false;
}