Changeset 3610 in MondoRescue for branches/3.2/mondo/src/common/libmondo-tools.c
- Timestamp:
- Nov 5, 2016, 6:12:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-tools.c
r3539 r3610 230 230 d = 5.2; // :-) 231 231 #else 232 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("uname -r"));232 tmp = call_program_and_get_last_line_of_output("uname -r"); 233 233 p = strchr(tmp, '.'); 234 234 if (p) { … … 452 452 if (getenv ("SUDO_COMMAND")) { 453 453 mr_asprintf(command, "strings `which growisofs` | grep -c SUDO_COMMAND"); 454 if (!strcmp(call_program_and_get_last_line_of_output(command), "1")) { 455 mr_free(command); 454 tmp = call_program_and_get_last_line_of_output(command); 455 mr_free(command); 456 if (!strcmp(tmp, "1")) { 457 mr_free(tmp); 456 458 popup_and_OK("Fatal Error: Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details."); 457 459 fatal_error("Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details."); 458 460 } 459 mr_free( command);461 mr_free(tmp); 460 462 } 461 463 log_msg(2, "call_make_iso (DVD res) is ... %s", bkpinfo->call_make_iso); … … 550 552 mr_asprintf(command, "df -P %s | tail -n1 | cut -d' ' -f1", bkpinfo->isodir); 551 553 log_it("command = %s", command); 552 mr_asprintf(iso_dev, "%s", call_program_and_get_last_line_of_output(command));554 iso_dev = call_program_and_get_last_line_of_output(command); 553 555 log_it("res of it = %s", iso_dev); 554 556 mr_asprintf(tmp, "%s/ISO-DEV", bkpinfo->tmpdir); … … 561 563 562 564 log_it("command = %s", command); 563 mr_asprintf(iso_mnt, "%s", call_program_and_get_last_line_of_output(command));565 iso_mnt = call_program_and_get_last_line_of_output(command); 564 566 log_it("res of it = %s", iso_mnt); 565 567 mr_asprintf(tmp, "%s/ISO-MNT", bkpinfo->tmpdir); … … 882 884 883 885 mr_asprintf(command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4", partition); 884 mr_asprintf(out_sz, "%s", call_program_and_get_last_line_of_output(command));886 out_sz = call_program_and_get_last_line_of_output(command); 885 887 mr_free(command); 886 888 … … 923 925 run_program_and_log_output("ln -sf `which mkfs.msdos` /sbin/mkfs.vfat", FALSE); 924 926 } 925 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2"));927 tmp = call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2"); 926 928 if (atol(tmp) < 35000) { 927 929 retval++; … … 986 988 } 987 989 run_program_and_log_output("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5); 988 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\""));990 tmp = call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\""); 989 991 if (strcmp("", tmp)) { 990 992 if (strstr(tmp, "autofs")) { … … 1050 1052 /*@ buffer ****************************************************** */ 1051 1053 char *command = NULL; 1054 char *tmp = NULL; 1052 1055 1053 1056 /*@ end vars *************************************************** */ … … 1064 1067 } else { 1065 1068 mr_asprintf(command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", label, config_file); 1066 strcpy(value, call_program_and_get_last_line_of_output(command)); 1069 tmp = call_program_and_get_last_line_of_output(command); 1070 strcpy(value, tmp); 1067 1071 mr_free(command); 1068 1072 … … 1193 1197 mr_asprintf(command, "%s", "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1194 1198 log_msg(4, "Cool. Command = '%s'", command); 1195 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));1199 tmp = call_program_and_get_last_line_of_output(command); 1196 1200 mr_free(command); 1197 1201 … … 1201 1205 mr_free(tmp); 1202 1206 1203 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));1207 tmp = call_program_and_get_last_line_of_output(command); 1204 1208 mr_free(command); 1205 1209 … … 1398 1402 void stop_magicdev_if_necessary() 1399 1403 { 1400 strcpy(g_magicdev_command, call_program_and_get_last_line_of_output("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99")); 1404 char *tmp = NULL; 1405 1406 tmp = call_program_and_get_last_line_of_output("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99"); 1407 strcpy(g_magicdev_command, tmp); 1401 1408 if (g_magicdev_command[0]) { 1402 1409 log_msg(1, "g_magicdev_command = '%s'", g_magicdev_command); 1403 1410 paranoid_system("killall magicdev"); 1404 1411 } 1412 mr_free(tmp); 1405 1413 } 1406 1414
Note:
See TracChangeset
for help on using the changeset viewer.