Ignore:
Timestamp:
Jul 22, 2009, 2:11:26 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Fix a printing error in mindi for the tar command
  • Fix all mr_asprintf which had no second param as a string

(report bug fix done originaly in 2.2.9)

File:
1 edited

Legend:

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

    r2273 r2291  
    364364
    365365    log_msg(5, "dsf: %s", dsf);
    366    
     366
    367367    /********
    368368    * See if a device special file was passed in (i.e. it must start with /dev/
     
    388388    }
    389389    log_msg(5, "  %s device special file exists", dsf);
    390    
     390
    391391    /* Get a list of the mounted file systems */
    392392    if (create_list_of_non_NFS_mounted_file_systems()) {
     
    400400    * Either way, it's an error.
    401401    ********/
    402     mr_asprintf(&command,
    403       "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf);
     402    mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf);
    404403    log_msg(4, "Executing: %s", command);
    405404    mr_asprintf(&partition_list, "%s", call_program_and_get_last_line_of_output(command));
     
    454453        log_msg(4, "Processing partition: %s", partitions[i]);
    455454        /* See if it's swap. If it is, ignore it. */
    456         mr_asprintf(&command,
    457           "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'",
     455        mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'",
    458456          dsf, partitions[i]);
    459457        log_msg(4, "  Running: %s", command);
     
    492490        if (strlen(tmp)) {
    493491            log_msg(4, "  Partition ID: %s", tmp);
    494             if (!strcasecmp(tmp, "8e")) { 
     492            if (!strcasecmp(tmp, "8e")) {
    495493                /* It's LVM: Find the VG it's in */
    496494                log_msg(4, "  It's LVM: Find the VG it's in...");
     
    503501                    /* Found the Volume Group. Now find all of the VG's mount points */
    504502                    log_msg(4, "  Found the Volume Group. Now find all of the VG's mount points");
    505                     mr_asprintf(&command,
    506                       "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'",
    507                       VG, VG);
     503                    mr_asprintf(&command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG);
    508504                    log_msg(4, "  Running: %s", command);
    509505                    mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command));
     
    527523                     *******/
    528524                    paranoid_free(mount_list);
    529                     mr_asprintf(&command, "%s",
    530                         "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
     525                    mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    531526                    log_msg (5, "Running: %s", command);
    532527                    mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command));
    533528                    paranoid_free(command);
    534                     log_msg(4, "  Software raid device list: %s", mount_list);   
     529                    log_msg(4, "  Software raid device list: %s", mount_list);
    535530                    lastpos = 0;
    536531                    while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) {
    537                         mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG); 
     532                        mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG);
    538533                        log_msg (5, "Running: %s", command);
    539534                        paranoid_free(tmp);
     
    581576        log_msg (5, "  UUID: %s", tmp);
    582577        /* Get the Software raid device list */
    583         mr_asprintf(&command, "%s",
    584          "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
     578        mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    585579        log_msg (5, "  Running: %s", command);
    586580        mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command));
    587581        paranoid_free(command);
    588         log_msg(4, "  Software raid device list: %s", mount_list);   
     582        log_msg(4, "  Software raid device list: %s", mount_list);
    589583        /* Loop through the software raid device list to see if we can find the partition */
    590584        lastpos = 0;
     
    770764            strcat(bkpinfo->include_paths, " ");
    771765        }
    772        
     766
    773767        mr_asprintf(&tmp1, "%s", flag_val['I']);
    774768        p = tmp1;
     
    15341528            if (flag_set[opt]) {
    15351529                bad_switches = TRUE;
    1536                 mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt,
    1537                         flag_val[opt]);
     1530                mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt, flag_val[opt]);
    15381531                log_to_screen(tmp);
    15391532                paranoid_free(tmp);
     
    15511544                        if (strchr(flag_val[opt], '/')
    15521545                            && flag_val[opt][0] != '/') {
    1553                             mr_asprintf(&tmp,
    1554                                     "-%c flag --- must be absolute path --- '%s' isn't absolute",
    1555                                     opt, flag_val[opt]);
     1546                            mr_asprintf(&tmp, "-%c flag --- must be absolute path --- '%s' isn't absolute", opt, flag_val[opt]);
    15561547                            log_to_screen(tmp);
    15571548                            paranoid_free(tmp);
     
    16241615    case SIGABRT:
    16251616        mr_asprintf(&tmp, "SIGABRT");
    1626         mr_asprintf(&tmp2,
    1627                 "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.");
     1617        mr_asprintf(&tmp2, "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.");
    16281618        break;
    16291619    default:
Note: See TracChangeset for help on using the changeset viewer.