1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r14527: Fix build problems.

(This used to be commit 863ca4014d)
This commit is contained in:
Jelmer Vernooij 2006-03-17 17:59:58 +00:00 committed by Gerald (Jerry) Carter
parent 8437d5b891
commit d09b70c98b
49 changed files with 148 additions and 102 deletions

View File

@ -22,6 +22,8 @@
#include "dlinklist.h"
#include "libcli/raw/libcliraw.h"
#include "torture/torture.h"
#include "libcli/libcli.h"
#include "torture/util.h"
int create_complex_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx, const char *fname);

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "torture/torture.h"
#include "libcli/libcli.h"
#include "torture/util.h"
extern int torture_failures;

View File

@ -23,6 +23,7 @@
#include "torture/torture.h"
#include "torture/basic/proto.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "system/filesys.h"
#include "system/time.h"
#include "libcli/resolve/resolve.h"

View File

@ -24,6 +24,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\chartest\\"

View File

@ -28,6 +28,7 @@
#include "system/time.h"
#include "system/filesys.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\delaywrite"

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "libcli/libcli.h"
#include "torture/torture.h"
#include "torture/util.h"
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"

View File

@ -23,6 +23,7 @@
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
extern BOOL torture_showall;
extern int torture_failures;

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "libcli/libcli.h"
#include "torture/torture.h"
#include "torture/util.h"
#include "system/filesys.h"
static void list_fn(struct clilist_file_info *finfo, const char *name, void *state)

View File

@ -25,6 +25,7 @@
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\test_disconnect"

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "torture/torture.h"
#include "system/time.h"
#include "system/filesys.h"

View File

@ -23,6 +23,7 @@
#include "system/filesys.h"
#include "lib/tdb/include/tdbutil.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "pstring.h"
static TDB_CONTEXT *tdb;

View File

