AFS

 view release on metacpan or  search on metacpan

INSTALL_64  view on Meta::CPAN


    If it says
                'Your Perl is 'Non-Threaded Perl'
    then you need the standard system libraries and you can skip to
    the next section (BUILDING & INSTALLING).

    If it says
                Your Perl is 'Threaded Perl'
    then you need the PIC type system libraries.  Unfortunately the
    PIC type system libraries are not created for OpenAFS 1.4.X by
    default.  Therefore you have to patch your OpenAFS installation.

    This is the sequence of commands to build the PIC type system libraries:

        gunzip AFS-<version>.tar.gz
        tar xvf AFS-<version>.tar
        cd openafs-1.4.X
        patch < AFS-<version>/openafs-pic.patch
        make clean
        make
        make install

examples/v2/vos/listvol  view on Meta::CPAN

$vos = AFS::VOS->new;
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n" and die;

my $partlist = $vos->listvol($server, $part, $fast, $extend);
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n" and die;

if    ($fast)      { print_fast($partlist); }
elsif ($extend)    { print_ext($partlist); }
elsif ($Debugging) { print_debug($partlist); }
elsif ($long)      { print_long($partlist); }
else { print_default($partlist); }

sub print_fast {
    my $partlist = shift;

    my $totvol = 0;
    foreach my $part (sort keys %$partlist) {
        foreach my $vol (sort keys %{$partlist->{$part}}) {
            if    ($vol =~ /totalBusy/)  { next; }
            elsif ($vol =~ /totalNotOK/) { next; }
            $totvol++;

examples/v2/vos/listvol  view on Meta::CPAN

                }
                print "\n";
            }
        }
        print "\ttotalOK: $partlist->{$part}->{' totalOK'}\n";
        print "\ttotalBusy: $partlist->{$part}->{' totalBusy'}\n";
        print "\ttotalNotOK: $partlist->{$part}->{' totalNotOK'}\n";
    }
}

