Changeset 2319


Ignore:
Timestamp:
Aug 18, 2009, 2:37:25 PM (10 years ago)
Author:
bruno
Message:

r3330@localhost: bruno | 2009-08-05 00:48:36 +0200
bkpinfo->include_paths is now dynamically allocated

Location:
branches/2.2.10/mondo/src/common
Files:
4 edited

Legend:

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

    r2318 r2319  
    759759        if (!strcmp(bkpinfo->include_paths, "/")) {
    760760            log_msg(2, "'/' is pleonastic.");
    761             bkpinfo->include_paths[0] = '\0';
    762         }
    763         if (bkpinfo->include_paths[0]) {
    764             strcat(bkpinfo->include_paths, " ");
    765761        }
    766762
     
    801797                log_to_screen("Archiving only the following file systems on %s:\n", token);
    802798                log_to_screen("  %s\n", mounted_on_dsf);
    803                 strcpy(bkpinfo->include_paths, "/");
     799                mr_asprintf(&p, "/");
     800                bkpinfo->include_paths = p;
    804801                if (strlen(not_mounted_on_dsf)) {
    805802                    log_msg (5, "Adding to bkpinfo->exclude_paths due to -I option: %s", not_mounted_on_dsf);
     
    811808            /* A device special file was not passed in. Process it as a path. */
    812809            case -1:
    813                     strcat(bkpinfo->include_paths, token);
    814                     strcat(bkpinfo->include_paths, " ");
     810                mr_strcat(bkpinfo->include_paths, " %s ", token);
    815811                break;
    816812            }
    817813            mr_free(token);
    818814        }
    819         log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
     815        if (bkpinfo->include_paths != NULL) {
     816            log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
     817        }
    820818        if (bkpinfo->exclude_paths != NULL) {
    821819            log_msg(1, "exclude_paths is now '%s'", bkpinfo->exclude_paths);
     
    838836        }
    839837        bkpinfo->make_filelist = FALSE;
    840         strcpy(bkpinfo->include_paths, flag_val['J']);
     838        mr_asprintf(&p, "%s", flag_val['J']);
     839        bkpinfo->include_paths = p;
    841840    }
    842841
  • branches/2.2.10/mondo/src/common/libmondo-devices.c

    r2318 r2319  
    19271927        }
    19281928        bkpinfo->boot_loader = i;
    1929         strcpy(bkpinfo->include_paths, "/");
     1929        mr_free(bkpinfo->include_paths);
     1930        mr_asprintf(&p, "/");
     1931        bkpinfo->include_paths = p;
     1932
    19301933        p = popup_and_get_string("Backup paths", "Please enter paths which you want me to backup. The default is '/' (i.e. everything).", bkpinfo->include_paths);
    19311934        if (p == NULL) {
     
    19331936            finish(1);
    19341937        }
    1935         strcpy(bkpinfo->include_paths, p);
    1936         mr_free(p);
     1938        mr_free(bkpinfo->include_paths);
     1939        bkpinfo->include_paths = p;
    19371940
    19381941        mr_asprintf(&tmp, "%s", list_of_NFS_mounts_only());
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2318 r2319  
    417417    char *cdr_exe;
    418418    char *tmp = NULL;
     419    char *p = NULL;
    419420    char call_before_iso_user[MAX_STR_LEN] = "\0";
    420421    /*
     
    683684        retval++;
    684685    }
    685     if (bkpinfo->include_paths[0] == '\0') {
    686         //      fatal_error ("Why no backup path?");
    687         strcpy(bkpinfo->include_paths, "/");
     686    if (bkpinfo->include_paths == NULL) {
     687        mr_asprintf(&p, "/");
     688        bkpinfo->include_paths = p;
    688689    }
    689690    chmod(bkpinfo->scratchdir, 0700);
     
    811812
    812813    bkpinfo->optimal_set_size = 0;
    813     strcpy(bkpinfo->include_paths, "/");
    814814    bkpinfo->make_filelist = TRUE;  // unless -J supplied to mondoarchive
    815     bkpinfo->include_paths[0] = '\0';
    816815    bkpinfo->restore_path[0] = '\0';
    817816    bkpinfo->call_before_iso[0] = '\0';
     
    823822    bkpinfo->nfs_user = NULL;
    824823    bkpinfo->exclude_paths = NULL;
     824    bkpinfo->include_paths = NULL;
    825825    bkpinfo->nfs_remote_dir[0] = '\0';
    826826    bkpinfo->postnuke_tarball[0] = '\0';
  • branches/2.2.10/mondo/src/common/newt-specific.c

    r2318 r2319  
    442442        mr_free(bkpinfo->nfs_user);
    443443        mr_free(bkpinfo->exclude_paths);
     444        mr_free(bkpinfo->include_paths);
    444445
    445446        /* Then free the structure */
Note: See TracChangeset for help on using the changeset viewer.