Changeset 2700 in MondoRescue
- Timestamp:
- Jan 27, 2011, 7:31:06 PM (14 years ago)
- Location:
- branches/2.2.9
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi/analyze-my-lvm
r2684 r2700 142 142 list_of_devices="" 143 143 for i in $physical_volumes ; do 144 145 146 144 fname=/proc/lvm/VGs/$current_VG/PVs/$i 145 device=`GetValueFromField $fname "name:"` 146 list_of_devices="$list_of_devices $device" 147 147 done 148 148 current_PVs=$list_of_devices -
branches/2.2.9/mindi/mindi-bkphw
r2695 r2700 54 54 chomp($tool); 55 55 $tooldir = dirname($tool); 56 if (! (- e$tool)) {56 if (! (-x $tool)) { 57 57 print "You should install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced hardware support\n"; 58 58 print "Get it from http://www.hp.com/servers/sstoolkit\n"; … … 73 73 print TOOLS "$tooldir/bld\n"; 74 74 } 75 if ($tool =~ /\/ .hpacucli$/) {75 if ($tool =~ /\/hpacucli$/) { 76 76 my $dir=basename($tool); 77 77 $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/hpacucli.dat"); -
branches/2.2.9/mondo/src/common/libmondo-fork.c
r2656 r2700 379 379 380 380 /*@ buffers **************************************************** */ 381 char tmp[MAX_STR_LEN * 2];382 char command[MAX_STR_LEN * 2];381 char *tmp = NULL; 382 char *command = NULL; 383 383 char lockfile[MAX_STR_LEN]; 384 384 … … 389 389 sprintf(lockfile, "%s/mojo-jojo.bla.bla", bkpinfo->tmpdir); 390 390 391 sprintf(command,391 mr_asprintf(&command, 392 392 "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res", 393 393 lockfile, basic_call, MONDO_LOGFILE, MONDO_LOGFILE, lockfile); 394 394 open_evalcall_form(what_i_am_doing); 395 sprintf(tmp, "Executing %s", basic_call);395 mr_asprintf(&tmp, "Executing %s", basic_call); 396 396 log_msg(2, tmp); 397 mr_free(tmp); 398 397 399 if (!(fin = popen(command, "r"))) { 398 400 log_OS_error("Unable to popen-in command"); 399 sprintf(tmp, "Failed utterly to call '%s'", command);401 mr_asprintf(&tmp, "Failed utterly to call '%s'", command); 400 402 log_to_screen(tmp); 403 mr_free(tmp); 404 mr_free(command); 401 405 return (1); 402 406 } … … 407 411 } 408 412 } 413 mr_free(command); 409 414 #ifdef _XWIN 410 415 /* This only can update when newline goes into the file, … … 412 417 while (does_file_exist(lockfile)) { 413 418 while (!feof(fin)) { 419 /* TODO: Dead and wrong code */ 414 420 if (!fgets(tmp, 512, fin)) 415 421 break; -
branches/2.2.9/mondo/src/common/newt-specific.c
r2697 r2700 471 471 472 472 /*@ buffers ********************************************************** */ 473 char *command ;474 char *tmp ;473 char *command = NULL; 474 char *tmp = NULL; 475 475 476 476 /*@ pointers ********************************************************* */ … … 480 480 int i = 0; 481 481 482 malloc_string(command);483 malloc_string(tmp);484 482 assert_string_is_neither_NULL_nor_zerolength(filename); 485 483 assert(grep_for_me != NULL); 486 484 487 485 if (!does_file_exist(filename)) { 488 paranoid_free(command);489 paranoid_free(tmp);490 486 return; 491 487 } 492 488 if (grep_for_me[0] != '\0') { 493 sprintf(command, "grep '%s' %s | tail -n%d",489 mr_asprintf(&command, "grep '%s' %s | tail -n%d", 494 490 grep_for_me, filename, g_noof_log_lines); 495 491 } else { 496 sprintf(command, "tail -n%d %s", g_noof_log_lines,492 mr_asprintf(&command, "tail -n%d %s", g_noof_log_lines, 497 493 filename); 498 494 } … … 510 506 */ 511 507 if (!strncmp(err_log_lines[i], "root:", 5)) { 512 strcpy(tmp, err_log_lines[i] + 6); 513 strcpy(err_log_lines[i], tmp); 508 mr_asprintf(&tmp, "%s", err_log_lines[i] + 6); 509 strncpy(err_log_lines[i], tmp, (size_t)MAX_NEWT_COMMENT_LEN); 510 mr_free(tmp); 514 511 } 515 512 if (feof(fin)) { … … 520 517 paranoid_pclose(fin); 521 518 } 519 mr_free(command); 522 520 refresh_log_screen(); 523 paranoid_free(command);524 paranoid_free(tmp);525 521 } 526 522 … … 545 541 546 542 va_start(args, fmt); 547 vs printf(output, fmt, args);543 vsnprintf(output, MAX_STR_LEN-1, fmt, args); 548 544 log_msg(0, output); 549 545 output[80] = '\0';
Note:
See TracChangeset
for help on using the changeset viewer.