sub print_default {
    my $partlist = shift;

    my $totvol = 0;
    foreach my $part (sort keys %$partlist) {
        print "List of volumes on server $server Partition $part: \n";
        foreach my $vol (sort keys %{$partlist->{$part}}) {
            if    ($vol =~ /totalOK/)      { next; }
            elsif ($vol =~ /totalBusy/)    { next; }
            elsif ($vol =~ /totalNotOK/)   { next; }
            elsif ($vol =~ /volume_busy/)  {

pod/v2/afsperlacl.pod  view on Meta::CPAN


This class provides methods to handle the B<AFS Access Control Lists>
(ACL).  It is used to create, modify, delete, and reset ACL instances.
It has methods to retrieve and to set the ACL list for directories and
its files.

These methods have the optional argument FOLLOW.  FOLLOW determines
which file should be used should PATH be a symbolic link.  If FOLLOW be
set to 1, then the symbolic link is followed to its target.  If FOLLOW
is set to 0, then the method applies to the symbolic link itself.  If
not specified FOLLOW defaults to 1.

=head1 COMPATIBILITY

B<This release does NOT support any features and interfaces
from version 1.>

=head1 METHODS

=over 4

pod/v2/afsperlbos.pod  view on Meta::CPAN

=item B<$bos = AFS::BOS-E<gt>new(SERVER [, NOAUTH [, LOCALAUTH [, CELL [, ENCRYPT]]]]);>

Creates a new object of the class AFS::BOS and establishes a
connection to the Basic Overseer Server running on the SERVER machine.
An AFS::BOS object is essentially a handle to talk to the Basic
Overseer Server.  Internally an AFS::BOS object is a pointer to a
rx_connection structure, although this may change and the value
returned from AFS::BOS::new should always be treaded as an opaque
handle.

Set LOCALAUTH (default 0) to 1 only when issuing a command on a server
machine.  If NOAUTH is 1 (default 0) it establishes an unauthenticated
connection to the server, in which the server treats the issuer as an
unprivileged user.  CELL (default NULL) specifies the cell in which to
run the command.  Set ENCRYPT (default 1) to 0 if you want to use an
unencrypted connection. HANDLE WITH CARE!

=item B<DESTRUCTOR>

=item S< >

=item B<$bos-E<gt>DESTROY;>

Destroys the connection to the Basic Overseer Server and frees the
rx_connection structure.

pod/v2/afsperlbos.pod  view on Meta::CPAN

=item B<INSTANCE METHODS>

=item S< >

=item B<$ok = $bos-E<gt>addhost(HOST [, CLONE]);>

=item B<$ok = $bos-E<gt>addhost(\@HOST [, CLONE]);>

Adds the given HOST to the local C<CellServDB> file.  HOST is either a
scalar value or a reference to an array of hosts.  If CLONE is set to
1 (default 0) the ubik vote of this host does not count.  This
argument is only available under OpenAFS.  It calls the AFS system
library function I<BOZO_AddCellHost>.

=item B<$ok = $bos-E<gt>addkey(KVNO [, STRING]);>

B<NOT YET RELEASED>

Constructs a server encryption key from the text STRING provided,
assigns it the key version number KVNO, and adds it to the local
C<KeyFile> file.  If STRING is omitted, the BOS Server prompts for the

pod/v2/afsperlbos.pod  view on Meta::CPAN

containing the list of database server machines.  It calls the AFS
system library function I<BOZO_Listhost>.

You can find an example how to print the entire content of the array
reference C<$HOSTS> in the C<examples/v2/bos> directory.

=item B<my($DATE, $KEYS) = $bos-E<gt>listkeys([SHOW]);>

Returns the DATE when a key was last added to the local C<KeyFile>
file and the hash reference KEYS containing the server encryption keys.
The hash keys are the key version numbers.  Set SHOW to 1 (default
0) to see the octal digits that constitute each key.  It calls the AFS
system library function I<BOZO_Listkeys>.

You can find an example how to print the entire content of the hash
reference C<$KEYS> in the C<examples/v2/bos> directory.

=item B<@users = $bos-E<gt>listusers;>

Returns an array containing a list of the privileged users from the
local C<UserList> file.  It calls the AFS system library function
I<BOZO_ListSUsers>.

=item B<$ok = $bos-E<gt>prune([All [,BAK [, OLD [, CORE]]]]);>

Removes files from the local disk of the server machine.

Set BAK to 1 (default 0) to remove all files from the local
C</usr/afs/bin> directory that have a C<BAK> extension.

Set OLD to 1 (default 0) to remove all files from the local
C</usr/afs/bin> directory that have an C<OLD> extension.

Set CORE to 1 (default 0) to remove all files from the local
C</usr/afs/logs> directory that have a C<core> prefix.

Set ALL to 1 (default 0) to remove all three types of files at once.

If none of these flags are set, no files are removed, but a warning
message is displayed.  It calls the AFS system library function
I<BOZO_Prune>.

=item B<$ok = $bos-E<gt>removehost(HOST);>

=item B<$ok = $bos-E<gt>removehost(\@HOST);>

Removes the database server machine HOST from the local C<CellServDB>

pod/v2/afsperlbos.pod  view on Meta::CPAN

B<Cautions>

Use this method only when installing the cell's first AFS server
machine. The I<AFS Quick Beginnings> documentation explains how to
copy over the C<ThisCell> and C<CellServDB> files from this or another
appropriate machine during installation of additional server machines.

=item B<$ok = $bos-E<gt>setrestart(TIME [, GENERAL [, NEWBINARY]]);>

Sets the restart TIME at which the BOS Server restarts processes.  Set
GENERAL to 1 (default 0) to set the restart time of the BOS Server to
TIME.  This TIME is once per week.  Set NEWBINARY to 1 (default 0) to
set the binary restart time.  The TIME is once per day.  Only one of
the arguments GENERAL and NEWBINARY can be set.  It calls the AFS
system library function I<BOZO_SetRestartTime>.

=item B<$ok = $bos-E<gt>setrestricted(MODE);>

Enables (MODE = 1) or disables (MODE = 0) the I<restricted mode> for
the BOS server which disables certain bosserver functionality.  This
method is only available under OpenAFS if the AFS system libraries were
compiled with the I<Restricted Mode Option>.  It calls the AFS system
library function I<BOZO_SetRestrictedMode>.

=item B<$ok = $bos-E<gt>shutdown([SERVER, ] [WAIT]);>

=item B<$ok = $bos-E<gt>shutdown([\@SERVER, ] [WAIT]);>

Stops on the server machine either all running server processes,
excluding the BOS server process or the SERVER process.  SERVER is
either a scalar value or a reference to an array of process names.  It
does not change its status flag in the local C<BosConfig> file but
only in the BOS Server's memory.  Set WAIT to 1 (default 0) to delay
the program flow until all processes actually stop. Otherwise the
method returns almost immediately even if all processes are not
stopped.  It calls the AFS system library function I<BOZO_WaitAll>.

=item B<$ok = $bos-E<gt>start(SERVER);>

=item B<$ok = $bos-E<gt>start(\@SERVER);>

Sets the I<status flag> for each SERVER process to I<Run> in the local
C<BosConfig> file and in the BOS Server's memory on the server

pod/v2/afsperlbos.pod  view on Meta::CPAN

library function I<BOZO_StartupAll> or I<BOZO_SetTStatus>.

=item B<$STATUS = $bos-E<gt>status([LONG [, SERVER]]);>

=item B<$STATUS = $bos-E<gt>status([LONG [, \@SERVER]]);>

Returns the STATUS of either all server processes listed in the local
C<BosConfig> file or the process SERVER.  SERVER is either a scalar
value or a reference to an array of process names.  STATUS is a hash
reference containing the current process status.  Set LONG to 1
(default 0) to get extended information about the process status.  It
calls the AFS system library function I<BOZO_GetStatus>.

You can find an example how to print the entire content of the hash
reference C<$STATUS> in the C<examples/v2/bos> directory.

=item B<$ok = $bos-E<gt>stop(SERVER [, WAIT]);>

=item B<$ok = $bos-E<gt>stop(\@SERVER [, WAIT]);>

Sets the status flag for each SERVER process to I<NotRun> in the local
C<BosConfig> file on the server machine, then stops it.  SERVER is
either a scalar value or a reference to an array of process names.
Set WAIT to 1 (default 0) to delay the program flow until all
processes actually stop. Otherwise the method returns almost
immediately even if all processes are not stopped.  It calls the AFS
system library function I<>.

=back

=head1 AUTHORS

The code and documentation for this class were contributed by Stanford
Linear Accelerator Center, a department of Stanford University.  This

pod/v2/afsperlcell.pod  view on Meta::CPAN


This module provides several functions to configure and to maintain an
B<AFS cell>.  It is used to maintain the configuration directory.  Any
function required must by explicitly listed by the C<use> statement to be
exported into the calling package.

Some of these functions have the optional argument FOLLOW.  FOLLOW
determines which file should be used should PATH be a symbolic link.  If
FOLLOW be set to 1, then the symbolic link is followed to its target.
If FOLLOW is set to 0, then the function applies to the symbolic link
itself.  If not specified FOLLOW defaults to 1.

=head1 COMPATIBILITY

B<This release does NOT support any features and interfaces
from version 1.>

=head1 EXPORTS

=head2 Standard Exports

pod/v2/afsperlcell.pod  view on Meta::CPAN

# stores in kernel memory for its home cell and foreign cells.

# Iterates through the Cache Manager's internal cell configuration,
# using INDEX as an index. The index starts at 0. $AFS::CODE will
# be set to a non-zero value when passed an invalid index. If IP is
# set to 1 then IP addresses will be returned instead of hostnames.
# Displays each database server machine's IP address rather than hostname.

=item B<($cell @servers) = getcellinfo([CELL [,IP]]);>

Gets information on CELL (default NULL) using CellServDB. If IP (default
0) is set to 1 then IP addresses will be returned instead of hostnames.

=item B<$cellname = localcell;>

Returns the cellname of the local cell. Returns undef on error.

=item B<$cellname = whichcell(PATH [,FOLLOW]);>

Returns the name of the cell in which the volume that houses PATH
resides.  Returns undef and sets CODE on error.

pod/v2/afsperlcm.pod  view on Meta::CPAN

This module provides several functions to administer the B<AFS Cache
Manager>. It is used to customize the cache size. You can force the
update of cached data.  And you can determine if a client machine can
run SETUID programs.  Any function required must by explicitly listed
by the C<use> statement to be exported into the calling package.

Some of these functions have the optional argument FOLLOW.  FOLLOW
determines which file should be used should PATH be a symbolic link.  If
FOLLOW be set to 1, then the symbolic link is followed to its target.
If FOLLOW is set to 0, then the function applies to the symbolic link
itself.  If not specified FOLLOW defaults to 1.

=head1 COMPATIBILITY

B<This release does NOT support any features and interfaces
from version 1.>

=head1 EXPORTS

=head2 Standard Exports

pod/v2/afsperlcm.pod  view on Meta::CPAN


# does not work properly ???

# =item B<$ok = checkservers(FAST [, CELL [, IP]]);>

# Reports whether certain AFS server machines are accessible from the
# local client machine.  If the FAST flag is set to 1, the Cache Manager
# does not probe any machines, but instead reports the results of the most
# recent previous probe.  If the CELL argument is included, only machines
# that are marked inaccessible and belong to the specified CELL are
# listed.  If IP (default 0) is set to 1 then IP addresses will be
# returned instead of hostnames.

=item B<$ok = checkvolumes;>

Forces the Cache Manager to update volume-related information.

=item B<$ok = cm_access(PATH [, PERMS [,FOLLOW]]);>

Returns 1 if caller has access with the given permissions PERMS (default
'read') to given PATH.

=item B<$ok = flush(PATH [, FOLLOW]);>

Forces the Cache Manager to discard PATH.

=item B<$ok = flushcb(PATH [, FOLLOW]);>

Forces the Cache Manager to flush only the callback for PATH.

pod/v2/afsperlcm.pod  view on Meta::CPAN

containing PATH.

=item B<($max, $inuse) = getcacheparms;>

Returns the current size of the cache and the amount being used.

=item B<$setuid = getcellstatus([CELL]);>

Determines whether the local Cache Manager allows SETUID programs to run
or not.  Returns 1 if SETUID programs are allowed for given CELL
(default local).

=item B<$crypt_flg = getcrypt;>

Gets the Cache Manager encryption flag.  This function is supported only
under OpenAFS.

=item B<$volinfo = getvolstats(PATH [, FOLLOW]);>

Returns information about the volume containing PATH.  The return
value is a reference to a hash table containing the values from the C

pod/v2/afsperlcm.pod  view on Meta::CPAN

You can find an example how to print the entire content of the
returned hash reference in the C<examples/v2/cm> directory.

=item B<$ok = setcachesize(NUM);>

Sets the size of the disk cache. NUM is size in 1K byte blocks

=item B<$ok = setcellstatus(SETUID_ALLOWED [,CELL]);>

Enables or disables the local Cache Manager to run SETUID programs for
the given CELL (default local).

=item B<$ok = setcrypt(FLAG);>

Set the Cache Manager encryption flag to FLAG. Valid values are 'on' or
'off'.  This function is supported only under OpenAFS.

=back

=head1 CURRENT AUTHOR

pod/v2/afsperlfs.pod  view on Meta::CPAN

server>.  It is used to check the status of a file server machine.  It
has functions to administer mount points and quotas.  On request it
returns the server(s) that house a given file or directory.  Any
function required must by explicitly listed by the C<use> statement to be
exported into the calling package.

Some of these functions have the optional argument FOLLOW.  FOLLOW
determines which file should be used should PATH be a symbolic link.  If
FOLLOW be set to 1, then the symbolic link is followed to its target.
If FOLLOW is set to 0, then the function applies to the symbolic link
itself.  If not specified FOLLOW defaults to 1.

=head1 COMPATIBILITY

B<This release does NOT support any features and interfaces
from version 1.>

=head1 EXPORTS

=head2 Standard Exports

pod/v2/afsperlfs.pod  view on Meta::CPAN


=item B<$volume = lsmount(PATH [,FOLLOW]);>

Returns the volume name for which PATH is a mount point.  The last
element in PATH must be an actual name, not a shorthand notation such
as one or two periods (. or ..).  If PATH is not a mount point or is
not in AFS it returns undef and an error code is set.

=item B<$ok = mkmount(PATH, VOLUME [, RW [, CELL]]);>

Creates a given mount point PATH for the VOLUME. If RW (default 0) is
set to 1 it creates a read/write mount point otherwise a regular mount
point.  If CELL (default NULL) is set, the cell indicator appears in the
mount point.

=item B<$ok = rmmount(PATH);>

Removes a given mount point PATH. If it was not successful it returns 0
and an error code is set.

=item B<$ok = setquota(PATH, QUOTA [,FOLLOW]);>

Sets the QUOTA (maximum possible size) of the read/write volume that
contains PATH.

=item B<@hosts = whereis(PATH [,IP [,FOLLOW]]);>

Returns the name of each file server machine housing PATH.  If IP
(default 0) is set to 1 then IP addresses will be returned instead of
hostnames.

=back

=head1 CURRENT AUTHOR

Norbert E. Gruener E<lt>nog@MPA-Garching.MPG.deE<gt>

=head1 AUTHOR EMERITUS

pod/v2/afsperlkas.pod  view on Meta::CPAN


=over 4

=item B<CONSTRUCTOR>

=item S< >

=item B<$kas = AFS::KAS-E<gt>AuthServerConn(TOKEN, SERVICE [, CELL]);>

Creates a new object of the class AFS::KAS and establishes connections
to all the Authentication Servers in a given CELL (default null).  An
AFS::KAS object is essentially a handle to talk to the Authentication
Server.  Internally an AFS::KAS object is a pointer to a ubik_client
structure, although this may change and the value returned should always
be treaded as an opaque handle.  A TOKEN may or may not be needed
depending on the SERVICE.  TOKEN must be an instance of AFS::KTC_TOKEN.
Possible values for SERVICE are

   &AFS::KA_MAINTENANCE_SERVICE
   &AFS::KA_AUTHENTICATION_SERVICE
   &AFS::KA_TICKET_GRANTING_SERVICE

It calls the AFS system library function 'ka_AuthServerConn'.

=item B<$kas = AFS::KAS-E<gt>SingleServerConn(HOST, TOKEN, SERVICE [, CELL]);>

Creates a new object of the class AFS::KAS and establishes a connection
to only one Authentication Server running on HOST in a given CELL
(default null).  An AFS::KAS object is essentially a handle to talk to
the Authentication Server.  Internally an AFS::KAS object is a pointer
to a ubik_client structure, although this may change and the value
returned should always be treaded as an opaque handle.  A TOKEN may or
may not be needed depending on the SERVICE.  TOKEN must be an instance
of AFS::KTC_TOKEN.  Possible values for SERVICE are

   &AFS::KA_MAINTENANCE_SERVICE

It calls the AFS system library function 'ka_SingleServerConn'.

pod/v2/afsperlkas.pod  view on Meta::CPAN


   &AFS::KAMAJORVERSION

It calls the AFS system library function 'KAM_Getstats'.

=item B<$token = $kas-E<gt>GetToken(SNAME, SINST, STIME, ETIME, AUTH_TOKEN [, AUTH_CELL]);>

Return a token for the specified service SNAME.SINST.  The desired
ticket lifetime is specified by STIME and ETIME (given in 5 minute
intervals). AUTH_TOKEN must be a ticket for the ticket­granting
service (an instance of AFS::KTC_TOKEN) in the cell AUTH_CELL (default
null). It assumes that a connection to the AuthServer has already been
established.  It calls the AFS system library function 'ka_GetToken'.

=item B<($name, $inst) = $kas-E<gt>listentry(PREV, INDX, COUNT);>

=item B<($name, $inst) = $kas-E<gt>KAM_ListEntry(PREV, INDX, COUNT);>

Returns the name and instance of an entry in the database.  It provides
a way to step through all the entries in the database. The first call
should be made with previous index PREV set to zero. The method updates

pod/v2/afsperlkas.pod  view on Meta::CPAN

   &AFS::KAFNORMAL    regular user
   &AFS::KAFADMIN     an administrator
   &AFS::KAFNOTGS     not allow principal to get or use TGT
   &AFS::KAFNOSEAL    not allow principal as server in GetTicket
   &AFS::KAFNOCPW     not allow principal to change its own key
   &AFS::KAFNEWASSOC  allow user to create associates

EXPIRE is the epoch time after which attempts to authenticate as this user
will fail. The LIFETIME can be set to limit the lifetime of an
authentication ticket created for a user (unit is secs). MAXASSOC
defaults to -1.  PACKED is an array of four bytes. It contains

  PACKED[0]: password lifetime; range must be [0..254] days; 0 = infinity
  PACKED[1]: password reuse; [1 = yes], [2 = no], [0 = not changed]
  PACKED[2]: numb of failed logins; (fail - 1) tries are allowed; 0 = infinity
  PACKED[3]: lock time, must be set in units of 8.5 minutes; 0 = infinity

This call requires a connection encrypted with an AdminTicket.  It
calls the AFS system library function 'KAM_SetFields'.

=back

pod/v2/afsperlktck.pod  view on Meta::CPAN


=item B<$key = AFS::KTC_EKEY-E<gt>des_string_to_key(STRING);>

The STRING string is converted to a DES encryption key and this key is
returned as an AFS::KTC_EKEY object.  It calls the AFS system library
function 'des_string_to_key'.

=item B<$key = AFS::KTC_EKEY-E<gt>ReadPassword(PROMPT [, VERIFY [, CELL]]);>

Prints out a PROMPT and reads a string from the terminal, turning off
echoing.  If VERIFY (default 0) is set to 1 it requests that the string
be entered again and the two strings are compared.  CELL defaults to
NULL. The string is then converted to a DES encryption key and the
encryption key is returned as an AFS::KTC_EKEY object.  It calls the AFS
system library function 'ka_ReadPassword'.

=item B<$key = AFS::KTC_EKEY-E<gt>StringToKey(PASSWD, CELL);>

The PASSWD string is converted to a DES encryption key and this key is
returned as an AFS::KTC_EKEY object.  It calls the AFS system library
function 'ka_StringToKey'.

pod/v2/afsperlktct.pod  view on Meta::CPAN

=item B<CONSTRUCTOR>

=item S< >

=item B<$ok = AFS::KTC_TOKEN-E<gt>GetAuthToken(USER, EKEY, LIFE [, PWEXP]);>

Creates a token for the service KA_TICKET_GRANTING_SERVICE (a ticket
granting ticket, TGT) for a particular USER and saves it in the memory
(kernel token cache).  EKEY contains the user's encryption key and
LIFE indicates how long the token will be valid (in seconds, given in
5 minute intervals).  If PWEXP (default -1) is given it returns the
number of days till the password expires. USER must be an instance of
AFS::KTC_PRINCIPAL and EKEY an instance of AFS::KTC_EKEY. B<This
method must be performed first before you can get any service token
(method GetServerToken)>.  This method calls the AFS system library
function 'ka_GetAuthToken'.

=item B<$token = AFS::KTC_TOKEN-E<gt>GetServerToken(SERVICE, LIFE [, NEWTK]);>

Returns a token for the specified SERVICE.  LIFE indicates how long
the token will be valid (in seconds, given in 5 minute intervals). If
NEWTK is set to 1 (default), then the function should get a new token
if necessary. SERVICE must be an instance of AFS::KTC_PRINCIPAL.  It
requires that you already possess a TGT (method GetAuthToken).  It
calls the AFS system library function 'ka_GetServerToken'.

=item B<$token = AFS::KTC_TOKEN-E<gt>GetAdminToken(USER, EKEY, LIFE [, NEWTK [, REASON]]);>

Creates an administration token for the specified USER. It saves the
token in the memory (kernel token cache) and additionally it returns
the token.  EKEY contains the encryption key and LIFE indicates how
long the token will be valid (in seconds, given in 5 minute
intervals). If NEWTK is set to 1 (default), then the function should
get a new token if necessary.  On error the error message is returned
in REASON. USER must be an instance of AFS::KTC_PRINCIPAL and EKEY an
instance of AFS::KTC_EKEY.  It calls the AFS system library function
'ka_GetAdminToken'.

=item B<$token = AFS::KTC_TOKEN-E<gt>nulltoken;>

Returns a NULL token. This token is only for use with the KAS methods
C<AuthServerConn> and C<SingleServerConn>. Do not use it with any other
methods or functions.

pod/v2/afsperlktct.pod  view on Meta::CPAN

=item B<$ok = AFS::KTC_TOKEN-E<gt>UserAuthenticateGeneral(USER, PASSWORD, LIFE, FLAGS [, PWEXP [, REASON]]);>

Undertakes all necessary steps for a complete authentication of
principal USER.  It converts the string PASSWORD (the cleartext
password) for the principal USER to an encryption key. Then it creates
a TGT token. After that it asks for a service token for service I<AFS>
with a life time of LIFE (in seconds, given in 5 minute intervals).
Finally it saves the service token in the memory (kernel token cache).

Possible values for FLAGS are C<KA_USERAUTH_VERSION> and
C<KA_USERAUTH_DOSETPAG>.  If PWEXP (default -1) is given it returns the
number of days till the password expires.  On error the error message
is returned in REASON. It calls the AFS system library function
'ka_UserAuthenticateGeneral'.

=item B<$ok = AFS::KTC_TOKEN-E<gt>ForgetAllTokens;>

Discards all of the issuer's tokens.  It calls the AFS system library
function 'ktc_ForgetAllTokens'.

=item B<$token = AFS::KTC_TOKEN-E<gt>FromString(STRING);>

pod/v2/afsperlpts.pod  view on Meta::CPAN

=item S< >

=item B<$pts = AFS::PTS-E<gt>new(([SEC [, CELL]]);>

Creates a new object of the class AFS::PTS.  An AFS::PTS object is
essentially a handle to talk to the Protection Server in a given
CELL.  Internally an AFS::PTS object is a pointer to a ubik_client
structure, although this may change and the value returned from
AFS::PTS::new should always be treaded as an opaque handle.

CELL defaults to NULL.  The security level SEC (default 1) is a number
from 0 to 2:

   0    un-authenticated connection should be made
   1    try authenticated first, fall back to un-authenticated
   2    fail if an authenticated connection can't be made

=item B<DESTRUCTOR>

=item S< >

pod/v2/afsperlpts.pod  view on Meta::CPAN


Converts the five PTS privacy bits BITS into its corresponding privacy
flags (a string of five characters).  The privacy flags indicate who
can display or administer certain aspects of a PTS entry.

=item B<$value = AFS::PTS-E<gt>convert_numeric_names;>

=item B<AFS::PTS-E<gt>convert_numeric_names(NEWVAL);>

Gets or sets the global flag for converting names into numeric AFS ids.
If conversion is 'on' (default) all names NOT looking like a numeric
value are converted into its AFS id. If you set NEWVAL to 0 (conversion
is 'off'), B<NO> conversion is done.  You'll probably want to leave
conversion 'on' unless you create PTS names that look exactly like
numbers. (not a good idea to begin with :-)

=item S< >

=item B<INSTANCE METHODS> (high-level)

All high-level methods will accept either numeric AFS ids or AFS user

pod/v2/afsperlpts.pod  view on Meta::CPAN

or 'PR_NewEntry'.

=item B<$ok = $pts-E<gt>delete(NAME);>

Deletes the entry NAME.  It calls the AFS system library function
'PR_Delete'.

=item B<$entry = $pts-E<gt>dumpentry(POS [, LOOKUP_ID [, CONV]]);>

Returns a reference to a hash table containing the values from the C
structure C<prdebugentry>. If LOOKUP_ID is 1 (default) then the AFS ids
in the hash table will be converted to names. If CONV is 1 (default)
then flags will be converted to its ASCII representation.  It calls
the AFS system library function 'PR_DumpEntry'.

=item B<@members = $pts-E<gt>getcps(NAME [, LOOKUP_ID [, OVER]]);>

Returns the I<Current Protection Subdomain> (CPS) for the given PTS
id. The CPS is the closure of all identities that the given NAME can
use. This list includes all the groups NAME belongs to, the special
AFS ids (system:anyuser and system:authuser), as well as the id
itself. If LOOKUP_ID is 1 (default) then names will be returned.  If
the size of the list is greater then &AFS::PR_MAXGROUPS then OVER will
be set to a non-zero value and only &AFS::PR_MAXGROUPS items will be
returned.  It calls the AFS system library function 'PR_GetCPS'.

=item B<$id = $pts-E<gt>id($NAME [, ANON]]);>

=item B<@id = $pts-E<gt>id(\@NAME [, ANON]]);>

=item B<$idref = $pts-E<gt>id(\%NAME [, ANON]]);>

Converts the NAME into a AFS id. The first method returns a single
id. The second method takes a reference to an array of names and
returns an array of ids. The third method takes a reference to a hash
table, the keys of which are names, and returns a reference to the
B<same hash>, with the ids as the value of each key.

If ANON is 1 (default) and a given name does not map into an id then
the value &AFS::ANONYMOUSID will be returned. If ANON is 0 then the id
will be set to undef.  It calls the AFS system library function
'PR_NameToID'.

=item B<$ok = $pts-E<gt>ismember(NAME, GROUP);>

Returns a non-zero value if NAME is a member of GROUP.  It calls the
AFS system library function 'PR_IsAMemberOf'.

=item B<$entry = $pts-E<gt>listentry(NAME [, LOOKUP_ID [, CONV]]);>

Returns a reference to a hash table containing the values from the C
structure C<prcheckentry>.  If LOOKUP_ID is 1 (default) then the PTS
ids in the hash table will be converted to names. If CONV is 1
(default) then flags will be converted to its ASCII representation.
It calls the AFS system library function 'PR_ListEntry'.

=item B<($uid, $gid) = $pts-E<gt>listmax;>

Returns the largest allocated user ID and group ID.  It calls the AFS
system library function 'PR_ListMax'.

=item B<@members = $pts-E<gt>members(NAME [, LOOKUP_ID [, OVER]]);>

Returns the list of groups in which the user NAME is a member. If NAME
is a group, this method returns a list of users which are in that
group. If LOOKUP_ID is 1 (default) then names will be returned.  If
the size of the list is greater then &AFS::PR_MAXGROUPS then OVER will
be set to a non-zero value and only &AFS::PR_MAXGROUPS items will be
returned.  It calls the AFS system library function 'PR_ListElements'.

=item B<$name = $pts-E<gt>name(ID [, ANON]]);>

=item B<@name = $pts-E<gt>name(ID [, ANON]]);>

