Unix SMB/Netbios implementation.
Version 1.9.
SMB client
- Copyright (C) Andrew Tridgell 1994-1997
+ Copyright (C) Andrew Tridgell 1994-1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern pstring workgroup;
char *cmdstr="";
extern BOOL got_pass;
+extern BOOL no_pass;
extern BOOL connect_as_printer;
extern BOOL connect_as_ipc;
extern struct in_addr ipzero;
#define USENMB
-static BOOL setup_term_code(char *code)
-{
- interpret_coding_system(code);
- return True;
-}
-#define CNV_LANG(s) dos2unix_format(s,False)
-#define CNV_INPUT(s) unix2dos_format(s,True)
+#define CNV_LANG(s) dos_to_unix(s,False)
+#define CNV_INPUT(s) unix_to_dos(s,True)
/****************************************************************************
send an SMBclose on an SMB file handle
p = skip_string(p,1);
DEBUG(1,("Calling DosPrintJobEnum()...\n"));
- if( cli_call_api(PIPE_LANMAN, 0,PTR_DIFF(p,param), 0,
- 10, 0, 4096,
+ if( cli_call_api(PIPE_LANMAN, 0,PTR_DIFF(p,param), 0, 0,
+ 10, 4096,
&rprcnt, &rdrcnt,
param, NULL, NULL,
&rparam, &rdata) )
DEBUG(0,("\t-m max protocol set the max protocol level\n"));
DEBUG(0,("\t-L host get a list of shares available on a host\n"));
DEBUG(0,("\t-I dest IP use this IP to connect to\n"));
+ DEBUG(0,("\t-R name resolve order use these name resolution services only\n"));
DEBUG(0,("\t-E write messages to stderr instead of stdout\n"));
DEBUG(0,("\t-U username set the network username\n"));
DEBUG(0,("\t-W workgroup set the workgroup name\n"));
extern char tar_type;
static pstring servicesf = CONFIGFILE;
pstring term_code;
+ pstring new_name_resolve_order;
char *p;
#ifdef KANJI
*query_host = 0;
*base_directory = 0;
+ *new_name_resolve_order = 0;
+
DEBUGLEVEL = 2;
setup_logging(pname,True);
}
while ((opt =
- getopt(argc, argv,"s:B:O:M:S:i:Nn:d:Pp:l:hI:EB:U:L:t:m:W:T:D:c:")) != EOF)
+ getopt(argc, argv,"s:B:O:R:M:S:i:Nn:d:Pp:l:hI:EB:U:L:t:m:W:T:D:c:")) != EOF)
switch (opt)
{
case 'm':
case 'O':
strcpy(user_socket_options,optarg);
break;
+ case 'R':
+ pstrcpy(new_name_resolve_order, optarg);
+ break;
case 'S':
strcpy(desthost,optarg);
strupper(desthost);
break;
case 'N':
got_pass = True;
+ no_pass = True;
break;
case 'P':
connect_as_printer = True;
DEBUG(0,("Failed to get my hostname.\n"));
}
- if (!lp_load(servicesf,True)) {
+ if (!lp_load(servicesf,True,False,False)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
}
codepage_initialise(lp_client_code_page());
- if(lp_client_code_page() == KANJI_CODEPAGE)
- {
- if (!setup_term_code (term_code))
- {
- DEBUG(0, ("%s: unknown terminal code name\n", optarg));
- usage (pname);
- exit (1);
- }
- }
+ interpret_coding_system(term_code);
if (*workgroup == 0)
strcpy(workgroup,lp_workgroup());
get_myname((*myname)?NULL:myname,NULL);
strupper(myname);
+ if(*new_name_resolve_order)
+ lp_set_name_resolve_order(new_name_resolve_order);
+
if (tar_type) {
recurse=True;
return(ret);
}
-#ifdef NTDOMAIN
-
- if (nt_domain_logon)
- {
- int ret = 0;
- sprintf(service,"\\\\%s\\IPC$",query_host);
- strupper(service);
- connect_as_ipc = True;
-
- DEBUG(5,("NT Domain Logon. Service: %s\n", service));
-
- if (cli_open_sockets(port))
- {
- if (!cli_send_login(NULL,NULL,True,True,NULL)) return(1);
-
- do_nt_login(desthost, myhostname, Client, cnum);
-
- cli_send_logout();
- close_sockets();
- }
-
- return(ret);
- }
-#endif
-
if (cli_open_sockets(port))
{
if (!process(base_directory))