This file is indexed.

/usr/share/perl5/NetApp/Qtree.pm is in libnetapp-perl 500.002-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
package NetApp::Qtree;

our $VERSION = '500.002';
$VERSION = eval $VERSION;  ##  no critic: StringyEval

use strict;
use warnings;
use English;
use Carp;

use Class::Std;
use Params::Validate qw( :all );
use Regexp::Common;

{

    my %filer_of	:ATTR( get => 'filer' );

    my %volume_name_of	:ATTR( get => 'volume_name' );

    my %name_of		:ATTR( get => 'name' );
    my %security_of	:ATTR( get => 'security' );
    my %oplocks_of	:ATTR( get => 'oplocks' );
    my %status_of	:ATTR( get => 'status' );
    my %id_of		:ATTR( get => 'id' );
    my %vfiler_of	:ATTR( get => 'vfiler' );

    sub BUILD {

        my ($self,$ident,$args_ref) = @_;

        my @args = %$args_ref;

        my (%args) 	= validate( @args, {
            filer	=> { isa	=> 'NetApp::Filer' },
            volume_name => { type	=> SCALAR },
            name	=> { type	=> SCALAR },
            security	=> { type	=> SCALAR },
            oplocks	=> { type	=> SCALAR },
            status	=> { type	=> SCALAR },
            id		=> { type	=> SCALAR },
            vfiler	=> { type	=> SCALAR,
                             optional	=> 1 },
        });        

        $filer_of{$ident}	= $args{filer};
        $volume_name_of{$ident}	= $args{volume_name};

        $name_of{$ident}	= $args{name};
        $security_of{$ident}	= $args{security};
        $oplocks_of{$ident}	= $args{oplocks};
        $status_of{$ident}	= $args{status};
        $id_of{$ident}		= $args{id};

        if ( $args{vfiler} ) {
            $vfiler_of{$ident}	= $args{vfiler};
        }

    }

    sub get_volume {
        my $self	= shift;
        return $self->get_filer->get_volume( $self->get_volume_name );
    }

    sub get_aggregate {
        return shift->get_volume->get_aggregate;
    }

    sub set_security {

        my $self	= shift;
        my $ident	= ident $self;
        my $security	= shift;

        if ( $security !~ /^(unix|ntfs|mixed)$/ ) {
            croak("Invalid qtree security value: $security\n");
        }

        my $name	= $self->get_name;

        $self->get_filer->_run_command(
            command    	=> [qw( qtree security ), $name, $security ],
        );

        $security_of{$ident}	= $security;

    }

    sub set_oplocks {

        my $self	= shift;
        my $ident	= ident $self;

        my $state	= shift;

        my $enable	= $state ? 'enable' : 'disable';

        my $name	= $self->get_name;

        $self->get_filer->_run_command(
            command    	=> [qw( qtree oplocks ), $name, $enable ],
        );

        $oplocks_of{$ident}	= $enable eq 'enable' ? 1 : 0;

    }

    sub get_temporary_exports {
        return grep { $_->get_type eq 'temporary' } shift->get_exports;
    }

    sub get_permanent_exports {
        return grep { $_->get_type eq 'permanent' } shift->get_exports;
    }

    sub get_active_exports {
        return grep { $_->get_active } shift->get_exports;
    }

    sub get_inactive_exports {
        return grep { not $_->get_active } shift->get_exports;
    }

    sub get_export {
        my $self	= shift;
        my ($path)	= validate_pos( @_, { type => SCALAR } );
        return grep { $_->get_path eq $path } $self->get_exports;
    }

    sub get_exports {

        my $self	= shift;

        my @exports	= ();

        foreach my $export ( $self->get_filer->get_exports ) {

            if ( $export->get_path eq $self->get_name ) {
                push @exports, $export;
            } elsif ( $export->get_actual eq $self->get_name ) {
                push @exports, $export;
            }

        }

        return @exports;

    }

}

sub _parse_qtree_status_qtree {

    my $class		= shift;
    my $line		= shift;

    my $qtree		= {};

    my @data		= split( /\s+/, $line );

    $qtree->{volume_name} = shift @data;

    $qtree->{name}	= "/vol/$qtree->{volume_name}";

    if ( $data[0] !~ /^(unix|ntfs|mixed)$/ ) {
        $qtree->{name}	.= "/" . shift @data;
    }

    $qtree->{security}	= $data[0];
    $qtree->{oplocks}	= $data[1] eq 'enabled' ? 1 : 0;
    $qtree->{status}	= $data[2];
    $qtree->{id}       	= $data[3];

    if ( $data[4] ) {
        $qtree->{vfiler}	= $data[4];
    }

    return $qtree;

}

1;