=item B<$nameref = $pts-E<gt>name(ID [, ANON]]);>

Converts AFS ID into a name. The first method returns a single
name. The second method takes a reference to an array of ids and
returns an array of names. The third method takes a reference to a
hash table, the keys of which are ids, and returns a reference to the
B<same hash>, with the names as the value of each key.  If ANON is 1
(default) and a given id does not map into a name then the id value
will be converted to a string (i.e, 11234 => "11234").

If ANON is 0 then the name will be set to undef.  It calls the AFS
system library function 'PR_IDToName'.

=item B<@members = $pts-E<gt>owned(NAME [, LOOKUP_ID [, OVER]]);>

Returns a list of AFS ids owned by the given user or group NAME.  If
NAME is 0, then the PDB orphan list is returned. There is also a
global orphan list, which contains entries for all orphans, namely
groups belonging to users that have been deleted from the PDB. If
LOOKUP_ID is 1 (default) then names will be returned.  If the size of
the list is greater then &AFS::PR_MAXGROUPS then OVER will be set to a
non-zero value and only &AFS::PR_MAXGROUPS items will be returned.  It
calls the AFS system library function 'PR_ListOwned'.

=item B<$ok = $pts-E<gt>rename(NAME, NEWNAME);>

Renames NAME into NEWNAME.  It calls the AFS system library function
'PR_ChangeEntry'.

