mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
s3: Replace cli_qfileinfo_test with a call to cli_qfileinfo
This commit is contained in:
@ -2344,7 +2344,6 @@ NTSTATUS cli_qpathinfo_basic_recv(struct tevent_req *req,
|
||||
SMB_STRUCT_STAT *sbuf, uint32 *attributes);
|
||||
NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
|
||||
SMB_STRUCT_STAT *sbuf, uint32 *attributes);
|
||||
bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **poutdata, uint32 *poutlen);
|
||||
NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
|
||||
struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
|
@ -1279,61 +1279,6 @@ NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
|
||||
return status;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Send a qfileinfo call.
|
||||
****************************************************************************/
|
||||
|
||||
bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **poutdata, uint32 *poutlen)
|
||||
{
|
||||
unsigned int data_len = 0;
|
||||
unsigned int param_len = 0;
|
||||
uint16 setup = TRANSACT2_QFILEINFO;
|
||||
char param[4];
|
||||
char *rparam=NULL, *rdata=NULL;
|
||||
|
||||
*poutdata = NULL;
|
||||
*poutlen = 0;
|
||||
|
||||
/* if its a win95 server then fail this - win95 totally screws it
|
||||
up */
|
||||
if (cli->win95)
|
||||
return False;
|
||||
|
||||
param_len = 4;
|
||||
|
||||
SSVAL(param, 0, fnum);
|
||||
SSVAL(param, 2, level);
|
||||
|
||||
if (!cli_send_trans(cli, SMBtrans2,
|
||||
NULL, /* name */
|
||||
-1, 0, /* fid, flags */
|
||||
&setup, 1, 0, /* setup, length, max */
|
||||
param, param_len, 2, /* param, length, max */
|
||||
NULL, data_len, cli->max_xmit /* data, length, max */
|
||||
)) {
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!cli_receive_trans(cli, SMBtrans2,
|
||||
&rparam, ¶m_len,
|
||||
&rdata, &data_len)) {
|
||||
return False;
|
||||
}
|
||||
|
||||
*poutdata = (char *)memdup(rdata, data_len);
|
||||
if (!*poutdata) {
|
||||
SAFE_FREE(rdata);
|
||||
SAFE_FREE(rparam);
|
||||
return False;
|
||||
}
|
||||
|
||||
*poutlen = data_len;
|
||||
|
||||
SAFE_FREE(rdata);
|
||||
SAFE_FREE(rparam);
|
||||
return True;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Send a qpathinfo SMB_QUERY_FILE_ALT_NAME_INFO call.
|
||||
****************************************************************************/
|
||||
|
@ -3100,22 +3100,24 @@ static bool run_trans2test(int dummy)
|
||||
This checks new W2K calls.
|
||||
*/
|
||||
|
||||
static bool new_trans(struct cli_state *pcli, int fnum, int level)
|
||||
static NTSTATUS new_trans(struct cli_state *pcli, int fnum, int level)
|
||||
{
|
||||
char *buf = NULL;
|
||||
uint8_t *buf = NULL;
|
||||
uint32 len;
|
||||
bool correct = True;
|
||||
NTSTATUS status;
|
||||
|
||||
if (!cli_qfileinfo_test(pcli, fnum, level, &buf, &len)) {
|
||||
printf("ERROR: qfileinfo (%d) failed (%s)\n", level, cli_errstr(pcli));
|
||||
correct = False;
|
||||
status = cli_qfileinfo(talloc_tos(), pcli, fnum, level, 0,
|
||||
pcli->max_xmit, &buf, &len);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("ERROR: qfileinfo (%d) failed (%s)\n", level,
|
||||
nt_errstr(status));
|
||||
} else {
|
||||
printf("qfileinfo: level %d, len = %u\n", level, len);
|
||||
dump_data(0, (uint8 *)buf, len);
|
||||
printf("\n");
|
||||
}
|
||||
SAFE_FREE(buf);
|
||||
return correct;
|
||||
TALLOC_FREE(buf);
|
||||
return status;
|
||||
}
|
||||
|
||||
static bool run_w2ktest(int dummy)
|
||||
@ -3427,17 +3429,6 @@ static bool run_deletetest(int dummy)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#if 0 /* JRATEST */
|
||||
{
|
||||
uint32 *accinfo = NULL;
|
||||
uint32 len;
|
||||
cli_qfileinfo_test(cli1, fnum1, SMB_FILE_ACCESS_INFORMATION, (char **)&accinfo, &len);
|
||||
if (accinfo)
|
||||
printf("access mode = 0x%lx\n", *accinfo);
|
||||
SAFE_FREE(accinfo);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
|
||||
printf("[1] close failed (%s)\n", cli_errstr(cli1));
|
||||
correct = False;
|
||||
|
Reference in New Issue
Block a user