Changeset 2331 in MondoRescue for branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Aug 18, 2009, 3:25:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
r2329 r2331 390 390 mr_strcat(additional_parameters, "-o ro"); 391 391 } 392 if (find_home_of_exe("setfattr")) { 392 tmp = find_home_of_exe("setfattr"); 393 if (tmp) { 393 394 mr_strcat(additional_parameters, ",user_xattr"); 394 395 } 395 if (find_home_of_exe("setfacl")) { 396 mr_free(tmp); 397 398 tmp = find_home_of_exe("setfacl"); 399 if (tmp) { 396 400 mr_strcat(additional_parameters, ",acl"); 397 401 } 402 mr_free(tmp); 398 403 } 399 404 … … 870 875 mr_asprintf(g_getfacl,"setfacl"); 871 876 log_msg(1, "We will restore ACLs"); 872 if (! find_home_of_exe("setfacl")) { 877 tmp = find_home_of_exe("setfacl"); 878 if (!tmp) { 873 879 log_msg(1, "Unable to restore ACLs as no setfacl found"); 874 880 } 881 mr_free(tmp); 875 882 } 876 883 mr_free(value); … … 880 887 mr_asprintf(g_getfattr,"setfattr"); 881 888 log_msg(1, "We will restore XATTRs"); 882 if (! find_home_of_exe("setfattr")) { 889 tmp = find_home_of_exe("setfattr"); 890 if (!tmp) { 883 891 log_msg(1, "Unable to restore XATTRs as no setfattr found"); 884 892 } 893 mr_free(tmp); 885 894 } 886 895 mr_free(value); … … 1437 1446 * @note The returned string points to static storage that will be overwritten with each call. 1438 1447 */ 1439 char *find_my_editor(void) 1440 { 1448 char *find_my_editor(void) { 1449 1450 char *tmp = NULL; 1441 1451 static char output[MAX_STR_LEN]; 1442 if (find_home_of_exe("pico")) { 1452 1453 tmp = find_home_of_exe("pico"); 1454 if (tmp) { 1443 1455 strcpy(output, "pico"); 1444 } else if (find_home_of_exe("nano")) { 1445 strcpy(output, "nano"); 1446 } else if (find_home_of_exe("e3em")) { 1447 strcpy(output, "e3em"); 1448 } else if (find_home_of_exe("e3vi")) { 1449 strcpy(output, "e3vi"); 1450 } else { 1451 strcpy(output, "vi"); 1452 } 1453 if (!find_home_of_exe(output)) { 1456 } else { 1457 mr_free(tmp); 1458 tmp = find_home_of_exe("nano"); 1459 if (tmp) { 1460 strcpy(output, "nano"); 1461 } else { 1462 mr_free(tmp); 1463 tmp = find_home_of_exe("joe"); 1464 if (tmp) { 1465 strcpy(output, "joe"); 1466 } else { 1467 strcpy(output, "vi"); 1468 } 1469 } 1470 } 1471 mr_free(tmp); 1472 1473 tmp = find_home_of_exe(output); 1474 if (!tmp) { 1454 1475 log_msg(2, " (find_my_editor) --- warning - %s not found", output); 1455 1476 } 1477 mr_free(tmp); 1456 1478 return (output); 1457 1479 }
Note:
See TracChangeset
for help on using the changeset viewer.