Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/selinux/setfiles.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/selinux/setfiles.c
r2725 r3232 4 4 Port to BusyBox (c) 2007 by Yuichi Nakamura <ynakam@hitachisoft.jp> 5 5 */ 6 7 //usage:#define setfiles_trivial_usage 8 //usage: "[-dnpqsvW] [-e DIR]... [-o FILE] [-r alt_root_path]" 9 //usage: IF_FEATURE_SETFILES_CHECK_OPTION( 10 //usage: " [-c policyfile] spec_file" 11 //usage: ) 12 //usage: " pathname" 13 //usage:#define setfiles_full_usage "\n\n" 14 //usage: "Reset file contexts under pathname according to spec_file\n" 15 //usage: IF_FEATURE_SETFILES_CHECK_OPTION( 16 //usage: "\n -c FILE Check the validity of the contexts against the specified binary policy" 17 //usage: ) 18 //usage: "\n -d Show which specification matched each file" 19 //usage: "\n -l Log changes in file labels to syslog" 20 //usage: "\n -n Don't change any file labels" 21 //usage: "\n -q Suppress warnings" 22 //usage: "\n -r DIR Use an alternate root path" 23 //usage: "\n -e DIR Exclude DIR" 24 //usage: "\n -F Force reset of context to match file_context for customizable files" 25 //usage: "\n -o FILE Save list of files with incorrect context" 26 //usage: "\n -s Take a list of files from stdin (instead of command line)" 27 //usage: "\n -v Show changes in file labels, if type or role are changing" 28 //usage: "\n -vv Show changes in file labels, if type, role, or user are changing" 29 //usage: "\n -W Display warnings about entries that had no matching files" 30 //usage: 31 //usage:#define restorecon_trivial_usage 32 //usage: "[-iFnRv] [-e EXCLUDEDIR]... [-o FILE] [-f FILE]" 33 //usage:#define restorecon_full_usage "\n\n" 34 //usage: "Reset security contexts of files in pathname\n" 35 //usage: "\n -i Ignore files that don't exist" 36 //usage: "\n -f FILE File with list of files to process" 37 //usage: "\n -e DIR Directory to exclude" 38 //usage: "\n -R,-r Recurse" 39 //usage: "\n -n Don't change any file labels" 40 //usage: "\n -o FILE Save list of files with incorrect context" 41 //usage: "\n -v Verbose" 42 //usage: "\n -vv Show changed labels" 43 //usage: "\n -F Force reset of context to match file_context" 44 //usage: "\n for customizable files, or the user section," 45 //usage: "\n if it has changed" 6 46 7 47 #include "libbb.h" … … 459 499 if (S_ISDIR(sb.st_mode) && recurse) { 460 500 if (recursive_action(name, 461 ACTION_RECURSE, 462 apply_spec, 463 apply_spec, 464 NULL, 0) != TRUE) { 501 ACTION_RECURSE, 502 apply_spec, 503 apply_spec, 504 NULL, 0) != TRUE 505 ) { 465 506 bb_error_msg("error while labeling %s", name); 466 507 goto err; … … 545 586 IF_FEATURE_SETFILES_CHECK_OPTION("c:"), 546 587 &exclude_dir, &input_filename, &rootpath, &out_filename, 547 588 IF_FEATURE_SETFILES_CHECK_OPTION(&policyfile,) 548 589 &verbose); 549 590 } … … 561 602 562 603 /* Only process the specified file_contexts file, not 563 564 604 * any .homedirs or .local files, and do not perform 605 * context translations. */ 565 606 set_matchpathcon_flags(MATCHPATHCON_BASEONLY | 566 607 MATCHPATHCON_NOTRANS | … … 592 633 if (applet_name[0] == 's') { /* setfiles */ 593 634 /* Use our own invalid context checking function so that 594 595 635 * we can support either checking against the active policy or 636 * checking against a binary policy file. */ 596 637 set_matchpathcon_canoncon(&canoncon); 597 638 if (!argv[0])
Note:
See TracChangeset
for help on using the changeset viewer.