Closed kamino closed 9 years ago
Setools3 has --all for seinfo, but I don't see the need to continue having that option. It seems like it's too much information at one time to be useful; just the type listing is typically several hundred, if not thousands of lines long.
I'm fine with the other changes, though I'd like to also have an option to not have the item count and indentation, so someone could easily use the output in a script.
the --all option was, in my opinion, a way to have an overview of the policy without passing the 10+ flags on the CLI to get them, and a kind of backward compatibility with setools3.
For the option for the item count, you mean suppressing the whole line with the item count or suppressing only the number ? By default, which output should be done in seinfo ? 1) No item count and not indented or 2) with item count and indented ?
Ok, I can take the --all, since it's a simple change. Regarding indentation, take this example:
Users: 6
root
staff_u
sysadm_u
system_u
unconfined_u
user_u
I'd like an option so the output looks likes like this, so scripts can easily process it (no indentation and no headers):
root
staff_u
sysadm_u
system_u
unconfined_u
user_u
There are 3 major changes in this commit:
1/ Setting the default values to None instead of "". Indeed, when --all is passed to the command line, default values are set to "" making the 'if insinstance(xxx, str)' being True, and thus the script takes the wrong branch. 2/ if/elif/else have been replaced by if/else structure, to enable selection of multiple switches. Selected component queries are stacked and displayed at the end 3/ like the original seinfo, we append some descriptions string (info: count + indented results) to the output