X-Git-Url: http://git.samba.org/samba.git/?p=tprouty%2Fsamba.git;a=blobdiff_plain;f=source%2Fclient%2Fsmbmount.c;h=b68dbfe346299365c0541f4f8432587e90bbc528;hp=7a3ccb7630dee184894a1f848aaf66945b356047;hb=b0132e94fc5fef936aa766fb99a306b3628e9f07;hpb=62b02a68438e0ff1119e68347b1ac3495572fa8a diff --git a/source/client/smbmount.c b/source/client/smbmount.c index 7a3ccb7630..b68dbfe346 100644 --- a/source/client/smbmount.c +++ b/source/client/smbmount.c @@ -5,7 +5,7 @@ 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 - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" @@ -26,6 +25,8 @@ extern BOOL in_client; extern pstring user_socket_options; +extern char *optarg; +extern int optind; static pstring credentials; static pstring my_netbios_name; @@ -149,8 +150,8 @@ static struct cli_state *do_connection(char *the_service) if (have_ip) ip = dest_ip; /* have to open a new connection */ - if (!(c=cli_initialise(NULL)) || (cli_set_port(c, smb_port) != smb_port) || - !cli_connect(c, server_n, &ip)) { + if (!(c=cli_initialise()) || (cli_set_port(c, smb_port) != smb_port) || + !NT_STATUS_IS_OK(cli_connect(c, server_n, &ip))) { DEBUG(0,("%d: Connection to %s failed\n", sys_getpid(), server_n)); if (c) { cli_shutdown(c); @@ -211,14 +212,14 @@ static struct cli_state *do_connection(char *the_service) c->force_dos_errors = True; } - if (!cli_session_setup(c, username, - password, strlen(password), - password, strlen(password), - workgroup)) { + if (!NT_STATUS_IS_OK(cli_session_setup(c, username, + password, strlen(password), + password, strlen(password), + workgroup))) { /* if a password was not supplied then try again with a null username */ if (password[0] || !username[0] || - !cli_session_setup(c, "", "", 0, "", 0, workgroup)) { + !NT_STATUS_IS_OK(cli_session_setup(c, "", "", 0, "", 0, workgroup))) { DEBUG(0,("%d: session setup failed: %s\n", sys_getpid(), cli_errstr(c))); cli_shutdown(c); @@ -667,6 +668,9 @@ static void usage(void) printf("Version %s\n\n",SAMBA_VERSION_STRING); + printf("Please be aware that smbfs is deprecated in favor of " + "cifs\n\n"); + printf( "Options:\n\ username= SMB username\n\ @@ -712,7 +716,6 @@ static void parse_mount_smb(int argc, char **argv) int opt; char *opts; char *opteq; - extern char *optarg; int val; char *p; @@ -862,8 +865,6 @@ static void parse_mount_smb(int argc, char **argv) ****************************************************************************/ int main(int argc,char *argv[]) { - extern char *optarg; - extern int optind; char *p; DEBUGLEVEL = 1;