Branch Coverage

lib/Provision/Unix/User.pm
Criterion Covered Total %
branch 15 72 20.8


line true false branch
38 0 2 unless $$self{'os'} = $self->_get_os
151 0 1 unless my $uid = getpwnam $username
156 0 1 if $debug
168 0 1 if $debug
179 0 0 unless ($user)
183 0 0 if $$self{'debug'}
197 0 0 if (getpwnam $user and getpwnam $user > 0) { }
201 0 0 if ($util->syscmd($cmd)) { }
232 0 0 if ($self->exists($user)) { }
275 0 0 defined $p{'debug'} ? :
276 0 0 defined $p{'fatal'} ? :
278 0 0 unless (-d $homedir)
286 0 0 unless -d $ssh_dir or -e $ssh_dir
287 0 0 unless -d $ssh_dir
290 0 0 if $restricted
293 0 0 unless $util->file_write("$ssh_dir/authorized_keys", 'lines', [$line], 'mode', '0600', 'debug', 0, 'fatal', 0)
300 0 0 if ($p{'username'})
302 0 0 if ($uid) { }
320 0 0 if (length $pass < 6)
327 0 0 if (length $pass > 128)
334 0 0 if ($pass =~ /a-z/ or $pass =~ /A-Z/ or $pass =~ /0-9/)
340 0 0 if ($pass eq $user)
345 0 0 if (-r '/usr/local/etc/passwd.badpass')
350 0 0 if ($pass eq $line)
398 1 0 if ($Provision::Unix::User::OSNAME =~ /Linux|FreeBSD|Solaris/i)
416 0 2 if ($os eq 'darwin') { }
0 2 elsif (lc $Provision::Unix::User::OSNAME eq 'freebsd') { }
2 0 elsif (lc $Provision::Unix::User::OSNAME eq 'linux') { }
452 0 0 unless ($$self{'username'})
461 0 0 unless ($self->_is_valid_username)
470 0 0 unless ($$self{'uid'})
500 1 15 if (length $username < 2)
509 1 14 if (length $username > 16)
518 3 11 if ($username =~ /[^a-z0-9]/)
527 0 11 if (-r $reserved)
531 0 0 if ($username eq $line)