« blib/lib/Monitoring/Sneck/Checks/cert_dir.pm
↑ Summary
blib/lib/Monitoring/Sneck/Checks/reboot_needed.pm »
| 1 | package Monitoring::Sneck::Checks::mount; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use 5.014; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use parent 'Monitoring::Sneck::Checks::base'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use File::Slurp qw(read_file); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | Monitoring::Sneck::Checks::mount - checks file systems are mounted and writable | ||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | Version 0.0.1 | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 4 | our $VERSION = '0.0.1'; | |||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | # Where things are. Set by tests. | ||||||||||||||||||||||||||||||||||||||||||
| 22 | 4 | our $FSTAB = '/etc/fstab'; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 4 | our $MOUNT = '/sbin/mount'; | |||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | # Types in fstab that are not mounted at a path. | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 4 | our %NOT_MOUNTED_TYPES = map { $_ => 1 } ( 'swap', 'ignore' ); | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | mounts|perl:mount | ||||||||||||||||||||||||||||||||||||||||||
| 31 | data_mounted|perl:mount --no-fstab -p /data -p /backup | ||||||||||||||||||||||||||||||||||||||||||
| 32 | mounts_not_cd|perl:mount -i /media/cdrom | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | Checks every file system in fstab is mounted, and that those not set | ||||||||||||||||||||||||||||||||||||||||||
| 37 | ro there are not mounted read only, as one going read only after | ||||||||||||||||||||||||||||||||||||||||||
| 38 | errors often goes unnoticed. Either is CRITICAL. Paths given with | ||||||||||||||||||||||||||||||||||||||||||
| 39 | --path must be mounted too, but are not checked for being read only. | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | Swap is left alone. Entries that are noauto or x-systemd.automount are | ||||||||||||||||||||||||||||||||||||||||||
| 42 | not expected to be mounted, though they are checked for being read | ||||||||||||||||||||||||||||||||||||||||||
| 43 | only if they are. | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | Mounts are read from /proc/mounts on Linux and mount -p on FreeBSD. | ||||||||||||||||||||||||||||||||||||||||||
| 46 | Other OSes are UNKNOWN, as is fstab not being readable unless | ||||||||||||||||||||||||||||||||||||||||||
| 47 | --no-fstab is given. | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | =head1 OPTIONS | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | - -p, --path :: A path that must be a mount point. May be given more | ||||||||||||||||||||||||||||||||||||||||||
| 52 | than once. | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | - -i, --ignore :: A mount point in fstab to leave alone. May be given | ||||||||||||||||||||||||||||||||||||||||||
| 55 | more than once. | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | - -n, --no-fstab :: Only check --path, which must then be given. | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 16 | ▶ | sub option_spec { return ( 'path|p=s@', 'ignore|i=s@', 'no-fstab|n' ) } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
option_spec: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 16 | ▶ | sub validate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 16 | my ( $self, $options ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | 16 | ▶ | return ('--no-fstab needs --path') if $options->{'no-fstab'} && !defined( $options->{path} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$options->{"no-fstab"} and not defined $options->{"path"}
MC/DC100%2/2
$options->{"no-fstab"} and not defined $options->{"path"}
$options->{"no-fstab"}
not defined $options->{"path"}
Truth table100%3/3
A and not(B)
A= $options->{"no-fstab"}B= not defined $options->{"path"}
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 14 | return (); | |||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | =head1 METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | =head2 check | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | Does the check. | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||
| 79 | 14 | ▶ | sub check { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check: called CC=15 SCAR=27.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | 14 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | 14 | my %mounted = map { $_->{path} => $_ } $self->mounts; | |||||||||||||||||||||||||||||||||||||||||
| 83 | 13 | ▶ | my %ignore = map { _normal_path($_) => 1 } @{ $self->opt('ignore') // [] }; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->opt("ignore") // []
MC/DC100%1/1
$self->opt("ignore") // []
$self->opt("ignore")
Truth table100%2/2
A
A= $self->opt("ignore")
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | 13 | my @wanted; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 13 | ▶ | if ( !$self->opt('no-fstab') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | 11 | my $fstab = read_file( $FSTAB, err_mode => 'quiet' ); | |||||||||||||||||||||||||||||||||||||||||
| 87 | 11 | ▶ | return $self->finish( $self->UNKNOWN, 'can not read ' . $FSTAB . ', ' . $! ) if !defined($fstab); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 9 | push( @wanted, grep { !$ignore{ $_->{path} } } _parse($fstab) ); | |||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 11 | ▶ | push( @wanted, map { { path => _normal_path($_), options => {}, given => 1 } } @{ $self->opt('path') // [] } ); | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->opt("path") // []
MC/DC100%1/1
$self->opt("path") // []
$self->opt("path")
Truth table100%2/2
A
A= $self->opt("path")
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||
| 92 | 11 | my @problems; | |||||||||||||||||||||||||||||||||||||||||
| 93 | 11 | my $checked = 0; | |||||||||||||||||||||||||||||||||||||||||
| 94 | 11 | my %seen; | |||||||||||||||||||||||||||||||||||||||||
| 95 | 11 | foreach my $want (@wanted) { | |||||||||||||||||||||||||||||||||||||||||
| 96 | 38 | ▶ | next if $seen{ $want->{path} }++; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 38 | my $options = $want->{options}; | |||||||||||||||||||||||||||||||||||||||||
| 98 | 38 | my $mount = $mounted{ $want->{path} }; | |||||||||||||||||||||||||||||||||||||||||
| 99 | 38 | ▶ | my $lazy = $options->{noauto} || $options->{'x-systemd.automount'}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$options->{'noauto'} || $options->{'x-systemd.automount'}
MC/DC100%2/2
$options->{'noauto'} || $options->{'x-systemd.automount'}
$options->{'noauto'}
$options->{'x-systemd.automount'}
Truth table100%3/3
A || B
A= $options->{'noauto'}B= $options->{'x-systemd.automount'}
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | 38 | ▶ | if ( !defined($mount) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 14 | ▶ | push( @problems, $want->{path} . ' is not mounted' ) if !$lazy; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | 14 | next; | |||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||
| 104 | 24 | $checked++; | |||||||||||||||||||||||||||||||||||||||||
| 105 | 24 | ▶ | if ( $mount->{options}{ro} && !$options->{ro} && !$want->{given} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$mount->{"options"}{"ro"} and not $options->{"ro"} and not $want->{"given"}
$mount->{"options"}{"ro"} and not $options->{"ro"}
MC/DC66%2/3
$mount->{"options"}{"ro"} and not $options->{"ro"} and not $want->{"given"}
$mount->{"options"}{"ro"}
not $options->{"ro"}
not $want->{"given"}
Truth table75%3/4
A and not(B) and not(C)
A= $mount->{"options"}{"ro"}B= not $options->{"ro"}C= not $want->{"given"}
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 2 | push( @problems, $want->{path} . ' is read only' ); | |||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||
| 108 | } ## end foreach my $want (@wanted) | ||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||
| 110 | 11 | my $message = $checked . ' mounted'; | |||||||||||||||||||||||||||||||||||||||||
| 111 | 11 | ▶ | $message = $message . ', ' . join( ', ', @problems ) if defined( $problems[0] ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||
| 113 | 11 | ▶ | return $self->finish( defined( $problems[0] ) ? $self->CRITICAL : $self->OK, $message ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | } ## end sub check | ||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||
| 116 | =head2 mounts | ||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | Returns what is mounted, as hash refs of path and options, a hash ref | ||||||||||||||||||||||||||||||||||||||||||
| 119 | of each option to its value, or 1. Dies if it can not be found. | ||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||
| 121 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 14 | ▶ | sub mounts { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mounts: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 14 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 14 | ▶ | if ( $self->os eq 'linux' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 12 | return _parse( $self->proc_file('mounts'), 1 ); | |||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | 2 | ▶ | if ( $self->os eq 'freebsd' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | 2 | my ( $exit, $output ) = $self->run_command( $MOUNT, '-p' ); | |||||||||||||||||||||||||||||||||||||||||
| 131 | 1 | ▶ | die( $MOUNT . ' -p exited ' . $exit . "\n" ) if $exit; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 1 | return _parse( $output, 1 ); | |||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | die( 'not supported on ' . $self->os . "\n" ); | |||||||||||||||||||||||||||||||||||||||||
| 136 | } ## end sub mounts | ||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | # Parses fstab, or something in the same format, such as /proc/mounts | ||||||||||||||||||||||||||||||||||||||||||
| 139 | # and mount -p. | ||||||||||||||||||||||||||||||||||||||||||
| 140 | # | ||||||||||||||||||||||||||||||||||||||||||
| 141 | # Args... | ||||||||||||||||||||||||||||||||||||||||||
| 142 | # | ||||||||||||||||||||||||||||||||||||||||||
| 143 | # - content :: The text. | ||||||||||||||||||||||||||||||||||||||||||
| 144 | # | ||||||||||||||||||||||||||||||||||||||||||
| 145 | # - all :: 1 to keep everything, for what is mounted, else entries | ||||||||||||||||||||||||||||||||||||||||||
| 146 | # not mounted at a path, such as swap, are left out. | ||||||||||||||||||||||||||||||||||||||||||
| 147 | # | ||||||||||||||||||||||||||||||||||||||||||
| 148 | # Returns a list of hash refs of device, path, type, and options, a hash | ||||||||||||||||||||||||||||||||||||||||||
| 149 | # ref of each option to its value, or 1. \040 and the like in paths | ||||||||||||||||||||||||||||||||||||||||||
| 150 | # are turned into what they stand for. | ||||||||||||||||||||||||||||||||||||||||||
| 151 | # | ||||||||||||||||||||||||||||||||||||||||||
| 152 | # Example... | ||||||||||||||||||||||||||||||||||||||||||
| 153 | # | ||||||||||||||||||||||||||||||||||||||||||
| 154 | # _parse("/dev/ada0p2 / ufs rw,noatime 1 1\n"); | ||||||||||||||||||||||||||||||||||||||||||
| 155 | # # ( { device => '/dev/ada0p2', path => '/', type => 'ufs', options => { rw => 1, noatime => 1 } } ) | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 22 | ▶ | sub _parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse: called CC=9 SCAR=22.1
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | 22 | my ( $content, $all ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | 22 | my @entries; | |||||||||||||||||||||||||||||||||||||||||
| 160 | 22 | foreach my $line ( split( /\n/, $content ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 161 | 98 | ▶ | next if $line =~ /\A\s*(?:#|\z)/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | 90 | my ( $device, $path, $type, $options ) = split( /\s+/, $line =~ s/\A\s+//r ); | |||||||||||||||||||||||||||||||||||||||||
| 163 | 90 | ▶ | next if !defined($type); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 90 | $path = _normal_path( $path =~ s/\\([0-7]{3})/chr(oct($1))/ger ); | |||||||||||||||||||||||||||||||||||||||||
| 165 | 90 | ▶ | next if !$all && ( $NOT_MOUNTED_TYPES{$type} || $path !~ m{\A/} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
not $all and $Monitoring::Sneck::Checks::mount::NOT_MOUNTED_TYPES{$type} || !($path =~ m[\A/]u)
$Monitoring::Sneck::Checks::mount::NOT_MOUNTED_TYPES{$type} or not $path =~ m[\A/]u
MC/DC66%2/3
not $all and $Monitoring::Sneck::Checks::mount::NOT_MOUNTED_TYPES{$type} || !($path =~ m[\A/]u)
not $all
$Monitoring::Sneck::Checks::mount::NOT_MOUNTED_TYPES{$type}
not $path =~ m[\A/]u
Truth table75%3/4
not(A) and B or not(C)
A= not $allB= $Monitoring::Sneck::Checks::mount::NOT_MOUNTED_TYPES{$type}C= not $path =~ m[\A/]u
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 81 | ▶ | my %options = map { /\A([^=]+)=(.*)\z/ ? ( $1 => $2 ) : ( $_ => 1 ) } split( /,/, $options // '' ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$options // ""
MC/DC0%0/1
$options // ""
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 81 | push( @entries, { device => $device, path => $path, type => $type, options => \%options } ); | |||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 22 | return @entries; | |||||||||||||||||||||||||||||||||||||||||
| 171 | } ## end sub _parse | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | # Drops a trailing / from a path, other than for /. | ||||||||||||||||||||||||||||||||||||||||||
| 174 | # | ||||||||||||||||||||||||||||||||||||||||||
| 175 | # Args... | ||||||||||||||||||||||||||||||||||||||||||
| 176 | # | ||||||||||||||||||||||||||||||||||||||||||
| 177 | # - path :: The path. | ||||||||||||||||||||||||||||||||||||||||||
| 178 | # | ||||||||||||||||||||||||||||||||||||||||||
| 179 | # Returns the path. | ||||||||||||||||||||||||||||||||||||||||||
| 180 | # | ||||||||||||||||||||||||||||||||||||||||||
| 181 | # Example... | ||||||||||||||||||||||||||||||||||||||||||
| 182 | # | ||||||||||||||||||||||||||||||||||||||||||
| 183 | # _normal_path('/data/'); # '/data' | ||||||||||||||||||||||||||||||||||||||||||
| 184 | 103 | ▶ | sub _normal_path { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_normal_path: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 103 | my ($path) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||
| 187 | 103 | $path =~ s{(?<=.)/+\z}{}; | |||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | 103 | return $path; | |||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||