#include "trans2.h"
#include "libsmb/nmblib.h"
#include "include/ntioctl.h"
+#include "../libcli/smb/smbXcli_base.h"
#ifndef REGISTER
#define REGISTER 0
/* Use a trans2_qpathinfo to test directories for modern servers.
Except Win9x doesn't support the qpathinfo_basic() call..... */
- if (cli_state_protocol(targetcli) > PROTOCOL_LANMAN2 && !targetcli->win95) {
+ if (smbXcli_conn_protocol(targetcli->conn) > PROTOCOL_LANMAN2 && !targetcli->win95) {
status = cli_qpathinfo_basic(targetcli, targetpath, &sbuf,
&attributes);
}
if (lowercase) {
- strlower_m(lname);
+ if (!strlower_m(lname)) {
+ d_printf("strlower_m %s failed\n", lname);
+ return 1;
+ }
}
status = cli_resolve_path(ctx, "", auth_info, cli, rname, &targetcli,
string_replace(finfo->name,'\\','/');
if (lowercase) {
- strlower_m(finfo->name);
+ if (!strlower_m(finfo->name)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
}
if (!directory_exist(finfo->name) &&
goto fail;
}
status = cli_ntcreate(
- cli, name, 0, READ_CONTROL_ACCESS, 0,
+ cli, name, 0, FILE_READ_DATA, 0,
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
FILE_OPEN, 0, 0, &fnum);
if (!NT_STATUS_IS_OK(status)) {
return 1;
}
- d_printf("//%s/%s\n", cli_state_remote_name(targetcli), targetcli->share);
+ d_printf("//%s/%s\n", smbXcli_conn_remote_name(targetcli->conn), targetcli->share);
return 0;
}
}
if ( override_logfile )
- setup_logging( lp_logfile(), DEBUG_FILE );
+ setup_logging( lp_logfile(talloc_tos()), DEBUG_FILE );
if (!lp_load_client(get_dyn_CONFIGFILE())) {
fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n",
}
if(new_name_resolve_order)
- lp_set_name_resolve_order(new_name_resolve_order);
+ lp_set_cmdline("name resolve order", new_name_resolve_order);
if (!tar_type && !query_host && !service && !message) {
poptPrintUsage(pc, stderr, 0);
if (tar_type) {
if (cmdstr)
process_command_string(cmdstr);
- return do_tar_op(base_directory);
- }
-
- if (query_host && *query_host) {
+ rc = do_tar_op(base_directory);
+ } else if (query_host && *query_host) {
char *qhost = query_host;
char *slash;
sscanf(p, "%x", &name_type);
}
- return do_host_query(qhost);
- }
-
- if (message) {
- return do_message_op(auth_info);
- }
-
- if (process(base_directory)) {
- return 1;
+ rc = do_host_query(qhost);
+ } else if (message) {
+ rc = do_message_op(auth_info);
+ } else if (process(base_directory)) {
+ rc = 1;
}
TALLOC_FREE(frame);