=item B<$ok = $pts-E<gt>removeuser(NAME, GROUP);>

pod/v2/afsperlpts.pod  view on Meta::CPAN

Sets the privacy flags for the given entry NAME to NEWFLAG.  It calls
the AFS system library function 'PR_SetFieldsEntry'.

=item B<$ok = $pts-E<gt>setgroupquota(NAME, NGROUPS);>

Sets the group creation quota for NAME to NGROUPS.  It calls the AFS
system library function 'PR_SetFieldsEntry'.

=item B<$max = $pts-E<gt>setmax(ID [, ISGROUP]);>

If ISGROUP is 0 (default) then the maximum id number for user is set
to ID. Otherwise the maximum id number of groups is set to ID.  It
calls the AFS system library function 'PR_SetMax'.

=item B<$pos = $pts-E<gt>whereisit(NAME);>

Returns the PDB byte offset of NAME. This method is used in
conjunction with the method 'dumpentry'.  It calls the AFS system
library function 'PR_WhereIsIt'.

=item S< >

pod/v2/afsperlutils.pod  view on Meta::CPAN


=over 4

=item B<$version = XSVERSION;>

Reports the version number of the underlying XS file.

=item B<$version = get_server_version(SERVER [, HOST [, VERBOSE]]);>

Reports the version number of the SERVER process running at HOST
(default localhost). If VERBOSE (default 0) is set to 1 some program
trace is printed.

=item B<$version = get_syslib_version;>

Reports the version number of the underlying AFS system library.

=item B<$ok = setpag;>

Creates a new command shell (owned by the issuer of the command) and
associates a new process authentication group (PAG) with the shell and

pod/v2/afsperlvldb.pod  view on Meta::CPAN

=item S< >

=item B<$vldb = AFS::VLDB-E<gt>new([VERBOSE [, TIMEOUT [, NOAUTH [, LOCALAUTH [, CELL [, ENCRYPT]]]]]);>

Creates a new object of the class AFS::VLDB.  An AFS::VLDB object is
essentially a handle to talk to the Volume Location Server.
Internally an AFS::VLDB object is a pointer to a ubik_client
structure, although this may change and the value returned from
AFS::VLDB::new should always be treaded as an opaque handle.

Set VERBOSE (default 0) to 1 to produce on the standard output stream
a detailed trace of the method's execution.  TIMEOUT is the time of
inactivity in seconds before the connection to the VLDB server is
declared dead (default 90 seconds).  Set LOCALAUTH (default 0) to 1
only when issuing a command on a server machine.  If NOAUTH is 1
(default 0) it establishes an unauthenticated connection to the
server, in which the servers treat the issuer as an unprivileged user.
CELL (default NULL) specifies the cell in which to run the
command. Set ENCRYPT to 1 (default 0) to encrypt the connection to the
VLDB server.

=item B<DESTRUCTOR>

=item S< >

=item B<$vldb-E<gt>DESTROY;>

Destroys the ubik connection to the Volume Location Server and frees the
ubik_client structure.

pod/v2/afsperlvldb.pod  view on Meta::CPAN

ID number) in the VLDB to SERVER and PARTITION.  This method is only
available with OpenAFS.  It calls the AFS system library function
I<UV_ChangeLocation>.

=item B<($succ, $fail) = $vldb-E<gt>delentry(VOLUME [, NOEXECUTE]);>

=item B<($succ, $fail) = $vldb-E<gt>delentry(\@VOLUME [, NOEXECUTE]);>

Removes the VLDB entry for each specified VOLUME.  VOLUME is either a
scalar value or a reference to an array of volume names or of volume
ids.  If you set NOEXECUTE to 1 (default 0) then the volume name is
just printed but NOT deleted.  It returns the number of successfully
deleted volumes and the number of failed volumes.  It calls the
AFS system library function I<VL_DeleteEntry>.

B<Cautions>

Do not use this method to remove a volume in normal circumstances; it
does not remove a volume from the file server machine, and so is
likely to make the VLDB inconsistent with state of the volumes on
server machines. Use the AFS::VOS remove method to remove both the
volume and its VLDB entry.

=item B<($succ, $fail) = $vldb-E<gt>delgroups(PREFIX, SERVER, PARTITION [, NOEXECUTE]);>

Removes the VLDB entries for groups of volumes.  PREFIX specifies a
certain character string for the beginning of the volume name. SERVER
specifies the file server machine and PARTITION specifies the
partition name where the volumes where sitting.  If you specify an
empty string for either PREFIX, SERVER, or PARTITION it is considered
as a wild card option for this argument.  If you set NOEXECUTE to 1
(default 0) then the volume name is just printed but NOT deleted.  It
returns the number of successfully deleted volumes and the number of
failed volumes.  It calls the AFS system library function
I<VL_DeleteEntry>.

B<Cautions>

Do not use this method to remove a volume in normal circumstances; it
does not remove a volume from the file server machine, and so is
likely to make the VLDB inconsistent with state of the volumes on
server machines. Use the AFS::VOS remove method to remove both the
volume and its VLDB entry.

=item B<@addrlist = $vldb-E<gt>listaddrs([HOST [, UUID [, NORESOLVE [, PRINTUUID]]]]);>

Returns all server entries from the VLDB.  An entry is created as the
File Server initializes and registers the contents of its local
C<sysid> file in the VLDB.  The return value is an array of hashes.
If you specify HOST or UUID only the entry for this HOST or UUID is
returned.  If you set NORESOLVE (default 0) to 1, only the IP address
is returned.  If you set PRINTUUID (default 0) to 1, the UUID (AFS'
internal host representation) for each server is also returned.

It calls the AFS system library function I<VL_GetAddrs> or
I<VL_GetAddrsU>.

B<Important Hint>

In version 2.4.1 the hash key names for "NAME" and "IP" have changed.
The new names are now "NAME-x" and "IP-x" where "x" is {1,2,3,...}.

pod/v2/afsperlvldb.pod  view on Meta::CPAN

   machine as the site for a volume: specify the SERVER argument.

 * Every VLDB entry that mentions a certain partition on any
   file server machine as the site for a volume: specify the
   PARTITION argument.

 * Every VLDB entry that mentions a certain partition on a
   certain file server machine as the site for a volume:
   combine the SERVER and PARTITION arguments.

If you set LOCK (default 0) to 1 it returns only locked VLDB
entries. This flag can be combined with the SERVER argument, the
PARTITION argument, or both.

It calls the AFS system library function I<VolumeInfoCmd>.

You can find an example how to print the entire content of the
returned hash reference in the C<examples/v2/vldb> directory.

