« Data/Sah/Filter/perl/Unix/check_uid_exists.pm
↑ Summary
Data/Sah/Filter/perl/Unix/check_unix_user_exists.pm »
| 1 | package Data::Sah::Filter::perl::Unix::check_unix_group_exists; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 8 | 1 | our $DATE = '2024-11-15'; # DATE | |
| 9 | 1 | our $DIST = 'Sah-SchemaBundle-Unix'; # DIST | |
| 10 | 1 | our $VERSION = '0.022'; # VERSION | |
| 11 | |||
| 12 | 0 | ▶ | sub meta { |
|
Subroutine
meta: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 13 | +{ | ||
| 14 | 0 | v => 1, | |
| 15 | summary => 'Check that Unix group exists on the system', | ||
| 16 | might_fail => 1, | ||
| 17 | }; | ||
| 18 | } | ||
| 19 | |||
| 20 | 0 | ▶ | sub filter { |
|
Subroutine
filter: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 21 | 0 | my %args = @_; | |
| 22 | |||
| 23 | 0 | my $dt = $args{data_term}; | |
| 24 | |||
| 25 | 0 | my $res = {}; | |
| 26 | |||
| 27 | 0 | $res->{expr_filter} = join( | |
| 28 | "", | ||
| 29 | "do { my \$tmp = $dt; my \@tmp = getgrnam(\$tmp); if (!\@tmp) { [\"Group '\$tmp' does not exist\", \$tmp] } else { [undef, \$tmp] } }", | ||
| 30 | ); | ||
| 31 | |||
| 32 | 0 | $res; | |
| 33 | } | ||
| 34 | |||
| 35 | 1 | 1; | |
| 36 | # ABSTRACT: Check that Unix group exists on the system | ||
| 37 | |||
| 38 | __END__ | ||