* [PATCH 1/2 v2]: clean-up setfiles source code and document two options
@ 2011-05-09 20:32 Guido Trentalancia
0 siblings, 0 replies; only message in thread
From: Guido Trentalancia @ 2011-05-09 20:32 UTC (permalink / raw)
To: SELinux; +Cc: Steve Lawrence
RE-SUBMISSION (originally submitted on Sun, 20 Feb 2011 09:56:48 +0100)
Minor improvements and clean-ups to the setfiles source code
(policycoreutils):
- removed unused code for undocumented and no-op "-i" option;
- document syntax of "-f" option;
- document syntax of "-p" option in secondary usage case (i.e. with
"-s");
- substitute variable name with parameter name in usage printout for
"-r" option;
- remove a few misplaced spaces from the usage printout for better
formatting.
diff -pruN selinux/policycoreutils/setfiles/setfiles.c selinux-policycoreutils-setfiles-clean-up/policycoreutils/setfiles/setfiles.c
--- selinux/policycoreutils/setfiles/setfiles.c 2011-05-09 01:04:17.079842517 +0200
+++ selinux-policycoreutils-setfiles-clean-up/policycoreutils/setfiles/setfiles.c 2011-05-09 21:58:44.896559653 +0200
@@ -25,7 +25,6 @@ static char *policyfile = NULL;
static int warn_no_match = 0;
static int null_terminated = 0;
static int errors;
-static int ignore_enoent;
static struct restore_opts r_opts;
#define STAT_BLOCK_SIZE 1
@@ -44,14 +43,15 @@ void usage(const char *const name)
{
if (iamrestorecon) {
fprintf(stderr,
- "usage: %s [-iFnrRv0] [-e excludedir ] [-o filename ] [-f filename | pathname... ]\n",
+ "usage: %s [-iFnrRv0] [-e excludedir] [-o filename] [-f filename | pathname...]\n",
name);
} else {
fprintf(stderr,
- "usage: %s [-dnpqvW] [-o filename] [-r alt_root_path ] spec_file pathname...\n"
+ "usage: %s [-dnpqvW] [-o filename] [-r alt_root_path] spec_file pathname...\n"
"usage: %s -c policyfile spec_file\n"
- "usage: %s -s [-dnqvW] [-o filename ] spec_file\n", name, name,
- name);
+ "usage: %s -f filename [-dnpqvW] [-o filename] spec_file\n"
+ "usage: %s -s [-dnpqvW] [-o filename] spec_file\n", name, name,
+ name, name);
}
exit(1);
}
@@ -283,7 +283,7 @@ int main(int argc, char **argv)
exclude_non_seclabel_mounts();
/* Process any options. */
- while ((opt = getopt(argc, argv, "c:de:f:ilnpqrsvo:FRW0")) > 0) {
+ while ((opt = getopt(argc, argv, "c:de:f:lnpqrsvo:FRW0")) > 0) {
switch (opt) {
case 'c':
{
@@ -334,9 +334,6 @@ int main(int argc, char **argv)
case 'd':
r_opts.debug = 1;
break;
- case 'i':
- ignore_enoent = 1;
- break;
case 'l':
r_opts.logging = 1;
break;
@@ -371,7 +368,7 @@ int main(int argc, char **argv)
break;
}
if (optind + 1 >= argc) {
- fprintf(stderr, "usage: %s -r r_opts.rootpath\n",
+ fprintf(stderr, "usage: %s -r rootpath\n",
argv[0]);
exit(1);
}
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-09 20:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 20:32 [PATCH 1/2 v2]: clean-up setfiles source code and document two options Guido Trentalancia
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.