mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
pull_ascii_pstring is gone.
Jeremy. (This used to be commit 288aacce4b56d159218be311019cb951e5a232fd)
This commit is contained in:
parent
de7fd585b1
commit
755051b569
@ -1178,12 +1178,6 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx,
|
|||||||
return src_len;
|
return src_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t pull_ascii_pstring(char *dest, const void *src)
|
|
||||||
{
|
|
||||||
return pull_ascii(dest, src, sizeof(pstring), -1, STR_TERMINATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t pull_ascii_fstring(char *dest, const void *src)
|
size_t pull_ascii_fstring(char *dest, const void *src)
|
||||||
{
|
{
|
||||||
return pull_ascii(dest, src, sizeof(fstring), -1, STR_TERMINATE);
|
return pull_ascii(dest, src, sizeof(fstring), -1, STR_TERMINATE);
|
||||||
|
@ -28,11 +28,13 @@ static int total_errors;
|
|||||||
|
|
||||||
static void *find_fn(const char *name)
|
static void *find_fn(const char *name)
|
||||||
{
|
{
|
||||||
pstring s;
|
char *s;
|
||||||
static void *h;
|
static void *h;
|
||||||
void *res;
|
void *res;
|
||||||
|
|
||||||
pstr_sprintf(s, "_nss_%s_%s", nss_name, name);
|
if (asprintf(&s, "_nss_%s_%s", nss_name, name) < 0) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!h) {
|
if (!h) {
|
||||||
h = sys_dlopen(so_path, RTLD_LAZY);
|
h = sys_dlopen(so_path, RTLD_LAZY);
|
||||||
@ -45,8 +47,10 @@ static void *find_fn(const char *name)
|
|||||||
if (!res) {
|
if (!res) {
|
||||||
printf("Can't find function %s\n", s);
|
printf("Can't find function %s\n", s);
|
||||||
total_errors++;
|
total_errors++;
|
||||||
|
SAFE_FREE(s);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
SAFE_FREE(s);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#define OP_MIN 0
|
#define OP_MIN 0
|
||||||
#define OP_MAX 20
|
#define OP_MAX 20
|
||||||
|
|
||||||
|
#define DATA_SIZE 1024
|
||||||
|
#define PARAM_SIZE 1024
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
look for a partial hit
|
look for a partial hit
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -84,14 +87,14 @@ static NTSTATUS try_trans2_len(struct cli_state *cli,
|
|||||||
NTSTATUS ret=NT_STATUS_OK;
|
NTSTATUS ret=NT_STATUS_OK;
|
||||||
|
|
||||||
ret = try_trans2(cli, op, param, data, param_len,
|
ret = try_trans2(cli, op, param, data, param_len,
|
||||||
sizeof(pstring), rparam_len, rdata_len);
|
DATA_SIZE, rparam_len, rdata_len);
|
||||||
#if VERBOSE
|
#if VERBOSE
|
||||||
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
|
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
|
||||||
#endif
|
#endif
|
||||||
if (!NT_STATUS_IS_OK(ret)) return ret;
|
if (!NT_STATUS_IS_OK(ret)) return ret;
|
||||||
|
|
||||||
*data_len = 0;
|
*data_len = 0;
|
||||||
while (*data_len < sizeof(pstring)) {
|
while (*data_len < DATA_SIZE) {
|
||||||
ret = try_trans2(cli, op, param, data, param_len,
|
ret = try_trans2(cli, op, param, data, param_len,
|
||||||
*data_len, rparam_len, rdata_len);
|
*data_len, rparam_len, rdata_len);
|
||||||
if (NT_STATUS_IS_OK(ret)) break;
|
if (NT_STATUS_IS_OK(ret)) break;
|
||||||
@ -115,7 +118,7 @@ static bool scan_trans2(struct cli_state *cli, int op, int level,
|
|||||||
int data_len = 0;
|
int data_len = 0;
|
||||||
int param_len = 0;
|
int param_len = 0;
|
||||||
unsigned int rparam_len, rdata_len;
|
unsigned int rparam_len, rdata_len;
|
||||||
pstring param, data;
|
char param[PARAM_SIZE], data[DATA_SIZE];
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
memset(data, 0, sizeof(data));
|
memset(data, 0, sizeof(data));
|
||||||
@ -286,14 +289,14 @@ static NTSTATUS try_nttrans_len(struct cli_state *cli,
|
|||||||
NTSTATUS ret=NT_STATUS_OK;
|
NTSTATUS ret=NT_STATUS_OK;
|
||||||
|
|
||||||
ret = try_nttrans(cli, op, param, data, param_len,
|
ret = try_nttrans(cli, op, param, data, param_len,
|
||||||
sizeof(pstring), rparam_len, rdata_len);
|
DATA_SIZE, rparam_len, rdata_len);
|
||||||
#if VERBOSE
|
#if VERBOSE
|
||||||
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
|
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
|
||||||
#endif
|
#endif
|
||||||
if (!NT_STATUS_IS_OK(ret)) return ret;
|
if (!NT_STATUS_IS_OK(ret)) return ret;
|
||||||
|
|
||||||
*data_len = 0;
|
*data_len = 0;
|
||||||
while (*data_len < sizeof(pstring)) {
|
while (*data_len < DATA_SIZE) {
|
||||||
ret = try_nttrans(cli, op, param, data, param_len,
|
ret = try_nttrans(cli, op, param, data, param_len,
|
||||||
*data_len, rparam_len, rdata_len);
|
*data_len, rparam_len, rdata_len);
|
||||||
if (NT_STATUS_IS_OK(ret)) break;
|
if (NT_STATUS_IS_OK(ret)) break;
|
||||||
@ -317,7 +320,7 @@ static bool scan_nttrans(struct cli_state *cli, int op, int level,
|
|||||||
int data_len = 0;
|
int data_len = 0;
|
||||||
int param_len = 0;
|
int param_len = 0;
|
||||||
unsigned int rparam_len, rdata_len;
|
unsigned int rparam_len, rdata_len;
|
||||||
pstring param, data;
|
char param[PARAM_SIZE], data[DATA_SIZE];
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
memset(data, 0, sizeof(data));
|
memset(data, 0, sizeof(data));
|
||||||
|
@ -810,7 +810,7 @@ static bool run_netbench(int client)
|
|||||||
{
|
{
|
||||||
struct cli_state *cli;
|
struct cli_state *cli;
|
||||||
int i;
|
int i;
|
||||||
pstring line;
|
char line[1024];
|
||||||
char cname[20];
|
char cname[20];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
const char *params[20];
|
const char *params[20];
|
||||||
@ -841,7 +841,7 @@ static bool run_netbench(int client)
|
|||||||
/* printf("[%d] %s\n", line_count, line); */
|
/* printf("[%d] %s\n", line_count, line); */
|
||||||
|
|
||||||
all_string_sub(line,"client1", cname, sizeof(line));
|
all_string_sub(line,"client1", cname, sizeof(line));
|
||||||
|
|
||||||
/* parse the command parameters */
|
/* parse the command parameters */
|
||||||
params[0] = strtok(line," ");
|
params[0] = strtok(line," ");
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -2041,7 +2041,7 @@ static bool run_fdpasstest(int dummy)
|
|||||||
struct cli_state *cli1, *cli2;
|
struct cli_state *cli1, *cli2;
|
||||||
const char *fname = "\\fdpass.tst";
|
const char *fname = "\\fdpass.tst";
|
||||||
int fnum1;
|
int fnum1;
|
||||||
pstring buf;
|
char buf[1024];
|
||||||
|
|
||||||
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
|
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
|
||||||
return False;
|
return False;
|
||||||
@ -2095,7 +2095,7 @@ static bool run_fdsesstest(int dummy)
|
|||||||
const char *fname1 = "\\fdsess1.tst";
|
const char *fname1 = "\\fdsess1.tst";
|
||||||
int fnum1;
|
int fnum1;
|
||||||
int fnum2;
|
int fnum2;
|
||||||
pstring buf;
|
char buf[1024];
|
||||||
bool ret = True;
|
bool ret = True;
|
||||||
|
|
||||||
if (!torture_open_connection(&cli, 0))
|
if (!torture_open_connection(&cli, 0))
|
||||||
@ -2317,7 +2317,7 @@ static bool run_randomipc(int dummy)
|
|||||||
char *rparam = NULL;
|
char *rparam = NULL;
|
||||||
char *rdata = NULL;
|
char *rdata = NULL;
|
||||||
unsigned int rdrcnt,rprcnt;
|
unsigned int rdrcnt,rprcnt;
|
||||||
pstring param;
|
char param[1024];
|
||||||
int api, param_len, i;
|
int api, param_len, i;
|
||||||
struct cli_state *cli;
|
struct cli_state *cli;
|
||||||
bool correct = True;
|
bool correct = True;
|
||||||
@ -2480,7 +2480,7 @@ static bool run_trans2test(int dummy)
|
|||||||
const char *fname = "\\trans2.tst";
|
const char *fname = "\\trans2.tst";
|
||||||
const char *dname = "\\trans2";
|
const char *dname = "\\trans2";
|
||||||
const char *fname2 = "\\trans2\\trans2.tst";
|
const char *fname2 = "\\trans2\\trans2.tst";
|
||||||
pstring pname;
|
char pname[1024];
|
||||||
bool correct = True;
|
bool correct = True;
|
||||||
|
|
||||||
printf("starting trans2 test\n");
|
printf("starting trans2 test\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user