Ignore:
Timestamp:
May 27, 2009, 11:39:15 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/client/mount.cifs.c

    r232 r233  
    8686const char *thisprogram;
    8787int verboseflag = 0;
     88int fakemnt = 0;
    8889static int got_password = 0;
    8990static int got_user = 0;
     
    485486                } else if (strncmp(data, "sec", 3) == 0) {
    486487                        if (value) {
    487                                 if (!strcmp(value, "none"))
     488                                if (!strncmp(value, "none", 4) ||
     489                                    !strncmp(value, "krb5", 4))
    488490                                        got_password = 1;
    489491                        }
     
    533535                                return 1;
    534536                        }
    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. */
    537542                        if (!value || !*value) {
    538543                                printf("CIFS: invalid domain name\n");
     
    646651                        *filesys_flags &= ~MS_NOEXEC;
    647652                } 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;
    649656                } else if (strncmp(data, "ro", 2) == 0) {
    650657                        *filesys_flags |= MS_RDONLY;
     
    10271034        char * temp;
    10281035        char * dev_name;
    1029         int rc;
     1036        int rc = 0;
    10301037        int rsize = 0;
    10311038        int wsize = 0;
     
    10751082                mountpoint = argv[2];
    10761083        } 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                }
    10771092                mount_cifs_usage();
    10781093                exit(EX_USAGE);
     
    11001115                        exit(EX_USAGE);
    11011116                case 'n':
    1102                     ++nomtab;
    1103                     break;
     1117                        ++nomtab;
     1118                        break;
    11041119                case 'b':
    11051120#ifdef MS_BIND
     
    12051220                        break;
    12061221                case 't':
     1222                        break;
     1223                case 'f':
     1224                        ++fakemnt;
    12071225                        break;
    12081226                default:
     
    12831301
    12841302        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();
    12861310                got_user = 1;
    12871311        }
     
    14011425        }
    14021426
    1403         if (mount(dev_name, mountpoint, "cifs", flags, options)) {
     1427        if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
    14041428                switch (errno) {
    14051429                case ECONNREFUSED:
     
    14311455        }
    14321456
     1457        if (nomtab)
     1458                goto mount_exit;
    14331459        atexit(unlock_mtab);
    14341460        rc = lock_mtab();
Note: See TracChangeset for help on using the changeset viewer.