Changeset 338 for branches/samba-3.3.x/source/client/mount.cifs.c
- Timestamp:
- Oct 8, 2009, 8:10:05 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/client/mount.cifs.c
r223 r338 200 200 FILE * fs; 201 201 int i, length; 202 203 i = access(file_name, R_OK); 204 if (i) 205 return i; 206 202 207 fs = fopen(file_name,"r"); 203 208 if(fs == NULL) … … 322 327 323 328 if(filename != NULL) { 329 rc = access(filename, R_OK); 330 if (rc) { 331 fprintf(stderr, "mount.cifs failed: access check of %s failed: %s\n", 332 filename, strerror(errno)); 333 exit(EX_SYSERR); 334 } 324 335 file_descript = open(filename, O_RDONLY); 325 336 if(file_descript < 0) { … … 380 391 return 1; 381 392 data = *optionsp; 382 383 if(verboseflag)384 printf("parsing options: %s\n", data);385 393 386 394 /* BB fixme check for separator override BB */ … … 472 480 if (!value || !*value) { 473 481 if(got_password) { 474 printf("\npassword specified twice, ignoring second\n");482 fprintf(stderr, "\npassword specified twice, ignoring second\n"); 475 483 } else 476 484 got_password = 1; 477 } else if (strnlen(value, 17) < 17) { 478 if(got_password) 479 printf("\nmount.cifs warning - password specified twice\n"); 480 got_password = 1; 485 } else if (strnlen(value, MOUNT_PASSWD_SIZE) < MOUNT_PASSWD_SIZE) { 486 if (got_password) { 487 fprintf(stderr, "\nmount.cifs warning - password specified twice\n"); 488 } else { 489 mountpassword = strndup(value, MOUNT_PASSWD_SIZE); 490 if (!mountpassword) { 491 fprintf(stderr, "mount.cifs error: %s", strerror(ENOMEM)); 492 SAFE_FREE(out); 493 return 1; 494 } 495 got_password = 1; 496 } 481 497 } else { 482 printf("password too long\n");498 fprintf(stderr, "password too long\n"); 483 499 SAFE_FREE(out); 484 500 return 1; 485 501 } 502 goto nocopy; 486 503 } else if (strncmp(data, "sec", 3) == 0) { 487 504 if (value) { … … 1371 1388 } 1372 1389 } 1373 if(mountpassword) {1374 /* Commas have to be doubled, or else they will1375 look like the parameter separator */1376 /* if(sep is not set)*/1377 if(retry == 0)1378 check_for_comma(&mountpassword);1379 strlcat(options,",pass=",options_size);1380 strlcat(options,mountpassword,options_size);1381 }1382 1390 1383 1391 strlcat(options,",ver=",options_size); … … 1392 1400 strlcat(options,prefixpath,options_size); /* no need to cat the / */ 1393 1401 } 1394 if(verboseflag)1395 printf("\nmount.cifs kernel mount options %s \n",options);1396 1402 1397 1403 /* convert all '\\' to '/' in share portion so that /proc/mounts looks pretty */ … … 1424 1430 } 1425 1431 } 1432 1433 if(verboseflag) 1434 fprintf(stderr, "\nmount.cifs kernel mount options: %s", options); 1435 1436 if (mountpassword) { 1437 /* 1438 * Commas have to be doubled, or else they will 1439 * look like the parameter separator 1440 */ 1441 if(retry == 0) 1442 check_for_comma(&mountpassword); 1443 strlcat(options,",pass=",options_size); 1444 strlcat(options,mountpassword,options_size); 1445 if (verboseflag) 1446 fprintf(stderr, ",pass=********"); 1447 } 1448 1449 if (verboseflag) 1450 fprintf(stderr, "\n"); 1426 1451 1427 1452 if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
Note:
See TracChangeset
for help on using the changeset viewer.