This file is indexed.

/usr/share/perl5/CipUX/Cfg/Client.pm is in libcipux-perl 3.4.0.13-4.

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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
package CipUX::Cfg::Client;

use strict;
use warnings;
use Carp;
use Class::Std;
use Data::Dumper;
use English qw( -no_match_vars );
use Getopt::Long;
use Log::Log4perl qw(get_logger :levels);
use Pod::Usage;
use YAML::Any;
use base qw(CipUX);

{

    use version; our $VERSION = qv('3.4.0.13');
    delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};

    # CONST
    Readonly::Scalar my $EMPTY_STRING => q{};

    # GLOBAL
    my %opt = ();

    my $cfg_space_dispatch_hr = {
        all               => \&all_cfg,
        cipux             => \&cipux_cfg,
        storage_structure => \&storage_structure_cfg,
        storage_access    => \&storage_access_cfg,
        storage           => \&storage_cfg,
        object_coupling   => \&object_coupling_cfg,
        object_object     => \&object_object_cfg,
        object_basis      => \&object_basis_cfg,
        object            => \&object_cfg,
        task_api          => \&task_api_cfg,
        task              => \&task_cfg,
    };
    my $cfg_format_dispatch_hr = {
        hash => \&as_hash,
        yaml => \&as_yaml,
    };

    # ENVIRONMENT
    Getopt::Long::Configure("bundling");

    GetOptions( \%opt, "debug|D", "hash", "yaml" )
        or pod2usage(
        -exitstatus => 2,
        -msg        => "Problems parsing command line options!\n"
        );

    sub run {

        my $self = shift;
        my $arg  = 'all';

        if ( not scalar @ARGV ) {
            push @ARGV, 'all';
        }

        my $format
            = ( exists $opt{hash} and defined $opt{hash} ) ? 'hash' : 'yaml';

        foreach my $scope (@ARGV) {
            my $get    = $cfg_space_dispatch_hr->{$scope};
            my $cfg_ar = $self->$get;
            my $as     = $cfg_format_dispatch_hr->{$format};
            foreach my $cfg_hr ( @{$cfg_ar} ) {
                $self->out("# === CipUX scope $scope, format $format ===\n");
                my $n = $cfg_hr->{name};
                my $v = $cfg_hr->{value_hr};
                $self->out( $self->$as( { name => $n, value_hr => $v } ) );
            }
        }
        return;
    }

    sub cipux_cfg {
        my $self = shift;

        my $cfg_hr = $self->cfg;

        return [ { name => 'cipux', value_hr => $cfg_hr } ];
    }

    sub storage_structure_cfg {

        eval { require CipUX::Storage };
        if ( not $EVAL_ERROR ) {

            my $storage        = CipUX::Storage->new();
            my $storage_cfg_hr = $storage->get_storage_cfg();
            my $out_cfg_hr     = {};
            $out_cfg_hr->{structure} = $storage_cfg_hr;

            return [
                { name => 'storage_structure', value_hr => $out_cfg_hr } ];
        }
        return [];
    }

    sub storage_access_cfg {

        eval { require CipUX::Storage };
        if ( not $EVAL_ERROR ) {

            my $storage       = CipUX::Storage->new();
            my $access_cfg_hr = $storage->get_access_cfg();

            return [
                { name => 'storage_access', value_hr => $access_cfg_hr } ];
        }

        return [];

    }

    sub storage_cfg {

        my ( $self, $arg_r ) = @_;

        # will not show access per default
        #$self->storage_access_cfg;
        return $self->storage_structure_cfg;

    }

    sub object_coupling_cfg {

        eval { require CipUX::Object::Action };
        if ( not $EVAL_ERROR ) {
            my $object          = CipUX::Object::Action->new();
            my $coupling_cfg_hr = $object->get_coupling_cfg();

            return [
                { name => 'object_coupling', value_hr => $coupling_cfg_hr } ];
        }

        return [];
    }

    sub object_object_cfg {

        eval { require CipUX::Object::Action };
        if ( not $EVAL_ERROR ) {
            my $object        = CipUX::Object::Action->new();
            my $object_cfg_hr = $object->get_object_cfg();

            return [
                { name => 'object_object', value_hr => $object_cfg_hr } ];
        }

        return [];
    }

    sub object_basis_cfg {

        eval { require CipUX::Object::Action };
        if ( not $EVAL_ERROR ) {
            my $object       = CipUX::Object::Action->new();
            my $basis_cfg_hr = $object->get_basis_cfg();

            return [ { name => 'object_basis', value_hr => $basis_cfg_hr } ];
        }

        return [];
    }

    sub object_cfg {
        my ( $self, $arg_r ) = @_;

        my @array = ();
        push @array, @{ $self->object_coupling_cfg };
        push @array, @{ $self->object_object_cfg };
        push @array, @{ $self->object_basis_cfg };

        return \@array;
    }

    sub task_api_cfg {

        eval { require CipUX::Task };
        if ( not $EVAL_ERROR ) {
            my $task            = CipUX::Task->new();
            my $task_api_cfg_hr = $task->get_task_api_cfg();
            my $out_cfg_hr      = {};
            $out_cfg_hr->{task_api} = $task_api_cfg_hr;

            return [ { name => 'task_api', value_hr => $out_cfg_hr } ];
        }

        return [];
    }

    sub task_cfg {
        my ( $self, $arg_r ) = @_;

        return $self->task_api_cfg;
    }

    sub all_cfg {
        my ( $self, $arg_r ) = @_;

        my @array = ();
        push @array, @{ $self->cipux_cfg };
        push @array, @{ $self->storage_cfg };
        push @array, @{ $self->object_cfg };
        push @array, @{ $self->task_cfg };

        return \@array;

    }

    sub as_yaml {
        my ( $self, $arg_r ) = @_;
        my $hr
            = ( exists $arg_r->{value_hr} and $self->h( $arg_r->{value_hr} ) )
            ? $arg_r->{value_hr}
            : $self->perr('value_hr');
        my $name
            = ( exists $arg_r->{name} and defined $arg_r->{name} )
            ? $self->l( $arg_r->{name} )
            : $self->perr('name');

        return YAML::Any::Dump($hr);
    }

    sub as_hash {
        my ( $self, $arg_r ) = @_;
        my $hr
            = ( exists $arg_r->{value_hr} and $self->h( $arg_r->{value_hr} ) )
            ? $arg_r->{value_hr}
            : $self->perr('value_hr');
        my $name
            = ( exists $arg_r->{name} and defined $arg_r->{name} )
            ? $self->l( $arg_r->{name} )
            : $self->perr('name');
        $Data::Dumper::Varname = $name;
        return Dumper($hr);
    }

}

