static fstring username[2];
static int got_user;
static int got_pass;
-static BOOL use_kerberos;
+static bool use_kerberos;
static int numops = 1000;
-static BOOL showall;
-static BOOL analyze;
-static BOOL hide_unlock_fails;
-static BOOL use_oplocks;
+static bool showall;
+static bool analyze;
+static bool hide_unlock_fails;
+static bool use_oplocks;
static unsigned lock_range = 100;
static unsigned lock_base = 0;
static unsigned min_length = 0;
-static BOOL exact_error_codes;
-static BOOL zero_zero;
+static bool exact_error_codes;
+static bool zero_zero;
extern char *optarg;
extern int optind;
enum lock_op lock_op;
enum brl_type lock_type;
char conn, f;
- SMB_BIG_UINT start, len;
+ uint64_t start, len;
char needed;
};
{
#if NASTY_POSIX_LOCK_HACK
{
- pstring cmd;
static SMB_INO_T lastino;
if (lastino != ino) {
- slprintf(cmd, sizeof(cmd),
- "egrep POSIX.*%u /proc/locks", (int)ino);
- system(cmd);
+ char *cmd;
+ if (asprintf(&cmd,
+ "egrep POSIX.*%u /proc/locks", (int)ino) > 0) {
+ system(cmd);
+ SAFE_FREE(cmd);
+ }
}
lastino = ino;
}
struct nmb_name called, calling;
char *server_n;
fstring server;
- struct in_addr ip;
+ struct sockaddr_storage ss;
fstring myname;
static int count;
NTSTATUS status;
share++;
server_n = server;
-
- zero_ip(&ip);
+
+ zero_sockaddr(&ss);
slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++);
make_nmb_name(&called , server, 0x20);
again:
- zero_ip(&ip);
+ zero_sockaddr(&ss);
/* have to open a new connection */
if (!(c=cli_initialise())) {
return NULL;
}
- status = cli_connect(c, server_n, &ip);
+ status = cli_connect(c, server_n, &ss);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Connection to %s failed. Error %s\n", server_n, nt_errstr(status) ));
return NULL;
DEBUG(4,(" session request ok\n"));
- if (!cli_negprot(c)) {
- DEBUG(0,("protocol negotiation failed\n"));
+ status = cli_negprot(c);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("protocol negotiation failed: %s\n",
+ nt_errstr(status)));
cli_shutdown(c);
return NULL;
}
-static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
+static bool test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
int fnum[NSERVERS][NCONNECTIONS][NFILES],
struct record *rec)
{
unsigned conn = rec->conn;
unsigned f = rec->f;
- SMB_BIG_UINT start = rec->start;
- SMB_BIG_UINT len = rec->len;
+ uint64_t start = rec->start;
+ uint64_t len = rec->len;
enum brl_type op = rec->lock_type;
int server;
- BOOL ret[NSERVERS];
+ bool ret[NSERVERS];
NTSTATUS status[NSERVERS];
switch (rec->lock_op) {
argc -= NSERVERS;
argv += NSERVERS;
- lp_load(dyn_CONFIGFILE,True,False,False,True);
+ lp_load(get_dyn_CONFIGFILE(),True,False,False,True);
load_interfaces();
if (getenv("USER")) {