Branch Coverage

blib/lib/Linux/usermod.pm
Criterion Covered Total %
branch 78 244 31.9


line true false branch
53 1 1 if ($flag) { }
54 0 1 unless _exists($user, $flag)
58 0 1 unless _exists($user, $flag)
69 6 3 if ($$self[-1] eq '__U__') { }
3 0 elsif ($$self[-1] eq '__G__') { }
70 0 6 if ($what =~ /^\d{1,2}$/)
72 0 0 if $v == $what
80 0 3 if ($what =~ /^\d{1,2}$/)
82 0 0 if $v == $what
96 0 1 unless exists $field{$what} or exists $gfield{$what}
97 0 0 if $newval =~ /:/ and $field{$what} != 8 || $gfield{$what} != 4
98 0 1 if $newval =~ /^undef$/i
99 0 1 if ($$self[-1] eq '__U__') { }
1 0 elsif ($$self[-1] eq '__G__') { }
105 0 0 if ($field{$what} <= 6)
110 0 0 if /^\Q$name\E:/
112 0 0 if ($field{$what} == 0)
113 0 0 unless $newval =~ /^([A-Z]|[a-z]){1}\w{0,254}/
117 0 0 if /^(.[^:]+):/
118 0 0 if defined $names{$newval}
123 0 0 if /^\Q$name\E:/
124 0 0 if _io("$file_shadow", \@file, 'w')
128 0 0 if ($field{$what} > 6)
130 0 0 if $field{$what} == 8
131 0 0 if ($field{$what} == 8 and $newval)
132 0 0 if $oldval =~ /^!/
133 0 0 unless $flag
138 0 0 if /^\Q$name\E:/
140 0 0 if ($field{$what} == 7)
146 0 0 if /^\Q$name\E:/
147 0 0 if _io("$file_passwd", \@file, 'w')
155 0 1 if ($gfield{$what} == 0 or $gfield{$what} == 4)
156 0 0 unless $newval =~ /^([A-Z]|[a-z]){1}\w{0,254}/
159 0 0 if /^(.[^:]+):/
160 0 0 if exists $names{$newval}
163 0 0 unless /^$oldval:/
170 0 0 unless /^$oldval:/
175 0 0 if _io($file_gshadow, \@file, 'w')
177 0 1 if ($gfield{$what} == 3 or $gfield{$what} == 7)
179 0 0 unless _exists($_)
185 0 0 unless /^\Q$name\E:/
193 0 0 unless /^\Q$name\E:/
197 0 0 if _io($file_gshadow, \@file, 'w')
199 0 1 if ($gfield{$what} == 2)
200 0 0 if $newval < 1 or $newval > 65535
203 0 0 if /^.+?:.*?:(.+):/
204 0 0 if $ids{$newval}
206 0 0 unless /^\Q$name\E:/
210 0 0 if _io($file_group, \@file, 'w')
212 1 0 if ($gfield{$what} == 6)
213 0 1 unless _exists($newval)
217 0 1 unless /^\Q$name\E:/
221 1 0 if _io($file_gshadow, \@file, 'w')
223 0 0 if ($gfield{$what} == 1 or $gfield{$what} == 5)
227 0 0 if ($newval) { }
235 0 0 unless /^\Q$name\E:/
242 0 0 unless /^\Q$name\E:/
246 0 0 if _io($file_group, \@file, 'w')
257 0 1 unless /^\Q$username\E:/
270 0 1 unless /^\Q$username\E:/
286 0 0 unless $password
289 0 0 $flag ? :
296 1 3 $gflag ? :
300 3 1 $flag ? :
307 0 1 if scalar @args == 0
308 0 1 if _exists($args[0])
311 1 6 if /^\s*$/ and $c++
313 1 5 if ($c == 1)
314 0 1 if /:/
315 0 1 unless /^([A-Z]|[a-z]){1}\w{0,254}/
318 0 6 if ($c == 2)
319 0 0 unless /^(.*){0,254}$/
320 0 0 if $_
322 1 5 if ($c == 3)
323 0 1 if $_ eq ''
324 0 1 unless /^\d+$/
325 0 1 if $_ > 65535 or $_ < 1
328 1 5 if ($c == 4)
329 0 1 if $_ eq ''
330 0 1 unless /^\d+$/
331 0 1 if $_ > 65535 or $_ < 1
1 0 if (/^\d+$/)
334 1 5 if ($c == 5)
335 0 1 if /:/
338 1 5 if ($c == 6)
339 0 1 if /:/
342 1 5 if ($c == 7)
343 0 1 if /:/
347 1 0 unless $fields{'password'}
352 0 0 if ($fields{'uid'} == $_)
357 0 1 if ($fields{'uid'} == 1000)
359 0 0 if $_ < 1000
360 0 0 if $fields{'uid'} == $_
363 0 1 unless $fields{'gid'}
374 0 1 unless my $group = shift()
379 0 1 unless $group =~ /^([A-Z]|[a-z]){1}\w{0,254}/
380 0 0 if @tmp = split(/:/, $_, 0)
381 0 1 if exists $file{$group}
382 0 1 unless ($gid)
385 0 0 if $_ < 100
386 0 0 if $gid == $_
399 0 0 unless _exists($username)
413 0 0 unless my $group = shift()
416 0 0 if @tmp = split(/:/, $_, 0)
417 0 0 unless exists $file{$group}
429 0 1 unless my $group = shift()
433 0 1 unless /^$group:/
445 0 1 unless /^$group:/
464 0 0 unless /^\Q$name\E:/
487 0 16 unless -f $file
489 0 16 unless $flag =~ /^(r|w|a)$/
490 11 5 if ($flag eq 'r')
491 0 11 unless open FH, $file
492 0 11 unless flock FH, 1
498 1 4 if ($flag eq 'w')
499 0 1 unless open FH, "> $file"
500 0 1 unless flock FH, 2
505 4 0 if ($flag eq 'a')
506 0 4 unless open FH, ">> $file"
507 0 4 unless flock FH, 2
535 0 0 if $password =~ /^\!/
543 0 0 unless $password =~ /^\!/