1;

__END__

=pod

=for stopwords CipUX Kuelker perr VARNAME API exc STDERR config getopt homedir lf LDAP lp li latin UTF UTF-8 login STDOUT TODO cfg

=head1 NAME

CipUX::Cfg::Client - Common CipUX configuration client

=head1 VERSION

version 3.4.0.13

=head1 SYNOPSIS

  use CipUX::Cfg::Client;

  my $ ccfg = $CipUX::Cfg::Client->new;


=head1 DESCRIPTION

Provides CLI for displaying CipUX configuarations of differents scopes.

=head1 CONSTRUCTOR

=head2 new

Constructor

  my $trait = CipUX::Cfg::Client->new;

=head1 SUBROUTINES/METHODS

The following functions will be exported by CipUX::Cfg::Client.

=head2 run
=head2 cipux_cfg
=head2 storage_structure_cfg
=head2 storage_access_cfg
=head2 storage_cfg
=head2 object_coupling_cfg
=head2 object_object_cfg
=head2 object_basis_cfg
=head2 object_cfg
=head2 task_api_cfg
=head2 task_cfg
=head2 all_cfg
=head2 as_yaml
=head2 as_hash

=head1 DIAGNOSTICS

=head2 Problems parsing command line options!


=head1 CONFIGURATION AND ENVIRONMENT

Not applicable.

=head1 DEPENDENCIES

 CipUX
 Class::Std
 Data::Dumper
 English
 Getopt::Long
 Log::Log4perl
 Pod::Usage
 Readonly
 YAML::Any
 version

=head1 INCOMPATIBILITIES

Not known.

=head1 BUGS AND LIMITATIONS

Not known.

=head1 SEE ALSO

See the CipUX web page and the manual at L<http://www.cipux.org>

See the mailing list L<http://sympa.cipworx.org/wws/info/cipux-devel>

=head1 AUTHOR

Christian Kuelker  E<lt>christian.kuelker@cipworx.orgE<gt>

=head1 LICENSE AND COPYRIGHT

Copyright (C) 2010 by Christian Kuelker

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA

=cut