@ -24,6 +24,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
struct bitmapping {
const char *name;

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "libcli/libcli.h"
#include "torture/torture.h"
#include "torture/util.h"
/*
Test rename on files open with share delete and no share delete.

View File

@ -21,6 +21,7 @@
#include "includes.h"
#include "torture/torture.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "libcli/raw/libcliraw.h"
#include "system/filesys.h"
#include "pstring.h"

View File

@ -24,6 +24,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "system/time.h"
#include "libcli/smb_composite/smb_composite.h"
#include "auth/credentials/credentials.h"

View File

@ -25,6 +25,7 @@
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\unlinktest"

View File

@ -23,6 +23,7 @@
#include "system/iconv.h"
#include "system/filesys.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "pstring.h"
BOOL torture_utable(void)

View File

@ -263,8 +263,7 @@ MANPAGE = man/smbtorture.1
[BINARY::gentest]
INSTALLDIR = BINDIR
OBJ_FILES = \
gentest.o \
torture_util.o
gentest.o
REQUIRED_SUBSYSTEMS = \
CONFIG \
LIBBASIC \
@ -298,8 +297,7 @@ MANPAGE = man/masktest.1
[BINARY::locktest]
INSTALLDIR = BINDIR
OBJ_FILES = \
locktest.o \
torture_util.o
locktest.o
REQUIRED_SUBSYSTEMS = \
LIBSMB \
CONFIG \

View File

@ -26,7 +26,6 @@
#include "libcli/raw/libcliraw.h"
#include "librpc/gen_ndr/security.h"
#include "auth/gensec/gensec.h"
#include "torture/torture.h"
#define NSERVERS 2
#define NINSTANCES 2
@ -2136,6 +2135,28 @@ static void usage(void)
");
}
/**
split a UNC name into server and share names
*/
static BOOL split_unc_name(const char *unc, char **server, char **share)
{
char *p = strdup(unc);
if (!p) return False;
all_string_sub(p, "\\", "/", 0);
if (strncmp(p, "//", 2) != 0) return False;
(*server) = p+2;
p = strchr(*server, '/');
if (!p) return False;
*p = 0;
(*share) = p+1;
return True;
}
/****************************************************************************
main program
****************************************************************************/

View File

@ -25,6 +25,7 @@
#include "torture/torture.h"
#include "system/iconv.h"
#include "system/time.h"
#include "torture/util.h"
#if HAVE_NATIVE_ICONV
/*

View File

@ -19,8 +19,9 @@
*/
#include "includes.h"
#include "torture/torture.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "torture/torture.h"
#include "system/filesys.h"
#include "pstring.h"

View File

@ -27,6 +27,8 @@
#include "libcli/libcli.h"
#include "libcli/raw/libcliraw.h"
#include "torture/torture.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define MAX_FILES 100

View File

@ -20,7 +20,8 @@
*/
#include "includes.h"
#include "torture/torture.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "libcli/rap/rap.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"

View File

@ -28,6 +28,7 @@
#include "libcli/util/clilsa.h"
#include "libcli/security/proto.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "torture/util.h"
#define BASEDIR "\\testsd"

View File

@ -22,6 +22,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\rawchkpath"

View File

@ -23,6 +23,7 @@
#include "system/time.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
/* basic testing of all RAW_CLOSE_* calls

View File

@ -30,6 +30,7 @@
#include "libcli/smb_composite/smb_composite.h"
#include "lib/cmdline/popt_common.h"
#include "librpc/gen_ndr/security.h"
#include "torture/util.h"
#define BASEDIR "\\composite"

View File

@ -26,6 +26,7 @@
#include "lib/cmdline/popt_common.h"
#include "lib/events/events.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#include "auth/credentials/credentials.h"
#define BASEDIR "\\rawcontext"

View File

@ -25,6 +25,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\testeas"

View File

@ -24,6 +24,7 @@
#include "libcli/raw/ioctl.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\rawioctl"

View File

@ -24,6 +24,7 @@
#include "system/time.h"
#include "system/filesys.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \

View File

@ -22,6 +22,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\mkdirtest"

View File

@ -23,6 +23,7 @@
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\test_mux"

View File

@ -23,6 +23,7 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "system/filesys.h"
#include "torture/util.h"
#define BASEDIR "\\test_notify"

View File

@ -26,6 +26,7 @@
#include "librpc/gen_ndr/security.h"
#include "lib/events/events.h"
#include "libcli/libcli.h"
#include "torture/util.h"
/* enum for whether reads/writes are possible on a file */
enum rdwr_mode {RDWR_NONE, RDWR_RDONLY, RDWR_WRONLY, RDWR_RDWR};

View File

@ -23,6 +23,7 @@
#include "librpc/gen_ndr/security.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define CHECK_VAL(v, correct) do { \
if ((v) != (correct)) { \

View File

@ -22,6 +22,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
static struct {
const char *name;

View File

@ -22,6 +22,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
static struct {

View File

@ -24,6 +24,7 @@
#include "system/time.h"
#include "system/filesys.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \

View File

@ -22,6 +22,7 @@
#include "torture/torture.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \

View File

@ -23,6 +23,7 @@
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\testsearch"

View File

@ -23,6 +23,7 @@
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \

View File

@ -23,6 +23,7 @@
#include "system/time.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\testsfileinfo"

View File

@ -25,6 +25,7 @@
#include "libcli/raw/libcliraw.h"
#include "system/filesys.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define BASEDIR "\\teststreams"

View File

@ -23,6 +23,7 @@
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \

View File

@ -25,6 +25,7 @@
#include "system/time.h"
#include "system/filesys.h"
#include "libcli/libcli.h"
#include "torture/util.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \

View File

@ -61,80 +61,6 @@ _PUBLIC_ BOOL use_level_II_oplocks;
_PUBLIC_ BOOL torture_showall = False;
BOOL torture_open_connection_share(TALLOC_CTX *mem_ctx,
struct smbcli_state **c,
const char *hostname,
const char *sharename,
struct event_context *ev)
{
NTSTATUS status;
status = smbcli_full_connection(mem_ctx, c, hostname,
sharename, NULL,
cmdline_credentials, ev);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return False;
}
(*c)->transport->options.use_oplocks = use_oplocks;
(*c)->transport->options.use_level2_oplocks = use_level_II_oplocks;
return True;
}
_PUBLIC_ BOOL torture_open_connection(struct smbcli_state **c)
{
const char *host = lp_parm_string(-1, "torture", "host");
const char *share = lp_parm_string(-1, "torture", "share");
return torture_open_connection_share(NULL, c, host, share, NULL);
}
_PUBLIC_ BOOL torture_close_connection(struct smbcli_state *c)
{
BOOL ret = True;
if (!c) return True;
if (NT_STATUS_IS_ERR(smbcli_tdis(c))) {
printf("tdis failed (%s)\n", smbcli_errstr(c->tree));
ret = False;
}
talloc_free(c);
return ret;
}
/* check if the server produced the expected error code */
_PUBLIC_ BOOL check_error(const char *location, struct smbcli_state *c,
uint8_t eclass, uint32_t ecode, NTSTATUS nterr)
{
NTSTATUS status;
status = smbcli_nt_error(c->tree);
if (NT_STATUS_IS_DOS(status)) {
int class, num;
class = NT_STATUS_DOS_CLASS(status);
num = NT_STATUS_DOS_CODE(status);
if (eclass != class || ecode != num) {
printf("unexpected error code %s\n", nt_errstr(status));
printf(" expected %s or %s (at %s)\n",
nt_errstr(NT_STATUS_DOS(eclass, ecode)),
nt_errstr(nterr), location);
return False;
}
} else {
if (!NT_STATUS_EQUAL(nterr, status)) {
printf("unexpected error code %s\n", nt_errstr(status));
printf(" expected %s (at %s)\n", nt_errstr(nterr), location);
return False;
}
}
return True;
}
static BOOL wait_lock(struct smbcli_state *c, int fnum, uint32_t offset, uint32_t len)

View File

@ -22,6 +22,7 @@
#ifndef __TORTURE_H__
#define __TORTURE_H__
struct smbcli_state;
struct torture_op {
const char *name;
BOOL (*fn)(void);
@ -40,7 +41,6 @@ extern int torture_numops;
extern int torture_failures;
extern BOOL use_level_II_oplocks;
#include "libcli/libcli.h"
#include "torture/proto.h"
#endif /* __TORTURE_H__ */

View File

@ -353,26 +353,6 @@ void torture_all_info(struct smbcli_tree *tree, const char *fname)
}
/*
split a UNC name into server and share names
*/
BOOL split_unc_name(const char *unc, char **server, char **share)
{
char *p = strdup(unc);
if (!p) return False;
all_string_sub(p, "\\", "/", 0);
if (strncmp(p, "//", 2) != 0) return False;
(*server) = p+2;
p = strchr(*server, '/');
if (!p) return False;
*p = 0;
(*share) = p+1;
return True;
}
/*
set a attribute on a file
*/
@ -483,3 +463,78 @@ NTSTATUS torture_check_ea(struct smbcli_state *cli,
return NT_STATUS_EA_CORRUPT_ERROR;
}
BOOL torture_open_connection_share(TALLOC_CTX *mem_ctx,
struct smbcli_state **c,
const char *hostname,
const char *sharename,
struct event_context *ev)
{
NTSTATUS status;
status = smbcli_full_connection(mem_ctx, c, hostname,
sharename, NULL,
cmdline_credentials, ev);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return False;
}
(*c)->transport->options.use_oplocks = use_oplocks;
(*c)->transport->options.use_level2_oplocks = use_level_II_oplocks;
return True;
}
_PUBLIC_ BOOL torture_open_connection(struct smbcli_state **c)
{
const char *host = lp_parm_string(-1, "torture", "host");
const char *share = lp_parm_string(-1, "torture", "share");
return torture_open_connection_share(NULL, c, host, share, NULL);
}
_PUBLIC_ BOOL torture_close_connection(struct smbcli_state *c)
{
BOOL ret = True;
if (!c) return True;
if (NT_STATUS_IS_ERR(smbcli_tdis(c))) {
printf("tdis failed (%s)\n", smbcli_errstr(c->tree));
ret = False;
}
talloc_free(c);
return ret;
}
/* check if the server produced the expected error code */
_PUBLIC_ BOOL check_error(const char *location, struct smbcli_state *c,
uint8_t eclass, uint32_t ecode, NTSTATUS nterr)
{
NTSTATUS status;
status = smbcli_nt_error(c->tree);
if (NT_STATUS_IS_DOS(status)) {
int class, num;
class = NT_STATUS_DOS_CLASS(status);
num = NT_STATUS_DOS_CODE(status);
if (eclass != class || ecode != num) {
printf("unexpected error code %s\n", nt_errstr(status));
printf(" expected %s or %s (at %s)\n",
nt_errstr(NT_STATUS_DOS(eclass, ecode)),
nt_errstr(nterr), location);
return False;
}
} else {
if (!NT_STATUS_EQUAL(nterr, status)) {
printf("unexpected error code %s\n", nt_errstr(status));
printf(" expected %s (at %s)\n", nt_errstr(nterr), location);
return False;
}
}
return True;
}