Author: spadkins
Date: Tue Aug 10 12:29:04 2010
New Revision: 14321
Modified:
p5ee/trunk/App-Options/lib/App/Options.pm
Log:
allow --security_policy_level=0 drop your guard to display secure options on
--help
Modified: p5ee/trunk/App-Options/lib/App/Options.pm
==============================================================================
--- p5ee/trunk/App-Options/lib/App/Options.pm (original)
+++ p5ee/trunk/App-Options/lib/App/Options.pm Tue Aug 10 12:29:04 2010
@@ -331,9 +331,13 @@
flush_imports - flush all pending imported option files.
- security_policy_level - When set to 2, this ensures that all secure
- options can only be read from files which do not have read/write
- permission by any other user except the one running the program.
+ security_policy_level - When set, this enforces that whenever secure
+ attributes are applied, they are set to the same level. When set
+ 0, all of the security features are disabled (passwords can be
+ viewed with "--security_policy_level=0 --help"). When set to 2,
+ all secure options can only be read from files which do not have
+ read/write permission by any other user except the one running the
+ program.
=cut
@@ -963,9 +967,8 @@
$type = $option->{$var}{type} || "";
$desc = $option->{$var}{description} || "";
$secure = $option->{$var}{secure};
- if (! defined $secure) {
- $secure = ($var =~ /pass(word)?$/) ? 1 : 0;
- }
+ $secure = 1 if (! defined $secure && $var =~ /pass(word)?$/);
+ $secure = $values->{security_policy_level} if (defined $secure &&
defined $values->{security_policy_level});
$val_desc = $option->{$var}{value_description} || "";
$var_str = ($type eq "boolean") ? $var : ($val_desc ?
"$var=<$val_desc>" : "$var=<value>");
$value_str = $secure ? "********" : ((defined $value) ? $value :
"undef");