1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

pull_ascii_pstring is gone.

Jeremy.
(This used to be commit 288aacce4b)
This commit is contained in:
Jeremy Allison 2007-12-04 17:05:33 -08:00
parent de7fd585b1
commit 755051b569
4 changed files with 21 additions and 20 deletions

View File

@ -1178,12 +1178,6 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx,
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)
{
return pull_ascii(dest, src, sizeof(fstring), -1, STR_TERMINATE);

View File

@ -28,11 +28,13 @@ static int total_errors;
static void *find_fn(const char *name)
{
pstring s;
char *s;
static void *h;
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) {
h = sys_dlopen(so_path, RTLD_LAZY);
@ -45,8 +47,10 @@ static void *find_fn(const char *name)
if (!res) {
printf("Can't find function %s\n", s);
total_errors++;
SAFE_FREE(s);
return NULL;
}
SAFE_FREE(s);
return res;
}

View File

@ -23,6 +23,9 @@
#define OP_MIN 0
#define OP_MAX 20
#define DATA_SIZE 1024
#define PARAM_SIZE 1024
/****************************************************************************
look for a partial hit
****************************************************************************/
@ -84,14 +87,14 @@ static NTSTATUS try_trans2_len(struct cli_state *cli,
NTSTATUS ret=NT_STATUS_OK;
ret = try_trans2(cli, op, param, data, param_len,
sizeof(pstring), rparam_len, rdata_len);
DATA_SIZE, rparam_len, rdata_len);
#if VERBOSE
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
#endif
if (!NT_STATUS_IS_OK(ret)) return ret;
*data_len = 0;
while (*data_len < sizeof(pstring)) {
while (*data_len < DATA_SIZE) {
ret = try_trans2(cli, op, param, data, param_len,
*data_len, rparam_len, rdata_len);
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 param_len = 0;
unsigned int rparam_len, rdata_len;
pstring param, data;
char param[PARAM_SIZE], data[DATA_SIZE];
NTSTATUS status;
memset(data, 0, sizeof(data));
@ -286,14 +289,14 @@ static NTSTATUS try_nttrans_len(struct cli_state *cli,
NTSTATUS ret=NT_STATUS_OK;
ret = try_nttrans(cli, op, param, data, param_len,
sizeof(pstring), rparam_len, rdata_len);
DATA_SIZE, rparam_len, rdata_len);
#if VERBOSE
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
#endif
if (!NT_STATUS_IS_OK(ret)) return ret;
*data_len = 0;
while (*data_len < sizeof(pstring)) {
while (*data_len < DATA_SIZE) {
ret = try_nttrans(cli, op, param, data, param_len,
*data_len, rparam_len, rdata_len);
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 param_len = 0;
unsigned int rparam_len, rdata_len;
pstring param, data;
char param[PARAM_SIZE], data[DATA_SIZE];
NTSTATUS status;
memset(data, 0, sizeof(data));

View File

@ -810,7 +810,7 @@ static bool run_netbench(int client)
{
struct cli_state *cli;
int i;
pstring line;
char line[1024];
char cname[20];
FILE *f;
const char *params[20];
@ -841,7 +841,7 @@ static bool run_netbench(int client)
/* printf("[%d] %s\n", line_count, line); */
all_string_sub(line,"client1", cname, sizeof(line));
/* parse the command parameters */
params[0] = strtok(line," ");
i = 0;
@ -2041,7 +2041,7 @@ static bool run_fdpasstest(int dummy)
struct cli_state *cli1, *cli2;
const char *fname = "\\fdpass.tst";
int fnum1;
pstring buf;
char buf[1024];
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
return False;
@ -2095,7 +2095,7 @@ static bool run_fdsesstest(int dummy)
const char *fname1 = "\\fdsess1.tst";
int fnum1;
int fnum2;
pstring buf;
char buf[1024];
bool ret = True;
if (!torture_open_connection(&cli, 0))
@ -2317,7 +2317,7 @@ static bool run_randomipc(int dummy)
char *rparam = NULL;
char *rdata = NULL;
unsigned int rdrcnt,rprcnt;
pstring param;
char param[1024];
int api, param_len, i;
struct cli_state *cli;
bool correct = True;
@ -2480,7 +2480,7 @@ static bool run_trans2test(int dummy)
const char *fname = "\\trans2.tst";
const char *dname = "\\trans2";
const char *fname2 = "\\trans2\\trans2.tst";
pstring pname;
char pname[1024];
bool correct = True;
printf("starting trans2 test\n");