perror("ERROR: Unable to open print file");
goto done;
} else {
- copies = atoi(argv[4]);
+ char *p = argv[4];
+ char *endp;
+
+ copies = strtol(p, &endp, 10);
+ if (p == endp) {
+ perror("ERROR: Unable to determine number of copies");
+ goto done;
+ }
}
/*
setup_logging("smbspool", DEBUG_STDOUT);
- lp_set_in_client(True); /* Make sure that we tell lp_load we are */
-
- load_case_tables();
+ smb_init_locale();
- if (!lp_load(get_dyn_CONFIGFILE(), True, False, False, True)) {
+ if (!lp_load_client(get_dyn_CONFIGFILE())) {
fprintf(stderr, "ERROR: Can't load %s - run testparm to debug it\n", get_dyn_CONFIGFILE());
goto done;
}
/* Start the SMB connection */
*need_auth = false;
nt_status = cli_start_connection(&cli, myname, server, NULL, port,
- Undefined, flags);
+ SMB_SIGNING_DEFAULT, flags);
if (!NT_STATUS_IS_OK(nt_status)) {
fprintf(stderr, "ERROR: Connection failed: %s\n", nt_errstr(nt_status));
return NULL;
return NULL;
}
- nt_status = cli_tcon_andx(cli, share, "?????", password,
- strlen(password) + 1);
+ nt_status = cli_tree_connect(cli, share, "?????", password,
+ strlen(password) + 1);
if (!NT_STATUS_IS_OK(nt_status)) {
fprintf(stderr, "ERROR: Tree connect failed (%s)\n",
nt_errstr(nt_status));