=item B<$vldblist = $vldb-E<gt>listvldbentry(VOLUME);>

pod/v2/afsperlvos.pod  view on Meta::CPAN

=item S< >

=item B<$vos = AFS::VOS-E<gt>new([VERBOSE [, TIMEOUT [, NOAUTH [, LOCALAUTH [, CELL [, ENCRYPT]]]]]);>

Creates a new object of the class AFS::VOS.  An AFS::VOS object is
essentially a handle to talk to the Volume Server.  Internally an
AFS::VOS object is a pointer to a ubik_client structure, although this
may change and the value returned from AFS::VOS::new should always be
treaded as an opaque handle.

Set VERBOSE (default 0) to 1 to produce on the standard output stream
a detailed trace of the method's execution.  TIMEOUT is the time of
inactivity in seconds before the connection to the VOS server is
declared dead (default 90 seconds).  Set LOCALAUTH (default 0) to 1
only when issuing a command on a server machine.  If NOAUTH is 1
(default 0) it establishes an unauthenticated connection to the
server, in which the servers treat the issuer as an unprivileged user.
CELL (default NULL) specifies the cell in which to run the
command. Set ENCRYPT to 1 (default 0) to encrypt the connection to the
VOS server.

=item B<DESTRUCTOR>

=item S< >

=item B<$vos-E<gt>DESTROY;>

Destroys the ubik connection to the Volume Server and frees the
ubik_client structure.

pod/v2/afsperlvos.pod  view on Meta::CPAN

   partition on every file server machine.

 * In PREFIX a character string or regular expression is specified.
   A volume whose name includes the string is placed on the set of
   volumes to be cloned.

 * In XPREFIX a character string or regular expression is specified.
   A volume whose name includes the string is removed from the set of
   volumes to be cloned.

If EXCLUDE (default 0) is set to 1 it reverses the meaning of the
PREFIX or XPREFIX argument.  It returns two array references
containing a list of SUCCESSfully backed up site name and a list of
site name which are FAILED to backup. If DRYRUN (default 0) is set to
1 then SUCCESS contains a list of the volumes to be cloned, without
actually cloning them.

It calls the AFS system library function I<UV_BackupVolume>.

=item B<$volid = $vos-E<gt>create(SERVER, PARTITION, VOLUME [, MAXQUOTA [, VOLID, ROVOLID]]);>

Creates a read/write VOLUME at the site specified by the SERVER and
PARTITION arguments.  The volume's space quota is set to 5000 kilobyte
blocks by default. Use the MAXQUOTA argument to specify a different
quota.

VOLID specifies the volume ID for the read/write volume. If this
argument is not specified, or the given volume ID is 0, a volume ID
will be allocated for the volume automatically. The volume IDs
allocated should be fine for almost all cases, so you should almost
never need to specify this argument.

ROVOLID specifies the volume ID for the readonly volume corresponding
to the read/write volume that is being created. The readonly volume
will not be created; this merely specifies what volume ID the readonly
volume will use when it is created. If a volume ID of 0 is specified
here, no readonly volume ID will be assigned to the created volume
immediately. A readonly volume ID can still be assigned later when
B<vldb->addsite> is run; if a volume does not have a readonly volume
ID associated with it by the time B<vos->:release> is run, a volume ID
will be allocated for it.  If this argument is not specified, the
default readonly volume ID is one number higher than the read-write
volume ID, whether or not that ID was manually specified.  As with the
B<VOLID> argument, the default allocated volume IDs should be sufficient
for almost all cases, so you should almost never need to specify this
argument.

These two arguments (VOLID, ROVOLID) are supported when the AFS Perl
modules are linked with the OpenAFS system libraries v1.4.12 or later.

It returns the volume id number of the new volume.  It calls the AFS
system library function I<UV_CreateVolume2> or I<UV_CreateVolume3>
(OpenAFS v.1.4.12 or later).

=item B<$ok = $vos-E<gt>dump(VOLUME [, TIME [, FILE [, SERVER, PARTITION, CLONE_FLG, OMIT_FLG]]]);>

Converts the contents of the indicated volume, which can be
read/write, read-only or backup, into ASCII format.  VOLUME specifies
either the complete name or volume ID number of the volume.  The
Volume Server writes the converted contents to the FILE or to the
standard output stream (default).  To dump the complete contents of a
volume (create a full dump), set TIME to 0 (default). To create an
incremental dump, which includes only the files and directories in the
volume that have modification timestamps later than a certain time,
specify a date and time as the value for the TIME argument.  By
default, the VL server consults the Volume Location Database (VLDB) to
learn the volume's location.  To dump the read-only volume from a
particular site, use the SERVER and PARTITION arguments to specify the
site.

If CLONE_FLG is set to 1 (default 0), it will clone the volume first
and then dumps the clone.  This can significantly decrease the amount
of time the volume is kept locked for dumps of large volumes.  By
default, it includes all directory objects in an incremental dump
whether they’ve been changed or not.

If the OMIT_FLG is set to 1 (default 0), unchanged directories will be
omitted.  This will reduce the size of the dump and not cause problems
if the incremental is restored, as expected, on top of a volume
containing the correct directory structure (such as one created by
restoring previous full and incremental dumps).

B<These two flags are supported with OpenAFS system libraries 1.4.5 or
later.>

It calls the AFS system library function I<UV_DumpVolume>.

pod/v2/afsperlvos.pod  view on Meta::CPAN

returned depends on the combination of arguments supplied when the
method is applied. To get volume header information for various
numbers of volumes, combine the arguments as indicated:

 * For every volume on a file server machine, specify the SERVER
   argument.

 * For every volume at a particular site, combine the SERVER argument
   with the PARTITION argument.

If you set EXTENDED (default 0) to 1, it returns extensive statistics
about access patterns for each volume.  If you set FAST (default 0) to
1, it returns only the volume IDs and the numbers of volumes.

The return value is a reference to a hash table containing the values
from the C structure C<volintinfo>.  The hash table has the following
keys

       backupID    cloneID     creationDate
       dayUse      inUse       maxquota
       parentID    server      size
       status      type        updateDate

pod/v2/afsperlvos.pod  view on Meta::CPAN

Moves the indicated read/write volume from its current site FSERVER,
FPARTITION to the destination site TSERVER, TPARTITION.  VOLUME
specifies either the complete name or volume ID number of the volume.
It returns the volume id number of the moved volume.  It calls the AFS
system library function I<UV_MoveVolume>.

=item B<$ok = $vos-E<gt>offline(SERVER, PARTITION, VOLUME [, BUSY, SLEEP]);>

Takes the specified volume offline.  VOLUME specifies either the
complete name or volume ID number of the volume.  If you set BUSY
(default 0) to 1 the volume will be marked as I<busy> for the
specified SLEEP seconds.  It calls the AFS system library function
I<UV_SetVolume>.

=item B<$ok = $vos-E<gt>online(SERVER, PARTITION, VOLUME);>

Brings the specified volume online.  VOLUME specifies either the
complete name or volume ID number of the volume.  It calls the AFS
system library function I<UV_SetVolume>.

=item B<$partinfo = $vos-E<gt>partinfo( SERVER [, PARTITION]);>

pod/v2/afsperlvos.pod  view on Meta::CPAN


It calls the AFS system library function I<UV_ListPartitions>.

You can find an example how to print the entire content of the
returned hash reference in the C<examples/v2/vos> directory.

=item B<$ok = $vos-E<gt>release(VOLUME [, FORCE]);>

Copies the contents of the indicated read/write source volume to each
read-only site.  VOLUME specifies either the complete name or volume
ID number of the volume.  If FORCE (default 0) is set to 1, a complete
release is enforced.  It calls the AFS system library function
I<UV_ReleaseVolume>.

=item B<$volid = $vos-E<gt>remove(VOLUME [, SERVER, PARTITION]);>

Removes the indicated volume.  VOLUME specifies either the complete
name or volume ID number of the volume.  To remove the read-only
volume from a particular site, specify the SERVER and PARTITION
arguments. It returns the volume id number of the removed volume.  It
calls the AFS system library function I<UV_DeleteVolume>.

=item B<$ok = $vos-E<gt>rename(ONAME, NNAME);>

Changes the name of the read/write volume from ONAME to NNAME.
It calls the AFS system library function I<UV_RenameVolume>.

=item B<$ok = $vos-E<gt>restore(SERVER, PARTITION, VOLUME [, DUMPFILE [, ID [, INTER [, OVERWRITE [, OFFLINE [, READONLY]]]]]] );>

Converts the ASCII file DUMPFILE or the standard input stream
(default) and restores it as a read/write VOLUME to the PARTITION on
the SERVER.  ID specifies the volume ID number to assign to the
restored volume.  OVERWRITE must be specified when overwriting an
existing volume.  The following values are possible:

=over 4

=item B<a> to abort the restore operation.

=item B<f> if restoring a full dump file.

=item B<i> if restoring an incremental dump file.

=back

Set OFFLINE (default 0) to 1 to leave restored volume offline.  Set
READONLY (default 0) to 1 to make the restored volume read-only.

If the VOLUME already exists, the OVERWRITE argument is omitted, and
the INTER argument (default 0) is set to 1 the method is interactively
prompting for the type of restore (exactly like the I<vos restore>
command).

It calls the AFS system library function I<UV_RestoreVolume>.

=item B<$ok = $vos-E<gt>setquota(VOLUME, QUOTA [, CLEAR]);>

Sets the QUOTA for the specified volume.  Specify the number of
one-kilobyte blocks as a positive integer (1024 is one megabyte).
VOLUME specifies either the complete name or volume ID number of the
volume.  Set CLEAR (default 0) to 1 to clear the access counter on the
VOLUME, shown on the B<examine> method.  It calls the AFS system
library function I<UV_SetVolumeInfo>.

=item B<$stat = $vos-E<gt>status(SERVER);>

Reports on what the Volume Server on a certain file SERVER machine is
doing at the moment the method is performed.
It calls the AFS system library function I<UV_VolserStatus>.

=item B<$volid = $vos-E<gt>zap(SERVER, PARTITION, ID [, FORCE [, BACKUP]]);>

Removes the specified volume ID number of the volume from the site
defined by the SERVER and PARTITION arguments, without attempting to
change the corresponding Volume Location Database (VLDB) entry.  Set
FORCE (default 0) to 1 to remove the volume even though it cannot be
attached (brought online). Use this flag only after the failure of
previous attempts to remove the volume. Set BACKUP (default 0) to 1 to
remove the backup version of the read/write volume.  It returns the
volume id number of the removed volume.
It calls the AFS system library function I<UV_VolumeZap>.

=back

=head1 AUTHORS

The code and documentation for this class were contributed by Stanford
Linear Accelerator Center, a department of Stanford University.  This

src/AFS.pm  view on Meta::CPAN


@KTC = qw (
           ktc_ForgetAllTokens
           ktc_GetToken
           ktc_ListTokens
           ktc_SetToken
           ktc_principal
           newprincipal
);

# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
@EXPORT = (@CELL, @MISC, @PTS, @CM, @ACL, @KA, @KTC);

# Other items we are prepared to export if requested
@EXPORT_OK = qw(
                raise_exception
                constant
                convert_numeric_names
                error_message
               );

src/AFS.xs  view on Meta::CPAN

          sprintf(buffer,
                  "VOLSER: no such volume - location specified incorrectly or volume does not exist\n");
          break;
      case VOLSERMULTIRWVOL:
          sprintf(buffer,
                  "VOLSER: multiple RW volumes with same ID, one of which should be deleted\n");
          break;
      case VOLSERFAILEDOP:
          sprintf(buffer, "VOLSER: not all entries were successfully processed\n");
          break;
      default:
          sprintf(buffer, "Unknown ERROR code\n");
          break;
    }
    return 0;
}

