Changeset 2426


Ignore:
Timestamp:
Sep 25, 2009, 7:42:09 PM (10 years ago)
Author:
bruno
Message:
  • Attempt to stay backward compatible without protocol for -n option
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-cli.c

    r2424 r2426  
    482482        }
    483483        /* test for protocol */
    484         p = strchr(bkpinfo->netfs_mount, ':');
     484        p = strstr(bkpinfo->netfs_mount, "://");
    485485        if (p == NULL) {
    486             /* protocol not found abort */
    487             fatal_error("No protocol specified for remote share mount. Please do man mondoarchive as syntax changed");
     486            /* protocol not found assuming NFS for compatibility */
     487            mr_asprintf(&q,"nfs");
     488
     489            p = strchr(bkpinfo->netfs_mount, ':');
     490            if (p == NULL) {
     491                fatal_error("No protocol specified for remote share mount, nor any old NFS syntax found.\nPlease do man mondoarchive as syntax changed");
     492            }
     493            /* p points on to the string server:/path */
     494            p = bkpinfo->netfs_mount;
     495
    488496        } else {
    489             /* Proto found. Store the 2 values */
    490             p++;
    491             if (*p != '/') {
    492                 fatal_error("No protocol correctly specified for remote share mount. Use protocol://server:share");
    493             }
    494             p++;
    495             if (*p != '/') {
    496                 fatal_error("No protocol correctly specified for remote share mount. Use protocol://server:share");
    497             }
    498             p++;
    499             /* p points on to the string server:/path */
    500             strcpy(tmp,p);
    501 
    502             /* going back to protocol */
    503             p--;
    504             p--;
    505             p--;
     497            /* Isolate the protocol */
    506498            *p = '\0';
    507499            mr_asprintf(&q,"%s",bkpinfo->netfs_mount);
    508             bkpinfo->netfs_proto = q;
    509             strcpy(bkpinfo->netfs_mount,tmp);
    510         }
     500
     501            /* Skip proto now */
     502            p++;
     503            p++;
     504            p++;
     505        }
     506        /* whatever done before proto is pointed to by q */
     507        bkpinfo->netfs_proto = q;
     508
     509        /* p points on to the string server:/path */
     510        /* Store the 2 values */
     511        strcpy(bkpinfo->netfs_mount,p);
     512
    511513        /* test if we specified a user */
    512514        p = strchr(bkpinfo->netfs_mount, '@');
Note: See TracChangeset for help on using the changeset viewer.