Author: jra Date: 2006-03-13 00:00:46 +0000 (Mon, 13 Mar 2006) New Revision: 14258
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14258 Log: This file is very out-of-sync with 3.0. Steve, looks like the SAMBA_3_0 branch is more current. Please keep these up to date. Jeremy. Modified: trunk/source/client/mount.cifs.c Changeset: Modified: trunk/source/client/mount.cifs.c =================================================================== --- trunk/source/client/mount.cifs.c 2006-03-12 23:09:31 UTC (rev 14257) +++ trunk/source/client/mount.cifs.c 2006-03-13 00:00:46 UTC (rev 14258) @@ -756,7 +756,7 @@ if(length < 3) { /* BB add code to find DFS root here */ - printf("\nMounting the DFS root for domain not implemented yet"); + printf("\nMounting the DFS root for domain not implemented yet\n"); return NULL; } else { if(strncmp(unc_name,"//",2) && strncmp(unc_name,"\\\\",2)) { @@ -863,7 +863,7 @@ char * share_name = NULL; char * ipaddr = NULL; char * uuid = NULL; - char * mountpoint; + char * mountpoint = NULL; char * options; char * resolved_path; char * temp; @@ -887,7 +887,11 @@ if(argc && argv) { thisprogram = argv[0]; + } else { + mount_cifs_usage(); + exit(1); } + if(thisprogram == NULL) thisprogram = "mount.cifs"; @@ -897,10 +901,11 @@ /* #ifdef _GNU_SOURCE printf(" node: %s machine: %s sysname %s domain %s\n", sysinfo.nodename,sysinfo.machine,sysinfo.sysname,sysinfo.domainname); #endif */ + if(argc > 2) { + share_name = argv[1]; + mountpoint = argv[2]; + } - share_name = argv[1]; - mountpoint = argv[2]; - /* add sharename in opts string as unc= parm */ while ((c = getopt_long (argc, argv, "afFhilL:no:O:rsSU:vVwt:", @@ -1028,8 +1033,10 @@ } } - if(argc < 3) + if((argc < 3) || (share_name == NULL) || (mountpoint == NULL)) { mount_cifs_usage(); + exit(1); + } if (getenv("PASSWD")) { if(mountpassword == NULL) @@ -1110,6 +1117,8 @@ optlen += strlen(share_name) + 4; else { printf("No server share name specified\n"); + printf("\nMounting the DFS root for server not implemented yet\n"); + exit(1); } if(user_name) optlen += strlen(user_name) + 6;