#ifdef AFS_PTHREAD_ENV
void IOMGR_Sleep (seconds)
  int seconds;
{

src/AFS.xs  view on Meta::CPAN

	    if (c >= '1' && c < ('1' + NBRA)) {
		*ep++ = CBACK;
		*ep++ = c - '1';
		continue;
	    }
	    *ep++ = CCHR;
	    *ep++ = c;
	    continue;

	  defchar:
	default:
	    *ep++ = CCHR;
	    *ep++ = c;
	}
    }
}

/* 
 * match the argument string against the compiled re
 */
int

src/AFS.xs  view on Meta::CPAN

	    goto star;

	  star:
	    do {
		lp--;
		if (rv = advance(lp, ep))
		    return (rv);
	    } while (lp > curlp);
	    return (0);

	default:
	    return (-1);
	}
}

static int
backref(register int i, register char *lp)
{
    register char *bp;

    bp = braslist[i];

src/AFS.xs  view on Meta::CPAN

	switch (scIndex) {
	case 0:
	    sc = rxnull_NewClientSecurityObject();
	    break;
	case 2:
	    sc = rxkad_NewClientSecurityObject(gen_rxkad_level,
					       &ttoken.sessionKey,
					       ttoken.kvno, ttoken.ticketLen,
					       ttoken.ticket);
	    break;
	default:
            sprintf(buffer, "%s: unsupported security index %d\n",
		    funcName, scIndex);
	    code = 1;
            VSETCODE(code, buffer);
            return (code);
	    break;
	}
    }

    afsconf_Close(tdir);

    if (secproc)	/* tell UV module about default authentication */
	(*secproc) (sc, scIndex);
    if (server) {
	serverconns[0] = rx_NewConnection(server, port,
					  usrvid, sc, scIndex);
    } else {
	if (info.numServers > maxservers) {
            char buffer[256];
            sprintf(buffer,
		    "%s: info.numServers=%d (> maxservers=%d)\n",
		    funcName, info.numServers, maxservers);

src/AFS.xs  view on Meta::CPAN

  error_exit:
    if (buffer)
        free(buffer);
    return (error);
}

afs_int32 DumpFunction(call, filename)
    struct rx_call *call;
    char *filename;
{
    usd_handle_t ufd;           /* default is to stdout */
    afs_int32 error = 0, code;
    afs_hyper_t size;
    long blksize;
    int ufdIsOpen = 0;

    /* Open the output file */
    if (!filename || !*filename) {
        usd_StandardOutput(&ufd);
        blksize = 4096;
        ufdIsOpen = 1;

src/AFS.xs  view on Meta::CPAN

    }

    struct afsconf_cell info;

    /* next call expands cell name abbrevs for us and handles looking up
     * local cell */
    *code = internal_GetCellInfo(tname, (char *) 0, &info);
    if (*code) {
        char buffer[256];
        sprintf(buffer, "AFS::BOS %d (can't find cell '%s' in cell database)",
                *code, (tname ? tname : "<default>"));
        BSETCODE(code, buffer);
        /*             printf("bos DEBUG-5\n"); */
        return NULL;
    }

    strcpy(sname.cell, info.name);
    sname.instance[0] = 0;
    strcpy(sname.name, "afs");
    sc[0] = (struct rx_securityClass *) rxnull_NewClientSecurityObject();
    sc[1] = 0;

src/AFS.xs  view on Meta::CPAN

              break;
          case 'F':
              *rights |= PRSFS_USR5;
              break;
          case 'G':
              *rights |= PRSFS_USR6;
              break;
          case 'H':
              *rights |= PRSFS_USR7;
              break;
          default:
              return EINVAL;
        }
        p++;
    }
    return 0;
}

static int32 canonical_parse_rights(buffer, rights)
    char *buffer;
    int32 *rights;

src/AFS.xs  view on Meta::CPAN

            count++;
            type = 2;
        }
        if (count > 1) {
            char buffer[80];
            sprintf(buffer, "AFS::BOS: can't specify more than one restart time at a time\n");
            BSETCODE(-1, buffer);
            goto done;
        }
        if (count == 0)
            type = 1;                   /* by default set general restart time */

        if (code = ktime_ParsePeriodic(time, &restartTime)) {
            char buffer[240];
            sprintf(buffer, "AFS::BOS: failed to parse '%s' as periodic restart time(%s)\n",
                    time, em(code));
            BSETCODE(code, buffer);
            goto done;
        }

        code = BOZO_SetRestartTime(self, type, &restartTime);

src/AFS.xs  view on Meta::CPAN

        }
        else {
            safefree(t);
            switch (code) {
              case KABADREQUEST:
                  message = "password was incorrect";
                  break;
              case KAUBIKCALL:
                  message = "Authentication Server was unavailable";
                  break;
              default:
                  message = (char *) error_message(code);
            }
            sv_setpv(ST(4), message);
        }

    }


