view release on metacpan or search on metacpan
Version 2.6.3 (released 25 Oct 2012, revision 1142)
http://www.mpa-garching.mpg.de/~nog/perl/AFS-2.6.3.tar.gz
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
* This release does not support any features and interfaces from
AFSPerl "version 1"
User-visible changes:
* added patch for OpenAFS to create "PIC" type system libraries on
64-bit platforms
* compiles with OpenAFS system libraries version 1.4.X on 32-bit and
on 64-bit platforms
* added installation description for 64-bit platforms
* released the BOS methods
- addhost
- removehost
- adduser
- removeuser
* added new method AFS::ACL->is_clean
* modified AFS::ACL->cleanacl: uses method "is_clean" to check if
there is anything to do
* method AFS::VOS->listvolume provides also the values "copyDate",
"backupDate", and "accessDate"
* patched example for AFS::KTC_TOKEN->SetToken to handle several
tokens
* updated example scripts for all AFS modules
Developer-visible changes:
* rewrite of method AFS::VOS->backupsys
* concatenate compiler flags in Makefile.PL
* cleaned up compiler warnings
* cleaned up memory allocation for the AFS::PTS, AFS::VOS, AFS::VLDB,
and AFS::BOS modules
* closed memory leaks because of multiple calls to "rx_Init" in the
AFS::PTS, AFS::VOS, AFS::VLDB, and AFS::BOS modules
* converted "integer" checks to "Scalar::Util(looks_like_number)"
utility for all AFS::VOS methods and all AFS::VOS examples
Version 2.6.2 (released 31 Mar 2010, revision 961)
http://www.mpa-garching.mpg.de/~nog/perl/AFS-2.6.2.tar.gz
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
* Two of the hash key names returned by the VLDB method "listaddrs" have
changed in version 2.4.1 (see POD doku AFS::VLDB)
* This release does not support any features and interfaces from
AFSPerl "version 1"
User-visible changes:
* compiles with OpenAFS system libraries version 1.4.12
* fixed method AFS::VLDB->listvldb: fixed segmentation error
* improved Makefile.PL script for Perl 5.10.0 and "threaded PIC" libraries
* updated example scripts for the modules AFS::VLDB and AFS::VOS
* improved test drivers for the modules AFS::VLDB and AFS::VOS;
Developer-visible changes:
* convertet all VERSION variables to "dotted decimal version" with leading "v"
* changed argument type from "int" to "string" for method AFS::VLDB->removeaddr
Version 2.6.1 (released 17 Nov 2008, revision 906)
http://www.mpa-garching.mpg.de/~nog/perl/AFS-2.6.1.tar.gz
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
* Two of the hash key names returned by the VLDB method "listaddrs" have
changed in version 2.4.1 (see POD doku AFS::VLDB)
* This release does not support any features and interfaces from
AFSPerl "version 1"
User-visible changes:
* fixed method AFS::KAS->getentry: fixed return value for passwd_reuse
* fixed method AFS::VLDB->listvldb: fixed segmentation error
* updated example scripts for the modules AFS::KAS
* fixed Makefile.PL to recognize Transarc/IBM system libraries
Developer-visible changes:
* cleaned up Makefile.PL
Version 2.6.0 (released 27 Oct 2008, revision 888)
http://www.mpa-garching.mpg.de/~nog/perl/AFS-2.6.0.tar.gz
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
* Two of the hash key names returned by the VLDB method "listaddrs" have
changed in version 2.4.1 (see POD doku AFS::VLDB)
* This release does not support any features and interfaces from
AFSPerl "version 1"
User-visible changes:
* compiles now with Perl 5.10.0
* HTML documentation updated in order to include cross-references
Developer-visible changes:
* runs some tests only for module author
* recognizes "automated tests" from CPAN testers
Version 2.4.1 (released 23 Oct 2008, revision 836/863)
http://www.mpa-garching.mpg.de/~nog/perl/AFS-2.4.1.tar.gz
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
* Two of the hash key names returned by the VLDB method "listaddrs" have
changed (see POD doku AFS::VLDB)
User-visible changes:
* improved several test drivers;
* updated example scripts for the modules AFS:VOS, AFS::VLDB,
AFS::Cell, AFS::CM, AFS::FS, AFS::BOS, and AFS::KTC_EKEY
* improved POD documentation for AFS::FS and AFS
* POD documentation gets installed automatically
* fixed method AFS::VLDB->listaddrs: lists now all servers
* fixed method AFS::VOS->listvol: returns correct name and volid when
volume is busy
* fixed method AFS::VOS->listvldb: returns proper "release" strings
* improved error messages when OpenAFS configuration files are missing
* compiles now with OpenAFS system libraries newer than 1.4.4
* improved Makefile.PL script to avoid interactive queries
Developer-visible changes:
* modified initialization of the "cell" variable for "fs" functions
* cleaned up source code and error handling for "vos" functions, "vldb"
functions, and "bos" functions
Version 2.4.0 (released 20 Feb 2006, revision 777)
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
User-visible changes:
* implementation of most commands of the BOS command suite
* POD documentation for the module AFS::BOS
* compiles now with OpenAFS 1.4 system libraries
* improved several test drivers;
* fixed method AFS::VOS->listvolume: returns volume name when
volume id number is given
* patched function fs_getquota
* improved POD documentation for AFS::VOS
Developer-visible changes:
* all unit test drivers are now using Test::More
* modified the computing of the VERSION numbers
* added dummy function "GetUInt32"
* modified internal function set_code
Version 2.2.3 (released 17 Feb 2005, revision 679)
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
User-visible changes:
* now supports Perl "threaded" version on several platforms
* fixed method AFS::VOS->backupsys: fixed segmentation error and
added some error handling
* fixed method AFS::VLDB->delentry: added some error handling
Developer-visible changes:
* modified AFS.xs functions "SendFile", "ReceiveFile",
and "DoSalvage" to handle "threaded" and "unthreaded" case
* modified AFS.xs: added dummy functions for "threaded" case
* redesigned the computing of the VERSION numbers
Version 2.2.2 (released 07 May 2004, revision 627)
NOTICE:
* This release does not support AFS system libraries version 3.4 or
version 3.5
* This release does ONLY work with Perl "unthreaded" versions (this
is true for all versions 2.2.X)
User-visible changes:
* improved most test drivers;
* included checks for Perl "unthreaded" version;
Developer-visible changes:
* modified AFS.xs function "isafs": patched error handling
Version 2.2.1 (released 09 March 2004, revision 594)
NOTICE: This release does not support AFS system libraries
version 3.4 or version 3.5
User-visible changes:
* fixed method DESTROY for the modules AFS::KAS, AFS::PTS,
AFS::VLDB, and AFS::VOS; under certain circumstances they caused
segmentation faults;
Developer-visible changes:
* none
Version 2.2.0 (released 03 February 2004, revision 571)
NOTICE: This release does not support AFS system libraries
version 3.4 or version 3.5
User-visible changes:
* implementation of the VOS command suite
* POD documentation for the modules AFS::VLDB and AFS::VOS
* changed VERSION numbering schema. Beginning with version 2.2.0,
the version number convention has been changed to a "dotted
integer" scheme that is more commonly found in open source
projects. Maintenance versions of v2.2.0 will be released as
v2.2.1, v2,2.2 etc. The next development series following v2.2.0
will be numbered v2.3.x, beginning with v2.3.0, and the next major
production release following v2.2.0 will be v2.4.0.
* improved Makefile.PL script
* improved several test drivers by generalizing test cases.
* extended POD documentation for AFS::CM; now enumerates the hash key
names for the C structure "VolumeStatus".
* support for the CM function 'getvolstats'
* fixed kas->getentry method because the returned values for the
packed variable were wrong
Developer-visible changes:
* rewrite of the DESTROY function for KAS and PTS
* changed memcpy and bcopy to Copy for most XS functions
* modified AFS.xs functions "myDisplayFormat", "myXDisplayFormat",
and "myEnumerateEntry": patched several hash key names
* patched pts->DESTROY method
* new modules AFS::VLDB and AFS::VOS
* changed VERSION numbering schema
Version 2.04 (never released, revision 297)
User-visible changes:
* fixed function "constant"
Developer-visible changes:
* switched test drivers to Test::More
* rewrite of several test drivers
ACL.t, CM.t, Cell.t, FS.t, Utils.t
* VERSION variable now under SVN control
* fixed function AUTOLOAD
Version 2.03 (released 15 October 2002, revision 230)
User-visible changes:
* Makefile.PL
now we can recognize 'Devel' versions too
Developer-visible changes:
*closed memory leak because of wrong ref-counter in
fs_getvolstats
fs_getacl
pts_listentry
pts_PR_ListEntry
pts_dumpentry
pts_PR_DumpEntry
kas_KAM_GetEntry
kas_KAM_Debug
kas_KAM_GetStats
Version 2.02 (released 12 July 2002, revision 221)
User-visible changes:
* fixed bug in method AFS::KAS->setfields resp. AFS::KAS->KAM_SetFields
introduced in version 2.01
Developer-visible changes:
* modified 'typemap' file: added type 'uint32'
Version 2.01 (released 8 July 2002, revision 211)
User-visible changes:
* improved Makefile.PL script
* new method '-AFS::KTC_TOKEN->FromString'
Developer-visible changes:
* removed perl-5.6 features from several modules for backward
compatibility
Version 2.0 (released 2 July 2002, revision 184)
User-visible changes:
* compiles now with IBM AFS 3.6 and OpenAFS system libraries. This
module bundle compiles now with the AFS system libraries for IBM
AFS version 3.4.x, 3.5.x, 3.6.x and with the AFS system libraries
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
Developer-visible changes:
* compiles with OpenAFS
* constructor methods for all AFS classes have been corrected to
conform with the Perl OO conventions.
* modified 'typemap' file: renamed following types
AFS::PTS_SERVER AFS::PTS
AFS::KA_AUTHSERVER AFS::KAS
AFS::KTC_ENCRYPTIONKEY AFS::KTC_EKEY
Version 1.11 (released 6 December 2001, revision 80)
User-visible changes:
* major rewrite of the Make.PL script
* patched functions lsmount, rmmount (the values of an input argument
got corrupted)
* improved test driver for module AFS.pm
* updated README
Developer-visible changes:
* ACL->length, ACL->nlength, ACL->keys, ACL->nkeys:
keyword "keys" changed to CORE::keys
Version 1.10 (released 24 July 2001, revision 71)
User-visible changes:
* updated and corrected README
Developer-visible changes:
* VERSION variable now under CVS control
Version 1.09 (released 27 October 2000, revision 60)
User-visible changes:
* none
Developer-visible changes:
* applied Patches from Perl Pollution Portability V1.0007
Version 1.08 beta (released 16 June 1999, revision 57)
User-visible changes:
* added example for function ka_setfields
Developer-visible changes:
* none
Version 1.08 alpha (released 3 May 1999, revision 55)
User-visible changes:
* updated and corrected README
Developer-visible changes:
* none
Version 1.08 (released 27 April 1999, revision 54)
User-visible changes:
* patched function fs_setquota
* added function flushcb
Developer-visible changes:
* none
Version 1.07 (released 8 April 1999, revision 44)
User-visible changes:
* added support for AIX machines
* patched function fs_setquota
Developer-visible changes:
* none
Version 1.06 (released 6 April 1999, revision 40)
User-visible changes:
* renamed function 'access' to 'cm_access'
* introduced variable AFS::VERSION
* fixed bug in kas_KAM_SetFields
Developer-visible changes:
* fixed problems in internal_pts_new and in pts_name
Version 1.05 (dated 2 November 1996, revision 21)
* oldest available version, extracted from the original tar
package, compiled by Roland Schemers
LICENCES/Artistic view on Meta::CPAN
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
LICENCES/Artistic view on Meta::CPAN
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
LICENCES/COPYING view on Meta::CPAN
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
LICENCES/COPYING view on Meta::CPAN
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
LICENCES/COPYING view on Meta::CPAN
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
LICENCES/COPYING view on Meta::CPAN
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
LICENCES/IBM-LICENCE view on Meta::CPAN
THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
"Contribution" means:
a) in the case of International Business Machines Corporation ("IBM"),
the Original Program, and
b) in the case of each Contributor,
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from and
are distributed by that particular Contributor. A Contribution
'originates' from a Contributor if it was added to the Program by
such Contributor itself or anyone acting on such Contributor's
behalf. Contributions do not include additions to the Program
which: (i) are separate modules of software distributed in
conjunction with the Program under their own license agreement,
and (ii) are not derivative works of the Program.
"Contributor" means IBM and any other entity that distributes the
Program.
LICENCES/IBM-LICENCE view on Meta::CPAN
ii) effectively excludes on behalf of all Contributors all liability
for damages, including direct, indirect, special, incidental and
consequential damages, such as lost profits;
iii) states that any provisions which differ from this Agreement are
offered by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such
Contributor, and informs licensees how to obtain it in a
reasonable manner on or through a medium customarily used for
software exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy of the
Program.
Each Contributor must include the following in a conspicuous location
in the Program:
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/vldb/removeaddr
examples/v2/vldb/remsite
examples/v2/vldb/syncserv
examples/v2/bos/listkeys view on Meta::CPAN
foreach my $key (keys %{$keylist}) {
print "Key with kvno $key:\n";
foreach (keys %{$keylist->{$key}}) {
if ($_ eq 'key') { print_key($keylist->{$key}->{$_}); }
else { print "\tkey: $_, Value: '$keylist->{$key}->{$_}'\n"; }
}
}
}
chomp($lastmod = strftime('%d %b %R %Y', localtime($lastmod)));
print "Keys last changed on $lastmod\n";
print "All done.\n";
$bos->DESTROY;
sub print_key {
my $key = shift;
print "key is: ";
my (@val) = unpack("C*", $key);
foreach (@val) { printf("\\%o", $_); }
examples/v2/kas/ChangePassword view on Meta::CPAN
my $oldkey = AFS::KTC_EKEY->ReadPassword("Old Password:");
checkafs('Read old Passwd');
my $newkey = AFS::KTC_EKEY->ReadPassword("New Password:", 1, $user->cell);
checkafs('Read new Passwd');
my $token = AFS::KTC_TOKEN->GetAdminToken($user, $oldkey, 300);
checkafs('GetAdmintoken');
my $kas = AFS::KAS->AuthServerConn($token, &AFS::KA_MAINTENANCE_SERVICE);
checkafs('AuthServerConn');
my $rkey = $kas->randomkey;
my $ok = $kas->ChangePassword($user->name, $user->instance, $rkey, $newkey);
printf("Password changed: %s \n", $ok ? 'yes' : 'no');
checkafs('ChangePassword');
examples/v2/kas/examine view on Meta::CPAN
print "\nUser data for ", $user->name, $user->instance, "\n";
if ($$entry{'keyCheckSum'} == 0) {
print "\t key version is $$entry{'key_version'} ";
}
else {
print "\t key ($$entry{'key_version'}) cksum is $$entry{'keyCheckSum'}, ";
}
my $cpw_time = $$entry{'change_password_time'};
chomp(my $cpw_date = strftime('%a %b %d %T %Y', localtime($cpw_time)));
print " last cpw: $cpw_date\n";
if (! $$entry{'misc_auth_bytes'}) {
print "\t password will never expire.\n";
print "\t An unlimited number of unsuccessful authentications is permitted.\n";
}
else {
my $packed = $$entry{'misc_auth_bytes'};
my $pwexpire = (($packed >> 24) & 0xff);
examples/v2/kas/setfields view on Meta::CPAN
print "\n\nUser data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
printf("%20s %s\n",$tp_key, $$entry{$tp_key});
}
my $flags = 1; # (1 = normal, 4 = admin)
my $expire = 925715000;# 03 May 1999 07:03
my $maxassoc = 0;
my $lifetime = 48*60*60; # unit is secs; => 48 hrs
my $pwexpire = 10; # number of days
my $pw_reuse = 2; # pwreuse allowed: [1 = yes], [2 = no], [0 = not changed]
my $nfail = 4; # (nfail - 1) tries are allowed; => 3 tries
my $locktime = 3; # unit is 8.5 min => 3 * (8.5)
$pwexpire++;
$nfail++;
$locktime++;
my $packed= (($pwexpire << 24) | ($pw_reuse << 16) | ($nfail << 8) | $locktime );
#my $ok = $kas->setfields($user->name, $user->instance, $flags, $expire, $lifetime, $maxassoc, $packed);
my $ok = $kas->KAM_SetFields($user->name, $user->instance, $flags, $expire, $lifetime, $maxassoc, $packed);
examples/v2/kas/setpassword view on Meta::CPAN
my $princ = AFS::KTC_PRINCIPAL->new(shift);
my $key = AFS::KTC_EKEY->ReadPassword($princ->name."'s Password:");
my $token = AFS::KTC_TOKEN->GetAdminToken($princ, $key, 300);
my $kas = AFS::KAS->AuthServerConn($token, &AFS::KA_MAINTENANCE_SERVICE);
my $user = AFS::KTC_PRINCIPAL->new(shift);
my $nkey = AFS::KTC_EKEY->ReadPassword($user->name."'s NEW Password:");
my $ok = $kas->setpassword($user->name, $user->instance, 0, $nkey);
printf("setpasswd: Password changed: %s \n", $ok ? 'yes' : 'no');
checkafs('ChangePassword');
$ok = $kas->KAM_SetPassword($user->name, $user->instance, 0, $nkey);
printf("KAM_SetPasswd: Password changed: %s \n", $ok ? 'yes' : 'no');
checkafs('ChangePassword');
examples/v2/vldb/changeloc view on Meta::CPAN
die "Usage: $0 volume dest_server dest_partition \n" if $#ARGV != 2;
$volume = shift;
$server = shift;
$part = shift;
$vldb = AFS::VLDB->new;
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n";
$ok = $vldb->changeloc($volume, $server, $part);
if ($AFS::CODE) { print "AFS::CODE = $AFS::CODE\n"; }
else { print "Changed location to $server /vicep$part for volume $volume \n"; }
pod/v2/afsperlacl.pod view on Meta::CPAN
=item S< >
=item B<$acl = AFS::ACL-E<gt>retrieve(PATH [, FOLLOW]);>
Retrieves the ACL list for the given PATH and stores it in the object $acl.
=item B<$ok = AFS::ACL-E<gt>copyacl(FROMDIR, TODIR [, FOLLOW]);>
Copies the ACL list from a source directory FROMDIR to the specified destination
directory TODIR. The source directory''s ACL is unchanged.
=item B<$ok = AFS::ACL-E<gt>cleanacl(PATH [, FOLLOW]);>
Removes from the ACL list of the specified PATH any entry that
refers to a user or group that no longer has a Protection Database entry.
=item B<$crights = AFS::ACL-E<gt>crights(RIGHTS);>
Canonicalizes the RIGHTS string. Duplicate rights will be removed. It recognizes
the following special strings:
pod/v2/afsperlbos.pod view on Meta::CPAN
=item B<CONSTRUCTOR>
=item S< >
=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!
pod/v2/afsperlbos.pod view on Meta::CPAN
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
pod/v2/afsperlbos.pod view on Meta::CPAN
=item B<$ok = $bos-E<gt>startup([SERVER]);>
=item B<$ok = $bos-E<gt>startup([\@SERVER]);>
Starts on the server machine either all server processes not currently
running but marked with the I<run status flag> in the local
C<BosConfig> file or the process SERVER even if its status flag in the
C<BosConfig> file is I<NotRun>. SERVER is either a scalar value or a
reference to an array of process names. The I<run status flag> in the
local C<BosConfig> file will not be changed. It calls the AFS system
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
pod/v2/afsperlkas.pod view on Meta::CPAN
=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'.
=item B<DESTRUCTOR>
pod/v2/afsperlkas.pod view on Meta::CPAN
=item B<$entry = $kas-E<gt>getentry(UNAME, UINST);>
=item B<$entry = $kas-E<gt>KAM_Getentry(UNAME, UINST);>
Returns information from the Authentication Database entry for the
user entry UNAME.UINST. The return value is a reference to a hash
table containing the values from the C structure C<kaentryinfo>. The
hash table has the following keys
change_password_time flags keyCheckSum
key_version max_ticket_lifetime minor_version
misc_auth_bytes modification_time modification_user
user_expiration
It calls the AFS system library function 'KAM_GetEntry'.
=item B<($num_admins, $kasstats, $kadstats) = $kas-E<gt>getstats;>
=item B<($num_admins, $kasstats, $kadstats) = $kas-E<gt>KAM_GetStats(VERSION);>
pod/v2/afsperlkas.pod view on Meta::CPAN
=item B<$ok = $kas-E<gt>KAM_SetFields(UNAME, UINST, FLAGS, EXPIRE, LIFETIME, MAXASSOC, PACKED);>
This function alters the miscellaneous parameters associated with the
user entry UNAME.UINST. The FLAGS argument can be set to the following values
&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
=head1 CURRENT AUTHOR
pod/v2/afsperlpts.pod view on Meta::CPAN
=item B<CONSTRUCTOR>
=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>
pod/v2/afsperlpts.pod view on Meta::CPAN
=item S< >
=item B<$ok = $pts-E<gt>PR_AddToGroup(UID, GID);>
Adds the given AFS UID to the group whose numerical identifier is
GID.
=item B<$ok = $pts-E<gt>PR_ChangeEntry(ID, NAME, OID, NEWID);>
Allows the caller to change one or more aspects of the user or group
entry in the PDB whose numerical id is ID. An attempt to change the
entry for any of the reserved AFS ids (ANYUSERID, AUTHUSERID,
ANONYMOUSID, or SYSADMINID) will be rejected. The new name, if any, to
assign to the entry is held in NAME. If no name change is to be made,
then the name argument may be set to NULL. Similarly, the numerical
ID of the entry's (possibly new) owner is listed in the OID
parameter. If no owner change is desired, OID is set to zero. Finally,
a new numerical ID may be specified for the given entry in NEWID. If
this is set to zero, then the entry's ID will not be altered.
=item B<$ok = $pts-E<gt>PR_Delete(ID);>
Deletes the PDB entry for the user or group whose id is ID.
=item B<$entry = $pts-E<gt>PR_DumpEntry(POS);>
Returns the contents of the PDB entry located at byte offset POS
pod/v2/afsperlpts.pod view on Meta::CPAN
&AFS::PRGRP create a group
&AFS::PRUSER create a user
=item B<$ok = $pts-E<gt>PR_RemoveFromGroup(UID, GID);>
Removes the given AFS id UID from the group identified by GID.
=item B<$ok = $pts-E<gt>PR_SetFieldsEntry(ID, MASK, FLAGS, NGROUPS, NUSERS, S1, S2);>
This method allows a caller to change one or more fields within the
PDB entry matching the given user ID. The MASK argument is used to
select which fields are to be changed. Depending on what has been
selected, the values placed in the argument fLAGS (setting the flag
bits), NGROUPS (setting the group creation limit), and/or NUSERS
(setting the foreign user limit) are inserted into the PDB entry. The
remaining two arguments, S1 and S2, are not referenced, and are
reserved for future expansion.
=item B<$ok = $pts-E<gt>PR_SetMax(ID, GFLAG);>
Sets the value of either the highestÂallocated AFS user or group to
ID. The GFLAG argument is set to a nonÂzero value if the given ID is
pod/v2/afsperlvldb.pod view on Meta::CPAN
use AFS::VLDB;
my $vldb = AFS::VLDB->new(1, 120, 1);
$vol->DESTROY;
$vldb = AFS::VLDB->new;
my $ok = $vldb->addsite('server2', 'vicepa', 'volume');
$ok = $vldb->remsite('server1', '/vicepa', 'volume');
$ok = $vos->changeloc('volume', 'server2', '/vicepb');
$ok = $vldb->removeaddr('192.168.18.25');
my ($succ, $fail) = $vldb->delentry(['volume', 'volume.projects']);
($succ, $fail) = $vldb->delentry('volume');
($succ, $fail) = $vldb->delgroups('home', 'server', '/vicepa', 1);
my @addrlist = $vldb->listaddrs('', '', 0, 1);
my $vldblist = $vldb->listvldb('server1', '/vicepa');
pod/v2/afsperlvldb.pod view on Meta::CPAN
=item B<CONSTRUCTOR>
=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
pod/v2/afsperlvldb.pod view on Meta::CPAN
do this if the new site already has a current readonly replica of the
volume, but for some reason it is not in the VLDB as a replica site.
This is useful when an existing read-only volume is dumped and restored
with the B<-readonly> flag at the new site. This argument is supported
when the AFS Perl modules are linked with the OpenAFS system libraries
v1.4.7 or later.
It calls the AFS system library function I<UV_AddSite> or
I<UV_AddSite2> (OpenAFS v.1.4.12 or later).
=item B<$ok = $vldb-E<gt>changeloc(VOLUME, SERVER, PARTITION);>
Changes the location of the read/write VOLUME (volume name or volume
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]);>
pod/v2/afsperlvldb.pod view on Meta::CPAN
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,...}.
You can find an example how to print the entire content of
returned array of hashes in the C<examples/v2/vldb> directory.
=item B<$vldblist = $vldb-E<gt>listvldb([SERVER [, PARTITION [, LOCK]]]);>
Returns information from the Volume Location Database (VLDB) entry for
each volume specified. The return value is a reference to a hash
table containing the values from the C structure C<nvldbentry>. The
pod/v2/afsperlvos.pod view on Meta::CPAN
=item B<CONSTRUCTOR>
=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
pod/v2/afsperlvos.pod view on Meta::CPAN
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
=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
static struct ubik_client *internal_pts_new(code, sec, cell)
int32 *code;
int32 sec;
char *cell;
{
struct rx_connection *serverconns[MAXSERVERS];
struct rx_securityClass *sc = NULL;
struct ktc_token token;
struct afsconf_cell info;
/* tpf nog 03/29/99
* caused by changes in ubikclient.c,v 2.20 1996/12/10
* and in ubikclient.c,v 2.24 1997/01/21
* struct ubik_client *client; */
struct ubik_client *client = 0;
struct ktc_principal prin;
int32 i;
*code = internal_GetConfigDir();
if (*code == 0)
*code = internal_GetCellInfo(cell, "afsprot", &info);
char *funcName, afs_int32 gen_rxkad_level,
afs_int32 maxservers, char *serviceid, afs_int32 deadtime,
afs_uint32 server, afs_uint32 port, afs_int32 usrvid)
{
afs_int32 code, scIndex, i;
struct afsconf_cell info;
struct afsconf_dir *tdir;
struct ktc_principal sname;
struct ktc_token ttoken;
struct rx_securityClass *sc;
/* This must change if VLDB_MAXSERVERS becomes larger than MAXSERVERS */
static struct rx_connection *serverconns[MAXSERVERS];
char cellstr[64];
if (!rx_initialized) {
/* printf("ugen DEBUG rx_Init\n"); */
code = rx_Init(0);
if (code) {
char buffer[256];
sprintf(buffer, "%s: could not initialize rx.\n", funcName);
VSETCODE(code, buffer);
char buffer[sizeof(struct kaident)];
sprintf(buffer, "%s%s%s", ka->modification_user.name,
ka->modification_user.instance[0] ? "." : "", ka->modification_user.instance);
safe_hv_store(stats, "modification_user", 17, newSVpv(buffer, strlen(buffer)), 0);
safe_hv_store(stats, "minor_version", 13, newSViv(ka->minor_version), 0);
safe_hv_store(stats, "flags", 5, newSViv(ka->flags), 0);
safe_hv_store(stats, "user_expiration", 15, newSViv(ka->user_expiration), 0);
safe_hv_store(stats, "modification_time", 17, newSViv(ka->modification_time), 0);
safe_hv_store(stats, "change_password_time", 20, newSViv(ka->change_password_time), 0);
safe_hv_store(stats, "max_ticket_lifetime", 19, newSViv(ka->max_ticket_lifetime), 0);
safe_hv_store(stats, "key_version", 11, newSViv(ka->key_version), 0);
safe_hv_store(stats, "keyCheckSum", 11, newSVuv(ka->keyCheckSum), 0);
safe_hv_store(stats, "misc_auth_bytes", 15, newSVuv(ka->misc_auth_bytes), 0);
safe_hv_store(stats, "passwd_reuse", 12, newSViv(ka->reserved3), 0);
/* 1234567890123456789012345 */
return 1;
}
static int parse_ka_getstats(stats, dstats, kas, kad)
vi.in_size = sizeof(*status) + 3;
vi.in = space;
vi.out_size = MAXSIZE;
vi.out = space;
status = (VolumeStatus *) space;
status->MinQuota = -1;
status->MaxQuota = newquota;
input = (char *) status + sizeof(*status);
*(input++) = '\0'; /* never set name: this call doesn't change vldb */
*(input++) = '\0'; /* offmsg */
*(input++) = '\0'; /* motd */
code = pioctl(path, VIOCSETVOLSTAT, &vi, follow);
SETCODE(code);
RETVAL = (code == 0);
}
OUTPUT:
RETVAL
}
RETVAL = 1;
done:
;
}
OUTPUT:
RETVAL
int32
vldb_changeloc(cstruct, id, server, partition)
AFS::VLDB cstruct
char *id
char *server
char *partition
PREINIT:
#ifdef OpenAFS
afs_int32 avolid, aserver, apart, code, err;
#endif
CODE:
{
if (code)
set_errbuff(buffer, code);
else
sprintf(buffer, "AFS::VLDB: partition %s does not exist on the server\n", server);
VSETCODE(code ? code : -1, buffer);
goto done;
}
/* printf("DEBUG-5\n"); */
code = UV_ChangeLocation(aserver, apart, avolid);
if (code) {
VSETCODE(code, "changeloc");
goto done;
}
SETCODE(0);
RETVAL = 1;
done:
;
#else
not_here("AFS::VLDB::changeloc");
#endif
}
OUTPUT:
RETVAL
void
vldb__listvldb(cstruct, name=NULL, servername=NULL, parti=NULL, lock=0)
AFS::VLDB cstruct
char *name
char *servername
RETVAL = 1;
done:
;
}
OUTPUT:
RETVAL
int32
vldb__changeaddr(cstruct, oldip, newip, remove=0)
AFS::VLDB cstruct
char *oldip
char *newip
int32 remove
PREINIT:
int32 ip1, ip2, vcode;
CODE:
{
RETVAL = 0;
char buff[80];
sprintf(buff, "Could not remove server %s from the VLDB", oldip);
if (vcode == VL_NOENT) {
sprintf(buffer, "%s\nvlserver does not support the REMOVE flag or VLDB: no such entry", buff);
}
else {
sprintf(buffer, "%s\n", buff);
}
}
else {
sprintf(buffer, "Could not change server %s to server %s\n", oldip, newip);
}
VSETCODE(vcode, buffer);
goto done;
}
if (remove) {
fprintf(STDOUT, "Removed server %s from the VLDB\n", oldip);
}
else {
fprintf(STDOUT, "Changed server %s to server %s\n", oldip, newip);
sv = *av_fetch(av, i, 0);
if (sv) {
/* instance = (char *) safemalloc(BOZO_BSSIZE); */
Newx(instance, BOZO_BSSIZE, char);
instance = SvPV(sv, namelen);
/* printf("DEBUG-XS-bos-stop-3-1 %d %s\n", len, instance); */
code = BOZO_SetStatus(self, instance, BSTAT_SHUTDOWN);
/* printf("DEBUG-XS-bos-stop-3-2 %d \n", code); */
if (code) {
char buffer[256];
sprintf(buffer, "AFS::BOS: failed to change stop instance %s (%s)\n",
instance, em(code));
BSETCODE(code, buffer);
goto done;
}
/*if (instance) */
/* Safefree(instance); */
}
} /* for loop */
}
/* printf("DEBUG-XS-bos-stop-4 \n"); */
}
else {
safe_hv_store(key, "keyCheckSum", 11, newSVuv(keyInfo.keyCheckSum), 0);
}
}
sprintf(index, "%d", kvno);
safe_hv_store(list, index, strlen(index), newRV_inc((SV *) (key)), 0);
} /* for loop */
if (everWorked) {
/* fprintf(stderr, "Keys last changed on %d.\n", keyInfo.mod_sec); */
EXTEND(sp, 2);
PUSHs(sv_2mortal(newSViv(keyInfo.mod_sec)));
PUSHs(newRV_inc((SV *) (list)));
}
if (code != BZDOM) {
char buffer[256];
sprintf(buffer, "AFS::BOS: %s error encountered while listing keys\n", em(code));
BSETCODE(code, buffer);
}
else {
src/Makefile.PL view on Meta::CPAN
# }
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";
# change the library name of the AFS system library "vlib.a"
# my $command = "\'s#-lvlib#$AFSPath/lib/afs/vlib.a#\'";
# system("perl -p -i.bak -e $command Makefile") unless -f "$AFSPath/lib/afs/libvlib.a";
# change the library name of the AFS system library "libcom_err"
$command = "\'s#-lcom_err#$AFSPath/lib/afs/libcom_err.a#\'";
system("perl -p -i.bak -e $command Makefile");
# change the library name of the AFS system library "-lafsrpc"
if ($alpha_sys =~ /linux/ && $alpha_sys !~ /i386_linux2/) {
$command = "\'s#-lc -lafsrpc -lc#$AFSPath/lib/libafsrpc_pic.a#g\'";
}
else {
$command = "\'s#-lc -lafsrpc -lc#$AFSPath/lib/libafsrpc.a#g\'";
}
system("perl -p -i.bak -e $command Makefile");
# change the library name of the AFS system library "-lafsauthent"
if ($alpha_sys =~ /linux/ && $alpha_sys !~ /i386_linux2/) {
$command = "\'s#-lc -lafsauthent -lc#$AFSPath/lib/libafsauthent_pic.a#g\'";
}
else {
$command = "\'s#-lc -lafsauthent -lc#$AFSPath/lib/libafsauthent.a#g\'";
}
system("perl -p -i.bak -e $command Makefile");
# make changes to the typemap file if Perl < 5.6.0
$command = "\'s#T_UV#T_IV#\'";
system("perl -p -i.bak -e $command typemap") unless $] >= 5.006;
src/VLDB/VLDB.pm view on Meta::CPAN
my $self = shift;
$self->_listvldb($_[0]);
}
sub removeaddr {
my $self = shift;
my $ip_addr = shift;
$self->_changeaddr($ip_addr, '', 1);
}
sub syncvldb {
my $self = shift;
$self->_syncvldb(@_);
}
sub syncvldbentry {
my $self = shift;
src/VLDB/t/VLDB.t view on Meta::CPAN
like($AFS::CODE, qr/no such entry/, 'vldb->unlock');
ok(! $ok, 'vldb->unlock');
$vldb->addsite('no_server', '/vicepa', 'root.afs');
like($AFS::CODE, qr/not found in host table/, 'vldb->addsite(no_serv)');
$vldb->addsite($server, 'no_partition', 'root.afs');
like($AFS::CODE, qr/could not interpret partition name/, 'vldb->addsite(no_part)');
$vldb->addsite($server, $part, 'no_volume');
like($AFS::CODE, qr/no such entry/, 'vldb->addsite(no_vol)');
$vldb->changeloc('root.afs', 'no_server', '/vicepa');
like($AFS::CODE, qr/not found in host table/, 'vldb->changeloc(no_serv)');
$vldb->changeloc('root.afs', $server, 'no_partition');
like($AFS::CODE, qr/could not interpret partition name/, 'vldb->changeloc(no_part)');
$vldb->changeloc('no_volume', $server, $part);
like($AFS::CODE, qr/no such entry/, 'vldb->changeloc(no_vol)');
my ($succ, $fail) = $vldb->delentry('no_volume');
like($AFS::CODE, qr/no such entry/, 'vldb->delentry(no_vol)');
ok(! $succ, 'succ = vldb->delentry(no_vol)');
ok(! $fail, 'fail = vldb->delentry(no_vol)');
($succ, $fail) = $vldb->delgroups('', '', '', '');
like($AFS::CODE, qr/You must specify an argument/, 'vldb->delgroups(no arguments)');
ok(! $succ, 'succ = vldb->delgroups(no arguments)');
ok(! $fail, 'fail = vldb->delgroups(no arguments)');
src/inc/Test/Builder.pm view on Meta::CPAN
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
# test suites while still getting normal test output.
open(TESTOUT, ">&STDOUT") or die "Can't dup STDOUT: $!";
open(TESTERR, ">&STDERR") or die "Can't dup STDERR: $!";
# Set everything to unbuffered else plain prints to STDOUT will
# come out in the wrong order from our own prints.
_autoflush(\*TESTOUT);
_autoflush(\*STDOUT);
_autoflush(\*TESTERR);
_autoflush(\*STDERR);
src/inc/Test/Builder.pm view on Meta::CPAN
sub current_test {
my($self, $num) = @_;
lock($Curr_Test);
if( defined $num ) {
unless( $Have_Plan ) {
require Carp;
Carp::croak("Can't change the current test number without a plan!");
}
$Curr_Test = $num;
if( $num > @Test_Results ) {
my $start = @Test_Results ? $#Test_Results + 1 : 0;
for ($start..$num-1) {
my %result;
share(%result);
%result = ( ok => 1,
actual_ok => undef,
src/ppport.h view on Meta::CPAN
=head1 SYNOPSIS
perl ppport.h [options] [source files]
Searches current directory for files if no [source files] are given
--help show short help
--version show version
--patch=file write one patch file with changes
--copy=suffix write changed copies with suffix
--diff=program use diff program and options
--compat-version=version provide compatibility with Perl version
--cplusplus accept C++ comments
--quiet don't output anything except fatal errors
--nodiag don't show diagnostics
--nohints don't show hints
--nochanges don't suggest changes
--nofilter don't filter input files
--strip strip all script and doc functionality from
ppport.h
--list-provided list provided API
--list-unsupported list unsupported API
--api-info=name show Perl API portability information
=head1 COMPATIBILITY
src/ppport.h view on Meta::CPAN
Display a brief usage summary.
=head2 --version
Display the version of F<ppport.h>.
=head2 --patch=I<file>
If this option is given, a single patch file will be created if
any changes are suggested. This requires a working diff program
to be installed on your system.
=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>
src/ppport.h view on Meta::CPAN
=head2 --nodiag
Don't output any diagnostic messages. Only portability
alerts will be printed.
=head2 --nohints
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>.
src/ppport.h view on Meta::CPAN
sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
sv_unmagicext() NEED_sv_unmagicext NEED_sv_unmagicext_GLOBAL
vload_module() NEED_vload_module NEED_vload_module_GLOBAL
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
should make any changes to your code, and whether any special defines
should be used, F<ppport.h> can be run as a Perl script to check your
source code. Simply say:
perl ppport.h
The result will usually be a list of patches suggesting changes
that should at least be acceptable, if not necessarily the most
efficient solution, or a fix for all possible problems.
If you know that your XS module uses features only available in
newer Perl releases, if you're aware that it uses C++ comments,
and if you want all suggestions as a single patch file, you could
use something like this:
perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
If you only want your code to be scanned without any suggestions
for changes, use:
perl ppport.h --nochanges
You can specify a different C<diff> program or options, using
the C<--diff> option:
perl ppport.h --diff='diff -C 10'
This would output context diffs with 10 lines of context.
If you want to create patched copies of your files instead, use:
src/ppport.h view on Meta::CPAN
# Disable broken TRIE-optimization
BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
my $VERSION = 3.23;
my %opt = (
quiet => 0,
diag => 1,
hints => 1,
changes => 1,
cplusplus => 0,
filter => 1,
strip => 0,
version => 0,
);
my($ppport) = $0 =~ /([\w.]+)$/;
my $LF = '(?:\r\n|[\r\n])'; # line feed
my $HS = "[ \t]"; # horizontal whitespace
# Never use C comments in this file!
my $ccs = '/'.'*';
my $cce = '*'.'/';
my $rccs = quotemeta $ccs;
my $rcce = quotemeta $cce;
eval {
require Getopt::Long;
Getopt::Long::GetOptions(\%opt, qw(
help quiet diag! filter! hints! changes! cplusplus strip version
patch=s copy=s diff=s compat-version=s
list-provided list-unsupported api-info=s
)) or usage();
};
if ($@ and grep /^-/, @ARGV) {
usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
die "Getopt::Long not found. Please don't use any options.\n";
}
src/ppport.h view on Meta::CPAN
modkids|||
more_bodies|||
more_sv|||
moreswitches|||
mro_clean_isarev|||
mro_gather_and_rename|||
mro_get_from_name||5.010001|
mro_get_linear_isa_dfs|||
mro_get_linear_isa||5.009005|
mro_get_private_data||5.010001|
mro_isa_changed_in|||
mro_meta_dup|||
mro_meta_init|||
mro_method_changed_in||5.009005|
mro_package_moved|||
mro_register||5.010001|
mro_set_mro||5.010001|
mro_set_private_data||5.010001|
mul128|||
mulexp10|||n
my_atof2||5.007002|
my_atof||5.006000|
my_attrs|||
my_bcopy|||n
src/ppport.h view on Meta::CPAN
unless (open IN, "<$filename") {
warn "Unable to read from $filename: $!\n";
next;
}
info("Scanning $filename ...");
my $c = do { local $/; <IN> };
close IN;
my %file = (orig => $c, changes => 0);
# Temporarily remove C/XS comments and strings from the code
my @ccom;
$c =~ s{
( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
| ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
| ( ^$HS*\#[^\r\n]*
| "[^"\\]*(?:\\.[^"\\]*)*"
| '[^'\\]*(?:\\.[^'\\]*)*'
src/ppport.h view on Meta::CPAN
info("=== Analyzing $filename ===");
my %file = %{$files{$filename}};
my $func;
my $c = $file{code};
my $warnings = 0;
for $func (sort keys %{$file{uses_Perl}}) {
if ($API{$func}{varargs}) {
unless ($API{$func}{nothxarg}) {
my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
{ $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
if ($changes) {
warning("Doesn't pass interpreter argument aTHX to Perl_$func");
$file{changes} += $changes;
}
}
}
else {
warning("Uses Perl_$func instead of $func");
$file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
{$func$1(}g);
}
}
for $func (sort keys %{$file{uses_replace}}) {
warning("Uses $func instead of $replace{$func}");
$file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
}
for $func (sort keys %{$file{uses_provided}}) {
if ($file{uses}{$func}) {
if (exists $file{uses_deps}{$func}) {
diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
}
else {
diag("Uses $func");
}
src/ppport.h view on Meta::CPAN
for $func (sort keys %{$file{needed_static}}) {
my $message = '';
if (not exists $file{uses}{$func}) {
$message = "No need to define NEED_$func if $func is never used";
}
elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
$message = "No need to define NEED_$func when already needed globally";
}
if ($message) {
diag($message);
$file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
}
}
for $func (sort keys %{$file{needed_global}}) {
my $message = '';
if (not exists $global{uses}{$func}) {
$message = "No need to define NEED_${func}_GLOBAL if $func is never used";
}
elsif (exists $file{needs}{$func}) {
if ($file{needs}{$func} eq 'extern') {
$message = "No need to define NEED_${func}_GLOBAL when already needed globally";
}
elsif ($file{needs}{$func} eq 'static') {
$message = "No need to define NEED_${func}_GLOBAL when only used in this file";
}
}
if ($message) {
diag($message);
$file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
}
}
$file{needs_inc_ppport} = keys %{$file{uses}};
if ($file{needs_inc_ppport}) {
my $pp = '';
for $func (sort keys %{$file{needs}}) {
my $type = $file{needs}{$func};
src/ppport.h view on Meta::CPAN
}
else {
diag("File needs $func, adding static request");
}
$pp .= "#define NEED_$func$suffix\n";
}
}
if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
$pp = '';
$file{changes}++;
}
unless ($file{has_inc_ppport}) {
diag("Needs to include '$ppport'");
$pp .= qq(#include "$ppport"\n)
}
if ($pp) {
$file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
|| ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
|| ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
|| ($c =~ s/^/$pp/);
}
}
else {
if ($file{has_inc_ppport}) {
diag("No need to include '$ppport'");
$file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
}
}
# put back in our C comments
my $ix;
my $cppc = 0;
my @ccom = @{$file{ccom}};
for $ix (0 .. $#ccom) {
if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
$cppc++;
$file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
}
else {
$c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
}
}
if ($cppc) {
my $s = $cppc != 1 ? 's' : '';
warning("Uses $cppc C++ style comment$s, which is not portable");
}
my $s = $warnings != 1 ? 's' : '';
my $warn = $warnings ? " ($warnings warning$s)" : '';
info("Analysis completed$warn");
if ($file{changes}) {
if (exists $opt{copy}) {
my $newfile = "$filename$opt{copy}";
if (-e $newfile) {
error("'$newfile' already exists, refusing to write copy of '$filename'");
}
else {
local *F;
if (open F, ">$newfile") {
info("Writing copy of '$filename' with changes to '$newfile'");
print F $c;
close F;
}
else {
error("Cannot open '$newfile' for writing: $!");
}
}
}
elsif (exists $opt{patch} || $opt{changes}) {
if (exists $opt{patch}) {
unless ($patch_opened) {
if (open PATCH, ">$opt{patch}") {
$patch_opened = 1;
}
else {
error("Cannot open '$opt{patch}' for writing: $!");
delete $opt{patch};
$opt{changes} = 1;
goto fallback;
}
}
mydiff(\*PATCH, $filename, $c);
}
else {
fallback:
info("Suggested changes:");
mydiff(\*STDOUT, $filename, $c);
}
}
else {
my $s = $file{changes} == 1 ? '' : 's';
info("$file{changes} potentially required change$s detected");
}
}
else {
info("Looks good");
}
}
close PATCH if $patch_opened;
exit 0;
src/ppport.h view on Meta::CPAN
yy_parser DPPP_(dummy_PL_parser);
#else
extern yy_parser DPPP_(dummy_PL_parser);
#endif
# endif
/* PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf depends on PL_parser */
/* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
* Do not use this variable unless you know exactly what you're
* doint. It is internal to the perl parser and may change or even
* be removed in the future. As of perl 5.9.5, you have to check
* for (PL_parser != NULL) for this variable to have any effect.
* An always non-NULL PL_parser dummy is provided for earlier
* perl versions.
* If PL_parser is NULL when you try to access this variable, a
* dummy is being accessed instead and a warning is issued unless
* you define DPPP_PL_parser_NO_DUMMY_WARNING.
* If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
* this variable will croak with a panic message.
*/