/usr/lib/perl5/GSSAPI/Status.pm is in libgssapi-perl 0.28-1build2.
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 | package GSSAPI::Status;
require 5.005_62;
use strict;
use warnings;
use overload
'bool' => "is_true",
'!' => "is_false",
'""' => "stringify";
our @ISA = qw(GSSAPI);
sub import { 1 } # for GSSAPI::import()
sub generic_message ($) {
my $self = shift;
display_status($self->major, GSSAPI::GSS_C_GSS_CODE);
}
sub specific_message ($) {
my $self = shift;
display_status($self->minor, GSSAPI::GSS_C_MECH_CODE);
}
sub is_true ($$$) {
my $self = shift;
! GSS_ERROR($self->major)
}
sub is_false ($$$) {
my $self = shift;
GSS_ERROR($self->major)
}
sub stringify ($$$) {
my $self = shift;
join("\n", $self->generic_message, $self->specific_message, '')
}
# Autoload methods go after =cut, and are processed by the autosplit program.
1;
__END__
=head1 NAME
GSSAPI::Status - methods for handlings GSSAPI statuses
=head1 SYNOPSIS
use GSSAPI;
$status = GSSAPI::Status->new(GSS_S_COMPLETE, 0);
if (GSS_ERROR($status->major)) {
die "a horrible death";
}
if (! $status) { # another way of writing the above
die "a horrible death";
}
$status = $some_GSSAPI->someop($args1, etc);
if ($status) {
foreach ($status->generic_message, $status->specific_message) {
print "GSSAPI error: $_\n";
}
die "help me";
}
=head1 DESCRIPTION
C<GSSAPI::Status> objects are returned by most other GSSAPI operations.
Such statuses consist of a GSSAPI generic code and, for most
operations, a mechanism specific code. These numeric codes can be
accessed via the methods C<major> and C<minor>. The standard textual
messages that go with the current status can be obtained via the
C<generic_message> and C<specific_message> methods. Each of these
returns a list of text which should presumably be displayed in
order.
The generic code part of a GSSAPI::Status is composed of three
subfields that can be accessed with the C<GSS_CALLING_ERROR>,
C<GSS_ROUTINE_ERROR>, and C<GSS_SUPPLEMENTARY_INFO> functions. The
returned values can be compared against the constants whose names
start with C<GSS_S_> if your code wants to handle particular errors
itself. The C<GSS_ERROR> function returns true if and only if the
given generic code contains neither a calling error nor a routine
error.
When evaluated in a boolean context, a C<GSSAPI::Status> object
will be true if and only if the major status code is C<GSS_S_COMPLETE>.
When evaluated in a string contect, a C<GSSAPI::Status> object will
return the generic and specific messages all joined together with
newlines. This may or may not make C<die $status> work usefully.
=head1 BUGS
The base objects are currently implmented as a blessed C structure
containing the major and minor status codes. It should probably
be a blessed array or hash instead, thereby cutting down on the
amount of C code involved and making it more flexible.
=head1 AUTHOR
Philip Guenther <pguen@cpan.org>
=head1 SEE ALSO
perl(1)
RFC2743
=cut
|