void
afs_ka_GetAuthToken(p,key,lifetime,pwexpires=-1)

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"AFSCONF_NOCELL")) sv_setiv(ST(0),AFSCONF_NOCELL);
                else if (strEQ(name,"AFSCONF_NODB")) sv_setiv(ST(0),AFSCONF_NODB);
                else if (strEQ(name,"AFSCONF_NOTFOUND")) sv_setiv(ST(0),AFSCONF_NOTFOUND);
                else if (strEQ(name,"AFSCONF_SYNTAX")) sv_setiv(ST(0),AFSCONF_SYNTAX);
                else if (strEQ(name,"AFSCONF_UNKNOWN")) sv_setiv(ST(0),AFSCONF_UNKNOWN);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'N':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"ANONYMOUSID")) sv_setiv(ST(0),ANONYMOUSID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                case 'Y':
                if (strEQ(name,"ANYUSERID")) sv_setiv(ST(0),ANYUSERID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'U':
                switch (name[2]) {
                case 'T':
                if (strEQ(name,"AUTHUSERID")) sv_setiv(ST(0),AUTHUSERID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'C':
        switch (name[1]) {
        case 'O':
                switch (name[2]) {
                case 'S':
                if (strEQ(name,"COSIZE")) sv_setiv(ST(0),COSIZE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'R':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"CROSS_CELL")) sv_setiv(ST(0),CROSS_CELL);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'K':
        switch (name[1]) {
        case 'A':
                switch (name[2]) {
                case 'A':
                if (strEQ(name,"KAANSWERTOOLONG")) sv_setiv(ST(0),KAANSWERTOOLONG);

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"KA_TICKET_GRANTING_SERVICE")) sv_setiv(ST(0),KA_TICKET_GRANTING_SERVICE);
                else if (strEQ(name,"KA_USERAUTH_DOSETPAG")) sv_setiv(ST(0),KA_USERAUTH_DOSETPAG);
                else if (strEQ(name,"KA_USERAUTH_DOSETPAG2")) sv_setiv(ST(0),KA_USERAUTH_DOSETPAG2);
                else if (strEQ(name,"KA_USERAUTH_VERSION")) sv_setiv(ST(0),KA_USERAUTH_VERSION);
                else if (strEQ(name,"KA_USERAUTH_VERSION_MASK")) sv_setiv(ST(0),KA_USERAUTH_VERSION_MASK);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'T':
                switch (name[2]) {
                case 'C':
                if (strEQ(name,"KTC_TIME_UNCERTAINTY")) sv_setiv(ST(0),KTC_TIME_UNCERTAINTY);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'M':
        switch (name[1]) {
        case 'A':
                switch (name[2]) {
                case 'X':
                if (strEQ(name,"MAXKAKVNO")) sv_setiv(ST(0),MAXKAKVNO);
                else if (strEQ(name,"MAXKTCNAMELEN")) sv_setiv(ST(0),MAXKTCNAMELEN);
                else if (strEQ(name,"MAXKTCREALMLEN")) sv_setiv(ST(0),MAXKTCREALMLEN);
                else if (strEQ(name,"MAXKTCTICKETLEN")) sv_setiv(ST(0),MAXKTCTICKETLEN);
                else if (strEQ(name,"MAXKTCTICKETLIFETIME")) sv_setiv(ST(0),MAXKTCTICKETLIFETIME);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'I':
                switch (name[2]) {
                case 'N':
                if (strEQ(name,"MINKTCTICKETLEN")) sv_setiv(ST(0),MINKTCTICKETLEN);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'N':
        switch (name[1]) {
        case 'E':
                switch (name[2]) {
                case 'V':
                if (strEQ(name,"NEVERDATE")) sv_setiv(ST(0),NEVERDATE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'P':
        switch (name[1]) {
        case 'R':
                switch (name[2]) {
                case 'A':
                if (strEQ(name,"PRACCESS")) sv_setiv(ST(0),PRACCESS);

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"PR_NUMBER_OPCODES")) sv_setiv(ST(0),PR_NUMBER_OPCODES);
                else if (strEQ(name,"PR_REMEMBER_TIMES")) sv_setiv(ST(0),PR_REMEMBER_TIMES);
                else if (strEQ(name,"PR_SF_ALLBITS")) sv_setiv(ST(0),PR_SF_ALLBITS);
                else if (strEQ(name,"PR_SF_NGROUPS")) sv_setiv(ST(0),PR_SF_NGROUPS);
                else if (strEQ(name,"PR_SF_NUSERS")) sv_setiv(ST(0),PR_SF_NUSERS);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'R':
        switch (name[1]) {
        case 'X':
                switch (name[2]) {
                case 'K':
                if (strEQ(name,"RXKADBADKEY")) sv_setiv(ST(0),RXKADBADKEY);

src/AFS.xs  view on Meta::CPAN

                break;
                case '_':
                if (strEQ(name,"RX_SCINDEX_KAD")) sv_setiv(ST(0),RX_SCINDEX_KAD);
                else if (strEQ(name,"RX_SCINDEX_NULL")) sv_setiv(ST(0),RX_SCINDEX_NULL);
                else if (strEQ(name,"RX_SCINDEX_VAB")) sv_setiv(ST(0),RX_SCINDEX_VAB);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'S':
        switch (name[1]) {
        case 'Y':
                switch (name[2]) {
                case 'S':
                if (strEQ(name,"SYSADMINID")) sv_setiv(ST(0),SYSADMINID);
                else if (strEQ(name,"SYSBACKUPID")) sv_setiv(ST(0),SYSBACKUPID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'U':
        switch (name[1]) {
        case 'B':
                switch (name[2]) {
                case 'A':
                if (strEQ(name,"UBADHOST")) sv_setiv(ST(0),UBADHOST);
                else if (strEQ(name,"UBADLOCK")) sv_setiv(ST(0),UBADLOCK);
                else if (strEQ(name,"UBADLOG")) sv_setiv(ST(0),UBADLOG);
                else if (strEQ(name,"UBADTYPE")) sv_setiv(ST(0),UBADTYPE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'D':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"UDONE")) sv_setiv(ST(0),UDONE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'E':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"UEOF")) sv_setiv(ST(0),UEOF);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'I':
                switch (name[2]) {
                case 'N':
                if (strEQ(name,"UINTERNAL")) sv_setiv(ST(0),UINTERNAL);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                case 'O':
                if (strEQ(name,"UIOERROR")) sv_setiv(ST(0),UIOERROR);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'L':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"ULOGIO")) sv_setiv(ST(0),ULOGIO);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'N':
                switch (name[2]) {
                case 'H':
                if (strEQ(name,"UNHOSTS")) sv_setiv(ST(0),UNHOSTS);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;

src/AFS.xs  view on Meta::CPAN

                case 'O':
                if (strEQ(name,"UNOENT")) sv_setiv(ST(0),UNOENT);
                else if (strEQ(name,"UNOQUORUM")) sv_setiv(ST(0),UNOQUORUM);
                else if (strEQ(name,"UNOSERVERS")) sv_setiv(ST(0),UNOSERVERS);
                else if (strEQ(name,"UNOTSYNC")) sv_setiv(ST(0),UNOTSYNC);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'S':
                switch (name[2]) {
                case 'Y':
                if (strEQ(name,"USYNC")) sv_setiv(ST(0),USYNC);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'T':
                switch (name[2]) {
                case 'W':
                if (strEQ(name,"UTWOENDS")) sv_setiv(ST(0),UTWOENDS);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'V':
        switch (name[1]) {
        case 'I':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"VIOCACCESS")) sv_setiv(ST(0),VIOCACCESS);

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"VIOC_GET_WS_CELL")) sv_setiv(ST(0),VIOC_GET_WS_CELL);
                else if (strEQ(name,"VIOC_SETCELLSTATUS")) sv_setiv(ST(0),VIOC_SETCELLSTATUS);
                else if (strEQ(name,"VIOC_SETSPREFS")) sv_setiv(ST(0),VIOC_SETSPREFS);
                else if (strEQ(name,"VIOC_TWIDDLE")) sv_setiv(ST(0),VIOC_TWIDDLE);
                else if (strEQ(name,"VIOC_VENUSLOG")) sv_setiv(ST(0),VIOC_VENUSLOG);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  default:
        ST(0) = ST(1) = &PL_sv_undef;
        return;
  }

  errno = 0;
  XSRETURN(1);
  return;
 }

#else

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"AFSCONF_NOCELL")) sv_setiv(ST(0),AFSCONF_NOCELL);
                else if (strEQ(name,"AFSCONF_NODB")) sv_setiv(ST(0),AFSCONF_NODB);
                else if (strEQ(name,"AFSCONF_NOTFOUND")) sv_setiv(ST(0),AFSCONF_NOTFOUND);
                else if (strEQ(name,"AFSCONF_SYNTAX")) sv_setiv(ST(0),AFSCONF_SYNTAX);
                else if (strEQ(name,"AFSCONF_UNKNOWN")) sv_setiv(ST(0),AFSCONF_UNKNOWN);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'N':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"ANONYMOUSID")) sv_setiv(ST(0),ANONYMOUSID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                case 'Y':
                if (strEQ(name,"ANYUSERID")) sv_setiv(ST(0),ANYUSERID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'U':
                switch (name[2]) {
                case 'T':
                if (strEQ(name,"AUTHUSERID")) sv_setiv(ST(0),AUTHUSERID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'C':
        switch (name[1]) {
        case 'O':
                switch (name[2]) {
                case 'S':
                if (strEQ(name,"COSIZE")) sv_setiv(ST(0),COSIZE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'K':
        switch (name[1]) {
        case 'A':
                switch (name[2]) {
                case 'A':
                if (strEQ(name,"KAANSWERTOOLONG")) sv_setiv(ST(0),KAANSWERTOOLONG);

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"KA_TICKET_GRANTING_SERVICE")) sv_setiv(ST(0),KA_TICKET_GRANTING_SERVICE);
                else if (strEQ(name,"KA_USERAUTH_DOSETPAG")) sv_setiv(ST(0),KA_USERAUTH_DOSETPAG);
                else if (strEQ(name,"KA_USERAUTH_DOSETPAG2")) sv_setiv(ST(0),KA_USERAUTH_DOSETPAG2);
                else if (strEQ(name,"KA_USERAUTH_VERSION")) sv_setiv(ST(0),KA_USERAUTH_VERSION);
                else if (strEQ(name,"KA_USERAUTH_VERSION_MASK")) sv_setiv(ST(0),KA_USERAUTH_VERSION_MASK);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'T':
                switch (name[2]) {
                case 'C':
                if (strEQ(name,"KTC_TIME_UNCERTAINTY")) sv_setiv(ST(0),KTC_TIME_UNCERTAINTY);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'M':
        switch (name[1]) {
        case 'A':
                switch (name[2]) {
                case 'X':
                if (strEQ(name,"MAXKAKVNO")) sv_setiv(ST(0),MAXKAKVNO);
                else if (strEQ(name,"MAXKTCNAMELEN")) sv_setiv(ST(0),MAXKTCNAMELEN);
                else if (strEQ(name,"MAXKTCREALMLEN")) sv_setiv(ST(0),MAXKTCREALMLEN);
                else if (strEQ(name,"MAXKTCTICKETLEN")) sv_setiv(ST(0),MAXKTCTICKETLEN);
                else if (strEQ(name,"MAXKTCTICKETLIFETIME")) sv_setiv(ST(0),MAXKTCTICKETLIFETIME);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'I':
                switch (name[2]) {
                case 'N':
                if (strEQ(name,"MINKTCTICKETLEN")) sv_setiv(ST(0),MINKTCTICKETLEN);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'N':
        switch (name[1]) {
        case 'E':
                switch (name[2]) {
                case 'V':
                if (strEQ(name,"NEVERDATE")) sv_setiv(ST(0),NEVERDATE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'P':
        switch (name[1]) {
        case 'R':
                switch (name[2]) {
                case 'A':
                if (strEQ(name,"PRACCESS")) sv_setiv(ST(0),PRACCESS);

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"PR_NUMBER_OPCODES")) sv_setiv(ST(0),PR_NUMBER_OPCODES);
                else if (strEQ(name,"PR_REMEMBER_TIMES")) sv_setiv(ST(0),PR_REMEMBER_TIMES);
                else if (strEQ(name,"PR_SF_ALLBITS")) sv_setiv(ST(0),PR_SF_ALLBITS);
                else if (strEQ(name,"PR_SF_NGROUPS")) sv_setiv(ST(0),PR_SF_NGROUPS);
                else if (strEQ(name,"PR_SF_NUSERS")) sv_setiv(ST(0),PR_SF_NUSERS);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'R':
        switch (name[1]) {
        case 'X':
                switch (name[2]) {
                case 'K':
                if (strEQ(name,"RXKADBADKEY")) sv_setiv(ST(0),RXKADBADKEY);

src/AFS.xs  view on Meta::CPAN

                break;
                case '_':
                if (strEQ(name,"RX_SCINDEX_KAD")) sv_setiv(ST(0),RX_SCINDEX_KAD);
                else if (strEQ(name,"RX_SCINDEX_NULL")) sv_setiv(ST(0),RX_SCINDEX_NULL);
                else if (strEQ(name,"RX_SCINDEX_VAB")) sv_setiv(ST(0),RX_SCINDEX_VAB);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'S':
        switch (name[1]) {
        case 'Y':
                switch (name[2]) {
                case 'S':
                if (strEQ(name,"SYSADMINID")) sv_setiv(ST(0),SYSADMINID);
                else if (strEQ(name,"SYSBACKUPID")) sv_setiv(ST(0),SYSBACKUPID);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'U':
        switch (name[1]) {
        case 'B':
                switch (name[2]) {
                case 'A':
                if (strEQ(name,"UBADHOST")) sv_setiv(ST(0),UBADHOST);
                else if (strEQ(name,"UBADLOCK")) sv_setiv(ST(0),UBADLOCK);
                else if (strEQ(name,"UBADLOG")) sv_setiv(ST(0),UBADLOG);
                else if (strEQ(name,"UBADTYPE")) sv_setiv(ST(0),UBADTYPE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'D':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"UDONE")) sv_setiv(ST(0),UDONE);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'E':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"UEOF")) sv_setiv(ST(0),UEOF);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'I':
                switch (name[2]) {
                case 'N':
                if (strEQ(name,"UINTERNAL")) sv_setiv(ST(0),UINTERNAL);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                case 'O':
                if (strEQ(name,"UIOERROR")) sv_setiv(ST(0),UIOERROR);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'L':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"ULOGIO")) sv_setiv(ST(0),ULOGIO);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'N':
                switch (name[2]) {
                case 'H':
                if (strEQ(name,"UNHOSTS")) sv_setiv(ST(0),UNHOSTS);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;

src/AFS.xs  view on Meta::CPAN

                case 'O':
                if (strEQ(name,"UNOENT")) sv_setiv(ST(0),UNOENT);
                else if (strEQ(name,"UNOQUORUM")) sv_setiv(ST(0),UNOQUORUM);
                else if (strEQ(name,"UNOSERVERS")) sv_setiv(ST(0),UNOSERVERS);
                else if (strEQ(name,"UNOTSYNC")) sv_setiv(ST(0),UNOTSYNC);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'S':
                switch (name[2]) {
                case 'Y':
                if (strEQ(name,"USYNC")) sv_setiv(ST(0),USYNC);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        case 'T':
                switch (name[2]) {
                case 'W':
                if (strEQ(name,"UTWOENDS")) sv_setiv(ST(0),UTWOENDS);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  case 'V':
        switch (name[1]) {
        case 'I':
                switch (name[2]) {
                case 'O':
                if (strEQ(name,"VIOCACCESS")) sv_setiv(ST(0),VIOCACCESS);

src/AFS.xs  view on Meta::CPAN

                else if (strEQ(name,"VIOC_GET_WS_CELL")) sv_setiv(ST(0),VIOC_GET_WS_CELL);
                else if (strEQ(name,"VIOC_SETCELLSTATUS")) sv_setiv(ST(0),VIOC_SETCELLSTATUS);
                else if (strEQ(name,"VIOC_SETSPREFS")) sv_setiv(ST(0),VIOC_SETSPREFS);
                else if (strEQ(name,"VIOC_TWIDDLE")) sv_setiv(ST(0),VIOC_TWIDDLE);
                else if (strEQ(name,"VIOC_VENUSLOG")) sv_setiv(ST(0),VIOC_VENUSLOG);
                else {
                     ST(0) = ST(1) = &PL_sv_undef;
                     return;
                }
                break;
                default:
                        ST(0) = ST(1) = &PL_sv_undef;
                        return;
                }
                break;
        default:
                ST(0) = ST(1) = &PL_sv_undef;
                return;
        }
        break;
  default:
        ST(0) = ST(1) = &PL_sv_undef;
        return;
  }

  errno = 0;
  XSRETURN(1);
  return;
 }

#endif

src/Makefile.PL  view on Meta::CPAN

                       "-L$AFSPath/lib -L$AFSPath/lib/afs "
                       . $libs
                      ],
    'realclean'    => {FILES => 'Makefile.bak lib'},
                   );

if ($Config{osname} =~ /aix/) {
    $MakefileArgs{LIBS}->[0] .= ' -ldl';
}
elsif ($Config{osname} =~ /irix/) {
   # just the default LIBS
}
elsif ($Config{osname} =~ /solaris/) {
    $MakefileArgs{DEFINE} .= ' -Dint32=afs_int32 -Duint32=afs_uint32' if $alpha_sys eq 'sun4x_56'; # From Peter@PSDT.com
    $MakefileArgs{LIBS}->[0] .= ' -lresolv -lsocket -lnsl -lintl -ldl';
    $MakefileArgs{CC} = 'gcc';
    #$MakefileArgs{LD} = 'gcc';
    $MakefileArgs{CCCDLFLAGS} = '-fPIC';
}
elsif ($Config{osname} =~ /linux/) {
    $MakefileArgs{LIBS}->[0] .= ' -lresolv';
}
# elsif ($Config{osname} =~ /dec_osf/) {
# # hier fehlt noch was !!!!!
# }
else {
    warn("System type '$Config{osname}' not yet tested with this Makefile.PL...\n\n"
         . "Using the default values, which may or may not work\n"
         . "If it is working, please inform the maintainer of this package.\n"
         . "Thank you.\n\n");
}

WriteMakefile(%MakefileArgs);

# change the library name of the AFS system library "util.a"
my $command = "\'s#-lutil#$AFSPath/lib/afs/util.a#\'";
system("perl -p -i.bak -e $command Makefile") unless -f "$AFSPath/lib/afs/libutil.a";

src/ppport.h  view on Meta::CPAN


=head2 --copy=I<suffix>

If this option is given, a copy of each file will be saved with
the given suffix that contains the suggested changes. This does
not require any external programs. Note that this does not
automagially add a dot between the original filename and the
suffix. If you want the dot, you have to include it in the option
argument.

If neither C<--patch> or C<--copy> are given, the default is to
simply print the diffs for each file. This requires either
C<Text::Diff> or a C<diff> program to be installed.

=head2 --diff=I<program>

Manually set the diff program and options to use. The default
is to use C<Text::Diff>, when installed, and output unified
context diffs.

=head2 --compat-version=I<version>

Tell F<ppport.h> to check for compatibility with the given
Perl version. The default is to check for compatibility with Perl
version 5.003. You can use this option to reduce the output
of F<ppport.h> if you intend to be backward compatible only
down to a certain Perl version.

=head2 --cplusplus

Usually, F<ppport.h> will detect C++ style comments and
replace them with C style comments for portability reasons.
Using this option instructs F<ppport.h> to leave C++
comments untouched.

src/ppport.h  view on Meta::CPAN

Don't output any hints. Hints often contain useful portability
notes. Warnings will still be displayed.

=head2 --nochanges

Don't suggest any changes. Only give diagnostic output and hints
unless these are also deactivated.

=head2 --nofilter

Don't filter the list of input files. By default, files not looking
like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.

=head2 --strip

Strip all script and documentation functionality from F<ppport.h>.
This reduces the size of F<ppport.h> dramatically and may be useful
if you want to include F<ppport.h> in smaller modules without
increasing their distribution size too much.

The stripped F<ppport.h> will have a C<--unstrip> option that allows

src/ppport.h  view on Meta::CPAN

    vnewSVpvf()               NEED_vnewSVpvf               NEED_vnewSVpvf_GLOBAL
    warner()                  NEED_warner                  NEED_warner_GLOBAL

To avoid namespace conflicts, you can change the namespace of the
explicitly exported functions / variables using the C<DPPP_NAMESPACE>
macro. Just C<#define> the macro before including C<ppport.h>:

    #define DPPP_NAMESPACE MyOwnNamespace_
    #include "ppport.h"

The default namespace is C<DPPP_>.

=back

The good thing is that most of the above can be checked by running
F<ppport.h> on your source code. See the next section for
details.

=head1 EXAMPLES

To verify whether F<ppport.h> is needed for your module, whether you

src/ppport.h  view on Meta::CPAN

                case '\v' : octbuf[1] = 'v'; break;
                case '\t' : octbuf[1] = 't'; break;
                case '\r' : octbuf[1] = 'r'; break;
                case '\n' : octbuf[1] = 'n'; break;
                case '\f' : octbuf[1] = 'f'; break;
                case '"'  : if (dq == '"')
                                octbuf[1] = '"';
                            else
                                chsize = 1;
                            break;
                default:    chsize = my_snprintf(octbuf, sizeof octbuf,
                                pv < end && isDIGIT((U8)*(pv+readsize))
                                ? "%c%03o" : "%c%o", esc, c);
                }
            } else {
                chsize = 1;
            }
        }
        if (max && wrote + chsize > max) {
            break;
        } else if (chsize > 1) {



( run in 0.810 second using v1.01-cache-2.11-cpan-0a6323c29d9 )