view release on metacpan or search on metacpan
for all OpenAFS versions.
* number of available platforms have increased. Since OpenAFS is
running on an increasingly number of platforms so does the AFS Perl
module. Everywhere you can compile OpenAFS and Perl you should be
able to install the ASF Perl module.
* corrected Constructor Methods for all AFS classes. The constructor
methods for all AFS classes have been corrected to conform with the
Perl OO conventions.
* module structure has been changed. In order to have clean Perl
interfaces the AFS Perl code has been separated into several
logical modules. All modules have been implemented as OO classes.
* compatibility mode for version 1.X. All old variables and
functions from version 1 are still available for compatibility, but
are deprecated. These cases have been marked in the documentation.
* numerous example scripts for version 2.0
* new functions 'XSVERSION', 'get_syslib_version', 'get_server_version',
'getcrypt' and 'setcrypt'
* new set of POD documentations for version 2.0
examples/v2/base/constant
examples/v2/base/error_test
examples/v2/bos/addhost
examples/v2/bos/addkey
examples/v2/bos/adduser
examples/v2/bos/blockscanner
examples/v2/bos/constructor
examples/v2/bos/create
examples/v2/bos/delete
examples/v2/bos/exec
examples/v2/bos/getlog
examples/v2/bos/getrestart
examples/v2/bos/getrestricted
examples/v2/bos/listhosts
examples/v2/bos/listkeys
examples/v2/bos/listusers
examples/v2/bos/prune
examples/v2/bos/removehost
examples/v2/bos/removekey
examples/v2/bos/removeuser
examples/v2/bos/restart
examples/v2/pts/removeuser
examples/v2/pts/rename
examples/v2/pts/setaccess
examples/v2/pts/setgroupquota
examples/v2/pts/setmax
examples/v2/pts/whereisit
examples/v2/utils/get_server_version
examples/v2/utils/get_syslib_version
examples/v2/utils/setpag
examples/v2/utils/sysname
examples/v2/utils/unlog
examples/v2/utils/XSVERSION
examples/v2/vldb/addsite
examples/v2/vldb/changeloc
examples/v2/vldb/constructor
examples/v2/vldb/delentry
examples/v2/vldb/delgroups
examples/v2/vldb/listaddrs
examples/v2/vldb/listvldb
examples/v2/vldb/listvldbentry
examples/v2/vldb/lock
examples/v2/bos/getlog view on Meta::CPAN
#!/usr/local/bin/perl
use blib;
use strict;
use warnings;
use AFS::BOS;
my ($server, $cellname, $logfile, $bos);
die "Usage: $0 server [cell] log_file_name \n" if $#ARGV < 1;
$server = shift;
$cellname = shift if $#ARGV == 2;
$logfile = shift;
if ($cellname) { $bos = AFS::BOS->new($server, 0, 0, $cellname); }
else { $bos = AFS::BOS->new($server); }
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n" and die;
print "Fetching log file \'$logfile\' ...\n";
my @log = $bos->getlog($logfile);
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n";
print join('', @log);
$bos->DESTROY;
examples/v2/bos/salvage view on Meta::CPAN
else { $bos = AFS::BOS->new($server); }
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n" and die;
die "not yet tested ... \n";
print "bos->salvage()...\n";
# these are all possible non MR-AFS parameters:
my ($partition, $volume) = ('/vicepa', 'u.vanilla');
my $all = 0;
my $outName = ''; # salvage log output file
my $showlog = 0;
my ($parallel, $tmpDir) = ('', '');
my $orphans = 'ignore'; # ignore | remove | attach
my $localauth = 0;
$ok = $bos->salvage($partition, $volume);
print "Error Code: $AFS::CODE\n" if ($AFS::CODE);
print "Something went wrong\n" unless $ok;
exit;
examples/v2/bos/salvage view on Meta::CPAN
($partition, $volume) = ('', '');
$all = 1;
$ok = $bos->salvage($partition, $volume, $all);
print "Error Code: $AFS::CODE\n" if ($AFS::CODE);
print "Something went wrong\n" unless $ok;
$all = 0;
$ok = $bos->salvage($partition, $volume, $outName,
$all, $showlog,
$parallel, $tmpDir,
$orphans,
$localauth
);
print "Error Code: $AFS::CODE\n" if ($AFS::CODE);
print "Something went wrong\n" unless $ok;
$bos->DESTROY;
examples/v2/ktcp/ParseLoginName view on Meta::CPAN
#!/usr/local/bin/perl
use blib;
use strict;
use warnings;
use AFS::KTC_PRINCIPAL;
die "Usage: $0 name\n" if ($#ARGV != 0);
my $login = shift;
my ($name, $inst, $cell) = AFS::KTC_PRINCIPAL->ParseLoginName($login);
print "AFS::CODE = $AFS::CODE (",$AFS::CODE+0,")\n";
print "name = ", $name, "\n";
print "instance = ", $inst, "\n";
print "cell = ", $cell, "\n\n";
examples/v2/utils/unlog view on Meta::CPAN
#!/usr/local/bin/perl
use blib;
use strict;
use warnings;
use AFS::Utils qw (unlog);
system "tokens";
unlog;
system "tokens";
pod/v2/afsperl.pod view on Meta::CPAN
=head1 CURRENT AUTHOR
Norbert E. Gruener E<lt>nog@MPA-Garching.MPG.deE<gt>
=head1 AUTHOR EMERITUS
Roland Schemers E<lt>schemers@slapshot.stanford.eduE<gt>
=head1 CREDITS
Thank you to (in chronological order):
B<Lawrence Greenfield> - for his update in the AFS.xs file
B<Alf Wachsmann> - for his bug report on the function "setquota"
B<Gerhard Gonter> - for his configuration report for rs_aix32
B<Peter Scott> - for his improvement on ACL->keys and ACL->nkeys
B<Thomas M. Payerle> - for his configuration report for alpha_dux40
pod/v2/afsperlbos.pod view on Meta::CPAN
$ok = $bos->stop(['vlserver']);
my $restricted = $bos->getrestricted;
$ok = $bos->setrestricted('on');
$ok = $bos->create('kaserver', 'simple', ['/usr/afs/bin/kaserver']);
$ok = $bos->delete('instance');
$ok = $bos->exec('/sbin/shutdown -r now');
my @logentries = $bos->getlog('FileLog');
my ($all, $bak, $old, $core) = (0, 0, 0, 1);
$ok = $bos->prune($all, $bak, $old, $core);
$ok = $bos->salvage('/vicepa');
$ok = $bos->setauth('on');
$ok = $bos->setcellname('newcell.example.com');
pod/v2/afsperlbos.pod view on Meta::CPAN
Before using this method, issue the stop method to stop the process
and set its status flag in the BosConfig file to NotRun. The delete
method fails with an error message if a process's status flag is Run.
It calls the AFS system library function I<BOZO_DeleteBnode>.
=item B<$ok = $bos-E<gt>exec(COMMAND);>
Executes the indicated COMMAND on the BOS server machine. It calls
the AFS system library function I<BOZO_Exec>.
=item B<@logfile = $bos-E<gt>getlog(LOGFILE);>
Returns an array with the contents of the specified LOGFILE from the
BOS server. It calls the AFS system library function
I<StartBOZO_GetLog>.
=item B<($GTIME, $BTIME) = $bos-E<gt>getrestart;>
Returns the restart times GTIME and BTIME from the local C<BosConfig>
file. GTIME is the general restart time at which the BOS Server
process automatically restarts itself. BTIME is the binary restart
pod/v2/afsperlbos.pod view on Meta::CPAN
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);>
pod/v2/afsperlkas.pod view on Meta::CPAN
&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
=head1 CURRENT AUTHOR
Norbert E. Gruener E<lt>nog@MPA-Garching.MPG.deE<gt>
pod/v2/afsperlutils.pod view on Meta::CPAN
#------------------------------------------------------------------------------
=head1 NAME
B<AFS::Utils> - Shared utility functions for the B<AFS module bundle>
=head1 SYNOPSIS
use AFS::Utils qw (
XSVERSION get_server_version get_syslib_version
setpag sysname unlog
);
my $ok = setpag();
print "Return Code = $ok\n";
print 'XS-Version = ', XSVERSION, "\n";
print 'Syslib Version = ', get_syslib_version, "\n";
print 'Server Version = ', get_server_version('pts', 'ibm-1'), "\n";
my $sysname = sysname;
unlog;
=head1 DESCRIPTION
This module provides several utility functions for the B<AFS module
bundle>. You can retrieve the version number for the underlying AFS
system libraries, for the XS module, and for the AFS server processes.
And it contains several commands that do not belong to any AFS command
suites like creating a new PAG or retrieving and setting the
CPU/operating system type. Any function required must by explicitly
listed by the C<use> statement to be exported into the calling package.
pod/v2/afsperlutils.pod view on Meta::CPAN
Creates a new command shell (owned by the issuer of the command) and
associates a new process authentication group (PAG) with the shell and
the user. A PAG is a number guaranteed to identify the issuer of
commands in the new shell uniquely to the local Cache Manager.
=item B<$sysname = sysname([NEWSYSNAME]);>
Reports the CPU/operating system type or sets the CPU/operating system
type to NEWSYSNAME.
=item B<unlog;>
Discards all of the issuer's tokens.
=back
=head1 CURRENT AUTHOR
Norbert E. Gruener E<lt>nog@MPA-Garching.MPG.deE<gt>
=head1 AUTHOR EMERITUS
getvolstats
isafs
lsmount
mkmount
pioctl
rmmount
setcachesize
setcellstatus
setquota
sysname
unlog
whereis
whichcell
wscell
get_server_version
get_syslib_version
XSVERSION
getcrypt
setcrypt
);
afs_int32 OptIgnoreCheck;
afs_int32 OptForceOnLine;
afs_int32 OptUseRootDirACL;
afs_int32 OptTraceBadLinkCounts;
afs_int32 OptDontAskFS;
afs_int32 OptLogLevel;
afs_int32 OptRxDebug;
afs_uint32 OptResidencies;
} mrafsParm;
static int DoSalvage(aconn, aparm1, aparm2, aoutName, showlog, parallel, atmpDir, orphans)
struct rx_connection *aconn;
char *aoutName;
char *aparm1;
char *aparm2;
afs_int32 showlog;
char *parallel;
char *atmpDir;
char *orphans;
{
register afs_int32 code;
char *parms[6];
char buffer;
char tbuffer[BOZO_BSSIZE];
struct bozo_status istatus;
struct rx_call *tcall;
/* fprintf(stderr, "AFS::BOS: waiting for salvage to complete.\n"); */
}
if (code != BZNOENT) {
char buffer[256];
sprintf(buffer, "AFS::BOS: salvage failed (%s)\n", em(code));
BSETCODE(code, buffer);
goto done;
}
code = 0;
/* now print the log file to the output file */
/* fprintf(stderr, "AFS::BOS: salvage completed\n"); */
if (aoutName || showlog) {
fprintf(outFile, "SalvageLog:\n");
tcall = rx_NewCall(aconn);
/* MUST pass canonical (wire-format) salvager log path to bosserver */
code = StartBOZO_GetLog(tcall, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH);
if (code) {
rx_EndCall(tcall, code);
goto done;
}
/* copy data */
while (1) {
code = rx_Read(tcall, &buffer, 1);
if (code != 1)
break;
vi.out_size = 0;
vi.out = 0;
code = pioctl(NULL, VIOCSETCACHESIZE, &vi, 0);
SETCODE(code);
RETVAL = (code == 0);
}
OUTPUT:
RETVAL
int32
fs_unlog()
CODE:
{
struct ViceIoctl vi;
int32 code;
vi.in_size = 0;
vi.out_size = 0;
code = pioctl(NULL, VIOCUNLOG, &vi, 0);
SETCODE(code);
RETVAL = (code == 0);
RETVAL = (code == 0);
/* printf("DEBUG-bos-delete-10 \n"); */
/* if (name) */
/* Safefree(name); */
/* printf("DEBUG-bos-delete-11 \n"); */
}
OUTPUT:
RETVAL
void
bos_getlog(self, file)
AFS::BOS self
char* file
PREINIT:
register struct rx_call *tcall;
int32 code = 0;
char buf, c[255];
int error, num = 0, i = 0;
PPCODE:
{
tcall = rx_NewCall(self);
code = StartBOZO_GetLog(tcall, file);
if (code) {
char buffer[256];
rx_EndCall(tcall, code);
sprintf(buffer, "AFS::BOS error %d (while reading log)\n", code);
BSETCODE(code, buffer);
XSRETURN_UNDEF;
}
/* copy data */
error = 0;
while (1) {
code = rx_Read(tcall, &buf, 1);
if (code != 1) {
error = EIO;
RETVAL = (code == 0);
#else
RETVAL = 0;
not_here("AFS::BOS::setrestricted");
#endif
}
OUTPUT:
RETVAL
int32
bos_salvage(self, partition=NULL, volume=NULL, all=0, outName=NULL, showlog=0, parallel=NULL, tmpDir=NULL, orphans=NULL, localauth=0, tmpname=NULL, debug=0, nowrite=0, force=0, oktozap=0, rootfiles=0, salvagedirs=0, blockreads=0, ListResidencies=0, S...
AFS::BOS self
char *partition
char *volume
int32 all
char *outName
int32 showlog
char *parallel
char *tmpDir
char *orphans
int32 localauth
char *tmpname
int32 debug
int32 nowrite
int32 force
int32 oktozap
int32 rootfiles
mrafs = 1;
/* we can do a volume, a partition or the whole thing, but not mixtures
* thereof */
if (!partition && volume) {
char buffer[256];
sprintf(buffer, "AFS::BOS: must specify partition to salvage individual volume.\n");
BSETCODE(-1, buffer);
goto done;
}
if (showlog && outName) {
char buffer[256];
sprintf(buffer, "AFS::BOS: can not specify both -file and -showlog.\n");
BSETCODE(-1, buffer);
goto done;
}
if (all && (partition || volume)) {
char buffer[256];
sprintf(buffer, "AFS::BOS: can not specify ALL with other flags.\n");
BSETCODE(-1, buffer);
goto done;
}
code = BOZO_WaitAll(self); /* wait for shutdown to complete */
if (code) {
char buffer[256];
sprintf(buffer,
"AFS::BOS: failed to wait for file server shutdown, continuing.\n");
BSETCODE(code, buffer);
}
}
/* now do the salvage operation */
/* fprintf(stderr, "Starting salvage of everything.\n"); */
rc = DoSalvage(self, (char *) 0, (char *) 0, outName, showlog, parallel, tmpDir,
orphans);
if (curGoal == BSTAT_NORMAL) {
/* fprintf(stderr, "AFS::BOS: restarting fs.\n"); */
code = BOZO_SetTStatus(self, "fs", BSTAT_NORMAL);
if (code) {
char buffer[256];
sprintf(buffer, "AFS::BOS: failed to restart 'fs' (%s)\n", em(code));
BSETCODE(code, buffer);
goto done;
}
if (code) {
char buffer[256];
sprintf(buffer,
"AFS::BOS: failed to wait for file server shutdown, continuing.\n");
BSETCODE(code, buffer);
}
}
/* now do the salvage operation */
/* fprintf(stderr, "Starting salvage of partition %s.\n", partition); */
rc = DoSalvage(self, partition, (char *) 0,
outName, showlog, parallel, tmpDir, orphans);
if (curGoal == BSTAT_NORMAL) {
/* fprintf(stderr, "AFS::BOS: restarting fs.\n"); */
code = BOZO_SetTStatus(self, "fs", BSTAT_NORMAL);
if (code) {
char buffer[256];
sprintf(buffer, "AFS::BOS: failed to restart 'fs' (%s)\n", em(code));
BSETCODE(code, buffer);
goto done;
}
}
/* can't parse volume ID, so complain before shutting down
* file server.
*/
char buffer[256];
sprintf(buffer, "AFS::BOS: can't interpret %s as partition ID.\n", partition);
BSETCODE(-1, buffer);
goto done;
}
/* fprintf(stderr, "Starting salvage of volume %d on partition %s.\n",
newID, partition); */
rc = DoSalvage(self, partition, tname, outName, showlog, parallel, tmpDir, orphans);
if (rc) {
code = rc;
goto done;
}
}
code = 0;
SETCODE(code);
done:
afs_ptsaccess2ascii(flags)
int32 flags
CODE:
{
SETCODE(0);
ST(0) = sv_newmortal();
sv_setpv(ST(0), parse_flags_ptsaccess(flags));
}
void
afs_ka_ParseLoginName(login)
char * login
PPCODE:
{
int32 code;
char name[MAXKTCNAMELEN];
char inst[MAXKTCNAMELEN];
char cell[MAXKTCREALMLEN];
code = ka_ParseLoginName(login, name, inst, cell);
SETCODE(code);
if (code == 0) {
EXTEND(sp, 3);
PUSHs(sv_2mortal(newSVpv(name, strlen(name))));
PUSHs(sv_2mortal(newSVpv(inst, strlen(inst))));
PUSHs(sv_2mortal(newSVpv(cell, strlen(cell))));
}
}
void
src/BOS/t/BOS.t view on Meta::CPAN
like($AFS::CODE, qr/HOST not an array reference/, 'bos->addhost(HASH)');
my $host = 'very_very_very_very_long_long_long_long_name_name_name_name_name_name';
$bos->addhost($host, 1);
like($AFS::CODE, qr/host name too long/, 'bos->addhost(long_name)');
can_ok('AFS::BOS', qw(addkey));
can_ok('AFS::BOS', qw(create));
can_ok('AFS::BOS', qw(delete));
can_ok('AFS::BOS', qw(exec));
can_ok('AFS::BOS', qw(getlog));
can_ok('AFS::BOS', qw(getrestricted));
can_ok('AFS::BOS', qw(listkeys));
can_ok('AFS::BOS', qw(prune));
$bos->removehost(\%h);
like($AFS::CODE, qr/HOST not an array reference/, 'bos->removehost(HASH)');
$host = 'z';
$bos->removehost($host);
SKIP: {
skip "You lack rights for this test", 1
src/Utils/Utils.pm view on Meta::CPAN
use vars qw(@ISA $VERSION @EXPORT_OK);
require Exporter;
@EXPORT_OK = qw(
XSVERSION
get_server_version
get_syslib_version
setpag
sysname
unlog
);
@ISA = qw(Exporter AFS);
$VERSION = 'v2.6.4';
1;
src/Utils/t/Utils.t view on Meta::CPAN
use Test::More;
BEGIN {
use AFS::FS;
if (AFS::FS::isafs('./')) { plan tests => 7; }
else { plan skip_all => 'Working directory is not in AFS file system ...'; }
use_ok('AFS::Utils', qw (
XSVERSION get_server_version get_syslib_version
setpag sysname unlog
)
);
}
my $setpag = setpag;
ok(defined $setpag, 'setpag');
my $xsversion = XSVERSION;
ok(defined $xsversion, 'XSVERSION');
my $syslib_version = get_syslib_version;
ok(defined $syslib_version, 'get_syslib_version');
my $server_version = get_server_version('cm');
ok(defined $server_version, 'get_server_version');
my $sysname = sysname;
ok(defined $sysname, 'sysname');
my $unlog = unlog;
ok(defined $unlog, 'unlog');
src/com_err.h view on Meta::CPAN
/*
* Header file for common error description library.
*
* Copyright 1988, Student Information Processing Board of the
* Massachusetts Institute of Technology.
*
* For copyright and distribution info, see the documentation supplied
* with this package.
*/
#ifndef __AFS_COM_ERR_H
#include <stdarg.h>
extern void afs_com_err(const char *, afs_int32, const char *, ...);
src/inc/Test/Builder.pm view on Meta::CPAN
return $Todo_FH;
}
sub _new_fh {
my($file_or_fh) = shift;
my $fh;
unless( UNIVERSAL::isa($file_or_fh, 'GLOB') ) {
$fh = do { local *FH };
open $fh, ">$file_or_fh" or
die "Can't open test output log $file_or_fh: $!";
}
else {
$fh = $file_or_fh;
}
return $fh;
}
unless( $^C ) {
# We dup STDOUT and STDERR so people can change them in their
src/ppport.h view on Meta::CPAN
=item 2.
This file.
=item 3.
The name and version of the module you were trying to build.
=item 4.
A full log of the build that failed.
=item 5.
Any other information that you think could be relevant.
=back
For the latest version of this code, please get the C<Devel::PPPort>
module from CPAN.
src/ppport.h view on Meta::CPAN
malloc||5.007002|n
markstack_grow|||
matcher_matches_sv|||
mayberelocate|||
measure_struct|||
memEQs|5.009005||p
memEQ|5.004000||p
memNEs|5.009005||p
memNE|5.004000||p
mem_collxfrm|||
mem_log_common|||n
mess_alloc|||
mess_nocontext|||vn
mess_sv||5.013001|
mess||5.006000|v
method_common|||
mfree||5.007002|n
mg_clear|||
mg_copy|||
mg_dup|||
mg_find_mglob|||
src/ppport.h view on Meta::CPAN
newWHENOP||5.009003|
newWHILEOP||5.013007|
newXS_flags||5.009004|
newXS_len_flags|||
newXSproto||5.006000|
newXS||5.006000|
new_collate||5.006000|
new_constant|||
new_ctype||5.006000|
new_he|||
new_logop|||
new_numeric||5.006000|
new_stackinfo||5.005000|
new_version||5.009000|
new_warnings_bitfield|||
next_symbol|||
nextargv|||
nextchar|||
ninstr|||n
no_bareword_allowed|||
no_fh_allowed|||