Changeset 233 for branches/samba-3.2.x/source/client/mount.cifs.c
- Timestamp:
- May 27, 2009, 11:39:15 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/client/mount.cifs.c
r232 r233 86 86 const char *thisprogram; 87 87 int verboseflag = 0; 88 int fakemnt = 0; 88 89 static int got_password = 0; 89 90 static int got_user = 0; … … 485 486 } else if (strncmp(data, "sec", 3) == 0) { 486 487 if (value) { 487 if (!strcmp(value, "none")) 488 if (!strncmp(value, "none", 4) || 489 !strncmp(value, "krb5", 4)) 488 490 got_password = 1; 489 491 } … … 533 535 return 1; 534 536 } 535 } else if ((strncmp(data, "domain", 3) == 0) 536 || (strncmp(data, "workgroup", 5) == 0)) { 537 } else if ((strncmp(data, "dom" /* domain */, 3) == 0) 538 || (strncmp(data, "workg", 5) == 0)) { 539 /* note this allows for synonyms of "domain" 540 such as "DOM" and "dom" and "workgroup" 541 and "WORKGRP" etc. */ 537 542 if (!value || !*value) { 538 543 printf("CIFS: invalid domain name\n"); … … 646 651 *filesys_flags &= ~MS_NOEXEC; 647 652 } else if (strncmp(data, "guest", 5) == 0) { 648 got_password=1; 653 user_name = (char *)calloc(1, 1); 654 got_user = 1; 655 got_password = 1; 649 656 } else if (strncmp(data, "ro", 2) == 0) { 650 657 *filesys_flags |= MS_RDONLY; … … 1027 1034 char * temp; 1028 1035 char * dev_name; 1029 int rc ;1036 int rc = 0; 1030 1037 int rsize = 0; 1031 1038 int wsize = 0; … … 1075 1082 mountpoint = argv[2]; 1076 1083 } else { 1084 if ((strcmp (argv[1], "--version") == 0) || 1085 ((strcmp (argv[1], "-V") == 0))) { 1086 printf ("mount.cifs version: %s.%s%s\n", 1087 MOUNT_CIFS_VERSION_MAJOR, 1088 MOUNT_CIFS_VERSION_MINOR, 1089 MOUNT_CIFS_VENDOR_SUFFIX); 1090 exit (0); 1091 } 1077 1092 mount_cifs_usage(); 1078 1093 exit(EX_USAGE); … … 1100 1115 exit(EX_USAGE); 1101 1116 case 'n': 1102 1103 1117 ++nomtab; 1118 break; 1104 1119 case 'b': 1105 1120 #ifdef MS_BIND … … 1205 1220 break; 1206 1221 case 't': 1222 break; 1223 case 'f': 1224 ++fakemnt; 1207 1225 break; 1208 1226 default: … … 1283 1301 1284 1302 if(got_user == 0) { 1285 user_name = getusername(); 1303 /* Note that the password will not be retrieved from the 1304 USER env variable (ie user%password form) as there is 1305 already a PASSWD environment varaible */ 1306 if (getenv("USER")) 1307 user_name = strdup(getenv("USER")); 1308 if (user_name == NULL) 1309 user_name = getusername(); 1286 1310 got_user = 1; 1287 1311 } … … 1401 1425 } 1402 1426 1403 if ( mount(dev_name, mountpoint, "cifs", flags, options)) {1427 if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) { 1404 1428 switch (errno) { 1405 1429 case ECONNREFUSED: … … 1431 1455 } 1432 1456 1457 if (nomtab) 1458 goto mount_exit; 1433 1459 atexit(unlock_mtab); 1434 1460 rc = lock_mtab();
Note:
See TracChangeset
for help on using the changeset viewer.