aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cp.c2
-rw-r--r--coreutils/id.c38
-rw-r--r--coreutils/install.c4
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/mv.c2
-rw-r--r--coreutils/stat.c4
6 files changed, 26 insertions, 26 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index 64cf63797..a80e0d286 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -51,7 +51,7 @@ int cp_main(int argc, char **argv)
51 if (flags & OPT_H) ... // deref command-line params only 51 if (flags & OPT_H) ... // deref command-line params only
52 */ 52 */
53 53
54#if ENABLE_SELINUX 54#if ENABLE_SELINUX
55 if (flags & FILEUTILS_PRESERVE_SECURITY_CONTEXT) { 55 if (flags & FILEUTILS_PRESERVE_SECURITY_CONTEXT) {
56 selinux_or_die(); 56 selinux_or_die();
57 } 57 }
diff --git a/coreutils/id.c b/coreutils/id.c
index e183402fa..8a604195d 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -48,7 +48,7 @@ int id_main(int argc, char **argv)
48 unsigned long flags; 48 unsigned long flags;
49 short status; 49 short status;
50#if ENABLE_SELINUX 50#if ENABLE_SELINUX
51 security_context_t scontext; 51 security_context_t scontext;
52#endif 52#endif
53 /* Don't allow -n -r -nr -ug -rug -nug -rnug */ 53 /* Don't allow -n -r -nr -ug -rug -nug -rnug */
54 /* Don't allow more than one username */ 54 /* Don't allow more than one username */
@@ -78,26 +78,26 @@ int id_main(int argc, char **argv)
78 puts((flags & JUST_USER) ? bb_getpwuid(NULL, uid, -1 ) : bb_getgrgid(NULL, gid, -1 )); 78 puts((flags & JUST_USER) ? bb_getpwuid(NULL, uid, -1 ) : bb_getgrgid(NULL, gid, -1 ));
79 } else { 79 } else {
80 if (flags & JUST_USER) { 80 if (flags & JUST_USER) {
81 printf("%u\n", uid); 81 printf("%u\n", uid);
82 } 82 }
83 if (flags & JUST_GROUP) { 83 if (flags & JUST_GROUP) {
84 printf("%u\n", gid); 84 printf("%u\n", gid);
85 } 85 }
86 } 86 }
87 87
88#if ENABLE_SELINUX 88#if ENABLE_SELINUX
89 if (flags & JUST_CONTEXT) { 89 if (flags & JUST_CONTEXT) {
90 selinux_or_die(); 90 selinux_or_die();
91 if (argc - optind == 1) { 91 if (argc - optind == 1) {
92 bb_error_msg_and_die("user name can't be passed with -Z"); 92 bb_error_msg_and_die("user name can't be passed with -Z");
93 } 93 }
94 94
95 if (getcon(&scontext)) { 95 if (getcon(&scontext)) {
96 bb_error_msg_and_die("can't get process context"); 96 bb_error_msg_and_die("can't get process context");
97 } 97 }
98 printf("%s\n", scontext); 98 printf("%s\n", scontext);
99 } 99 }
100#endif 100#endif
101 /* exit */ 101 /* exit */
102 fflush_stdout_and_exit(EXIT_SUCCESS); 102 fflush_stdout_and_exit(EXIT_SUCCESS);
103 } 103 }
diff --git a/coreutils/install.c b/coreutils/install.c
index a58a23b6e..c80be01ff 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -41,7 +41,7 @@ static void setdefaultfilecon(const char *path) {
41 41
42 if (!is_selinux_enabled()) { 42 if (!is_selinux_enabled()) {
43 return; 43 return;
44 } 44 }
45 if (lstat(path, &s) != 0) { 45 if (lstat(path, &s) != 0) {
46 return; 46 return;
47 } 47 }
@@ -101,7 +101,7 @@ int install_main(int argc, char **argv)
101 /* -c exists for backwards compatibility, it's needed */ 101 /* -c exists for backwards compatibility, it's needed */
102 102
103 flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext)); 103 flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext));
104 104
105#if ENABLE_SELINUX 105#if ENABLE_SELINUX
106 if (flags & OPT_PRESERVE_SECURITY_CONTEXT) { 106 if (flags & OPT_PRESERVE_SECURITY_CONTEXT) {
107 use_default_selinux_context = 0; 107 use_default_selinux_context = 0;
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 2e68eb848..34836ee29 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -770,7 +770,7 @@ static const unsigned opt_flags[] = {
770#if ENABLE_FEATURE_AUTOWIDTH 770#if ENABLE_FEATURE_AUTOWIDTH
771 0, 0, /* T, w - ignored */ 771 0, 0, /* T, w - ignored */
772#endif 772#endif
773#if ENABLE_SELINUX 773#if ENABLE_SELINUX
774 LIST_MODEBITS|LIST_ID_NAME|LIST_CONTEXT, /* Z */ 774 LIST_MODEBITS|LIST_ID_NAME|LIST_CONTEXT, /* Z */
775#endif 775#endif
776 (1U<<31) 776 (1U<<31)
diff --git a/coreutils/mv.c b/coreutils/mv.c
index 64cae965b..c08d2327c 100644
--- a/coreutils/mv.c
+++ b/coreutils/mv.c
@@ -118,7 +118,7 @@ DO_MOVE:
118 copy_flag = FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS; 118 copy_flag = FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS;
119#if ENABLE_SELINUX 119#if ENABLE_SELINUX
120 copy_flag |= FILEUTILS_PRESERVE_SECURITY_CONTEXT; 120 copy_flag |= FILEUTILS_PRESERVE_SECURITY_CONTEXT;
121#endif 121#endif
122 if ((copy_file(*argv, dest, copy_flag) >= 0) && 122 if ((copy_file(*argv, dest, copy_flag) >= 0) &&
123 (remove_file(*argv, FILEUTILS_RECUR | FILEUTILS_FORCE) >= 0)) { 123 (remove_file(*argv, FILEUTILS_RECUR | FILEUTILS_FORCE) >= 0)) {
124 goto RET_0; 124 goto RET_0;
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 37a924057..a2cdbfb29 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -416,7 +416,7 @@ static int do_statfs(char const *filename, char const *format)
416 format = (flags & OPT_TERSE 416 format = (flags & OPT_TERSE
417 ? (flags & OPT_SELINUX ? "%n %i %l %t %s %b %f %a %c %d %C\n": 417 ? (flags & OPT_SELINUX ? "%n %i %l %t %s %b %f %a %c %d %C\n":
418 "%n %i %l %t %s %b %f %a %c %d\n") 418 "%n %i %l %t %s %b %f %a %c %d\n")
419 : (flags & OPT_SELINUX ? 419 : (flags & OPT_SELINUX ?
420 " File: \"%n\"\n" 420 " File: \"%n\"\n"
421 " ID: %-8i Namelen: %-7l Type: %T\n" 421 " ID: %-8i Namelen: %-7l Type: %T\n"
422 "Block size: %-10s\n" 422 "Block size: %-10s\n"
@@ -531,7 +531,7 @@ static int do_stat(char const *filename, char const *format)
531 } 531 }
532#else 532#else
533 if (flags & OPT_TERSE) { 533 if (flags & OPT_TERSE) {
534 format = (flags & OPT_SELINUX ? 534 format = (flags & OPT_SELINUX ?
535 "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o %C\n": 535 "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o %C\n":
536 "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n"); 536 "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n");
537 } else { 537 } else {