aboutsummaryrefslogtreecommitdiff
path: root/selinux
diff options
context:
space:
mode:
Diffstat (limited to 'selinux')
-rw-r--r--selinux/chcon.c29
-rw-r--r--selinux/runcon.c17
2 files changed, 22 insertions, 24 deletions
diff --git a/selinux/chcon.c b/selinux/chcon.c
index a8a816be0..689ec8c8c 100644
--- a/selinux/chcon.c
+++ b/selinux/chcon.c
@@ -105,20 +105,19 @@ skip:
105} 105}
106 106
107#if ENABLE_FEATURE_CHCON_LONG_OPTIONS 107#if ENABLE_FEATURE_CHCON_LONG_OPTIONS
108static struct option chcon_options[] = { 108static const char chcon_longopts[] =
109 { "recursive", 0, NULL, 'R' }, 109 "recursive\0" No_argument "R"
110 { "changes", 0, NULL, 'c' }, 110 "changes\0" No_argument "c"
111 { "no-dereference", 0, NULL, 'h' }, 111 "no-dereference\0" No_argument "h"
112 { "silent", 0, NULL, 'f' }, 112 "silent\0" No_argument "f"
113 { "quiet", 0, NULL, 'f' }, 113 "quiet\0" No_argument "f"
114 { "user", 1, NULL, 'u' }, 114 "user\0" Required_argument "u"
115 { "role", 1, NULL, 'r' }, 115 "role\0" Required_argument "r"
116 { "type", 1, NULL, 't' }, 116 "type\0" Required_argument "t"
117 { "range", 1, NULL, 'l' }, 117 "range\0" Required_argument "l"
118 { "verbose", 0, NULL, 'v' }, 118 "verbose\0" No_argument "v"
119 { "reference", 1, NULL, 0xff }, /* no short option */ 119 "reference\0" Required_argument "\xff" /* no short option */
120 { NULL, 0, NULL, 0 }, 120 "\0";
121};
122#endif 121#endif
123 122
124int chcon_main(int argc, char **argv); 123int chcon_main(int argc, char **argv);
@@ -129,7 +128,7 @@ int chcon_main(int argc, char **argv)
129 int i, errors = 0; 128 int i, errors = 0;
130 129
131#if ENABLE_FEATURE_CHCON_LONG_OPTIONS 130#if ENABLE_FEATURE_CHCON_LONG_OPTIONS
132 applet_long_options = chcon_options; 131 applet_long_options = chcon_longopts;
133#endif 132#endif
134 opt_complementary = "-1" /* at least 1 param */ 133 opt_complementary = "-1" /* at least 1 param */
135 ":?" /* error if exclusivity constraints are violated */ 134 ":?" /* error if exclusivity constraints are violated */
diff --git a/selinux/runcon.c b/selinux/runcon.c
index 741c7bba6..3502dcd3a 100644
--- a/selinux/runcon.c
+++ b/selinux/runcon.c
@@ -69,15 +69,14 @@ static context_t runcon_compute_new_context(char *user, char *role, char *type,
69} 69}
70 70
71#if ENABLE_FEATURE_RUNCON_LONG_OPTIONS 71#if ENABLE_FEATURE_RUNCON_LONG_OPTIONS
72static const struct option runcon_options[] = { 72static const char runcon_options[] =
73 { "user", 1, NULL, 'u' }, 73 "user\0" Required_argument "u"
74 { "role", 1, NULL, 'r' }, 74 "role\0" Required_argument "r"
75 { "type", 1, NULL, 't' }, 75 "type\0" Required_argument "t"
76 { "range", 1, NULL, 'l' }, 76 "range\0" Required_argument "l"
77 { "compute", 0, NULL, 'c' }, 77 "compute\0" No_argument "c"
78 { "help", 0, NULL, 'h' }, 78 "help\0" No_argument "h"
79 { NULL, 0, NULL, 0 }, 79 "\0";
80};
81#endif 80#endif
82 81
83#define OPTS_ROLE (1<<0) /* r */ 82#define OPTS_ROLE (1<<0) /* r */