Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Added a new argument to getvals to force return of an empty array, …

…if desired.

- Force privfiles call to return an array, #refs 90
  • Loading branch information...
commit 795419c0382d4717f03d1650fa619e0ba5222181 1 parent a47c72b
rkhardalian authored
Showing with 15 additions and 2 deletions.
  1. +14 −1 lib/Spine/Data.pm
  2. +1 −1  lib/Spine/Plugin/SystemHarden.pm
View
15 lib/Spine/Data.pm
@@ -854,8 +854,21 @@ sub getvals
{
my $self = shift;
my $key = shift;
+ my $force = shift || 0;
+
$self->print(4, "getvals -> $key");
- return undef unless ($key && exists $self->{$key});
+
+ unless ($key && exists $self->{$key})
+ {
+ if ($force)
+ {
+ return [];
+ }
+ else
+ {
+ return undef;
+ }
+ }
if ((ref $self->{$key}) eq "ARRAY")
{
View
2  lib/Spine/Plugin/SystemHarden.pm
@@ -67,7 +67,7 @@ sub system_harden
foreach my $file (@HARDEN)
{
next if $file =~ /^\Q$croot\E/;
- next if ( grep {/$file/} @{$c->getvals("privfiles")} );
+ next if ( grep {/$file/} @{$c->getvals("privfiles", 1)} );
$c->cprint("stripping suid/sgid bits from $file", 2);

0 comments on commit 795419c

Please sign in to comment.
Something went wrong with that request. Please try again.