LDAP/Command/Add/Sudoer.pm

filter: Statementstmt 72.7% 16 / 22 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 50.0% 20 / 40 CC 5 SCAR 28.4
CC
5
Cov
52%
run
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 17.1
« LDAP/Command/Passwd.pm ↑ Summary LDAP/Command/Add/Group.pm »
1 package App::LDAP::Command::Add::Sudoer;
2  
3 1 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 with qw( App::LDAP::Role::Command
8 App::LDAP::Role::Bindable );
9  
10 1 has base => (
11 is => "rw",
12 isa => "Str",
13 );
14  
15 1 ▶use App::LDAP::LDIF::Sudoer;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 0 ▶sub run {
Subroutine run: not called CC=5 SCAR=34.0
Pod undocumented
18 0 my ($self, ) = @_;
19  
20 0 ▶ my $sudoername = $self->extra_argv->[2] or die "no sudoer name specified";
Branch: 1 branch
BranchTrueFalseTotal
my $sudoername = $self->extra_argv->[2] or die "no sudoer name specified" 0 0 0
21  
22 die "sudoer $sudoername already exists" if App::LDAP::LDIF::Sudoer->search(
23 base => config()->{sudoers_base}->[0],
24 0 ▶ scope => config()->{sudoers_base}->[1] // "sub",
Branch: 1 branch
BranchTrueFalseTotal
if "App::LDAP::LDIF::Sudoer"->search("base", config()->{"sudoers_base"}[0], "scope", config()->{"sudoers_base"}[1] // "sub", "filter", "cn=$sudoername") 0 0 0
Condition0%0/2
config()->{"sudoers_base"}[1] // "sub"
l!l
00
MC/DC0%0/1
config()->{"sudoers_base"}[1] // "sub"
config()->{"sudoers_base"}[1]
Truth table0%0/2
A
A= config()->{"sudoers_base"}[1]
Aresult
11
00
25 filter => "cn=$sudoername",
26 );
27  
28 my $sudoer = App::LDAP::LDIF::Sudoer->new(
29 0 ▶ base => $self->base // config()->{sudoers_base}->[0],
Condition0%0/3
$self->base // config()->{"sudoers_base"}[0]
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->base // config()->{"sudoers_base"}[0]
$self->base config()->{"sudoers_base"}[0]
Truth table0%0/3
A // B
A= $self->baseB= config()->{"sudoers_base"}[0]
ABresult
1X1
011
000
30 sudoUser => $sudoername,
31 );
32  
33 0 $sudoer->save;
34  
35 0 $sudoer;
36 }
37  
38 1 __PACKAGE__->meta->make_immutable;
39 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41 1 1;
« LDAP/Command/Passwd.pm ↑ Summary LDAP/Command/Add/Group.pm »