Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define NO_SYSLOG
-
#include "includes.h"
static fstring password;
static BOOL hide_unlock_fails;
static BOOL use_oplocks;
+extern char *optarg;
+extern int optind;
+
#define FILENAME "\\locktest.dat"
#define LOCKRANGE 100
#define LOCKBASE 0
static struct record *recorded;
-static int try_open(struct cli_state *c, char *nfs, int fstype, char *fname, int flags)
+static int try_open(struct cli_state *c, char *nfs, int fstype, const char *fname, int flags)
{
pstring path;
return False;
}
-static void print_brl(SMB_DEV_T dev, SMB_INO_T ino, int pid,
+static void print_brl(struct file_id id, struct server_id pid,
enum brl_type lock_type,
+ enum brl_flavour lock_flav,
br_off start, br_off size)
{
- printf("%6d %05x:%05x %s %.0f:%.0f(%.0f)\n",
- (int)pid, (int)dev, (int)ino,
+ printf("%6d %s %s %.0f:%.0f(%.0f)\n",
+ (int)procid_to_pid(&pid), file_id_static_string(&id),
lock_type==READ_LOCK?"R":"W",
(double)start, (double)start+size-1,(double)size);
if (!got_pass) {
char *pass = getpass("Password: ");
if (pass) {
- pstrcpy(password, pass);
+ fstrcpy(password, pass);
}
}
- slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
+ slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++);
nt_status = cli_full_connection(&c, myname, server_n, NULL, 0, share, "?????",
- username, lp_workgroup(), password, 0);
+ username, lp_workgroup(), password, 0,
+ Undefined, NULL);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("cli_full_connection failed with error %s\n", nt_errstr(nt_status)));
ZERO_STRUCT(fnum);
ZERO_STRUCT(cli);
- recorded = (struct record *)malloc(sizeof(*recorded) * numops);
+ recorded = SMB_MALLOC_ARRAY(struct record, numops);
for (n=0; n<numops; n++) {
recorded[n].conn = random() % NCONNECTIONS;
int main(int argc,char *argv[])
{
char *share1, *share2, *nfspath1, *nfspath2;
- extern char *optarg;
- extern int optind;
int opt;
char *p;
int seed;
argc -= 4;
argv += 4;
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE,True,False,False,True);
load_interfaces();
if (getenv("USER")) {
- pstrcpy(username,getenv("USER"));
+ fstrcpy(username,getenv("USER"));
}
seed = time(NULL);
while ((opt = getopt(argc, argv, "U:s:ho:aAW:O")) != EOF) {
switch (opt) {
case 'U':
- pstrcpy(username,optarg);
+ fstrcpy(username,optarg);
p = strchr_m(username,'%');
if (p) {
*p = 0;
- pstrcpy(password, p+1);
+ fstrcpy(password, p+1);
got_pass = 1;
}
break;