Hi Lars,
On Mon, May 05 2008, Lars Schimmer wrote:
>
> Hi!
>
> I used to use the afsss.pl script from mr. Wiesand
> http://www-zeuthen.desy.de/~wiesand/AFS/ and all was fine after I got
> the perl modules as a .deb.
>
> But since a few days (after some updates) I get this error:
>
> vldb->listaddrs Code=AFS::VLDB: could not list the server addresses
>
> Is anyone else using the AFS::VLDB package or the script on debian
> lenny/etch and can give me a hint what went wrong?
the appended patch should solve your problem. Please let me know if
it is working for you.
Cheers,
Norbert
--
Ceterum censeo | PGP encrypted mail preferred.
Redmond esse delendam. | PGP Key at www.MPA-Garching.MPG.de/~nog/
--- AFS-2.4.0-p/src/Makefile.PL.orig 2005-12-22 07:32:52.000000000 +0100
+++ AFS-2.4.0-p/src/Makefile.PL 2008-05-15 14:17:58.000000000 +0200
@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------
-# RCS-Id: "@(#)$Id: Makefile.PL 751 2005-12-22 06:32:52Z nog $"
+# RCS-Id: "@(#)$Id: Makefile.PL 785 2007-07-12 07:16:12Z nog $"
#
-# Copyright © 2001-2005 Norbert E. Gruener <[EMAIL PROTECTED]>
+# Copyright © 2001-2007 Norbert E. Gruener <[EMAIL PROTECTED]>
#
# This library is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -74,19 +74,12 @@
if (-r "/usr/local/include/afs/afs.h") { $guess_path = '/usr/local'; }
elsif (-r "/usr/afsws/include/afs/afs.h") { $guess_path = '/usr/afsws'; }
elsif (-r "/usr/include/afs/afs.h") { $guess_path = '/usr'; }
+else { $guess_path = 'unknown'; }
-my $AFSPath;
-if (defined $ENV{AFSPATH}) {
- $AFSPath = $ENV{AFSPATH};
-}
-else {
- $AFSPath = $guess_path || 'unknown';
- print "\nPath to the AFS installation (libraries, binaries, \n";
- print "header files) to be used for this installation? \t [$AFSPath] ";
- chomp(my $answer = <STDIN>);
- $AFSPath = $answer if $answer;
- print "\n";
-}
+my $AFSPath = $ENV{AFSPATH} || $guess_path;
+my $msg = "\nPath to the AFS installation (libraries, binaries, \n"
+ . "header files) to be used for this installation? \t ";
+$AFSPath = prompt($msg, $AFSPath);
$AFSPath =~ s\/$\\;
# determine the alpha_sys value
@@ -104,6 +97,8 @@
# find out the AFS version of the AFS system libraries
open FILE, ">fotav.c";
print FILE <<'EOF';
+#include <stdio.h>
+
int main(void)
{
extern char *AFSVersion;
--- AFS-2.4.0-p/src/AFS.xs.orig 2006-02-16 14:13:16.000000000 +0100
+++ AFS-2.4.0-p/src/AFS.xs 2008-05-15 14:18:11.000000000 +0200
@@ -2,7 +2,7 @@
*
* AFS.xs - AFS extensions for Perl
*
- * RCS-Id: @(#)$Id: AFS.xs 772 2006-02-16 13:13:16Z nog $
+ * RCS-Id: @(#)$Id: AFS.xs 790 2008-02-07 08:12:33Z nog $
*
* Copyright (c) 2003, International Business Machines Corporation and others.
*
@@ -11,7 +11,7 @@
* directory or online at http://www.openafs.org/dl/license10.html
*
* Contributors
- * 2004-2006: Norbert E. Gruener <[EMAIL PROTECTED]>
+ * 2004-2008: Norbert E. Gruener <[EMAIL PROTECTED]>
* 2003: Alf Wachsmann <[EMAIL PROTECTED]>
* Venkata Phani Kiran Achanta <[EMAIL PROTECTED]>, and
* Norbert E. Gruener <[EMAIL PROTECTED]>
@@ -54,6 +54,7 @@
#include <stdio.h>
#include <netinet/in.h>
#include <sys/stat.h>
+#undef INIT
#include <afs/stds.h>
#include <afs/afs.h>
#include <afs/afsint.h>
@@ -97,7 +98,7 @@
#define uint32 afs_uint32
#endif
-const char *const xs_version = "AFS.xs (Major Version 2.4 $Rev: 772 $)";
+const char *const xs_version = "AFS.xs (Major Version 2.4 $Rev: 790 $)";
/* here because it seemed too painful to #define KERNEL before #inc afs.h */
struct VenusFid {
@@ -1348,7 +1349,6 @@
char pname[10];
char hostname[256];
- hv_store(vol, "name", 4, newSVpv(pntr->name, strlen((char *)
pntr->name)), 0);
if (fast) {
hv_store(vol, "volid", 5, newSViv(pntr->volid), 0);
}
@@ -1357,7 +1357,7 @@
hv_store(vol, "volid", 5, newSViv(pntr->volid), 0);
if (pntr->status == VOK) {
-
+ hv_store(vol, "name", 4, newSVpv(pntr->name, strlen((char *)
pntr->name)), 0);
if (pntr->type == 0)
hv_store(vol, "type", 4, newSVpv("RW", 2), 0);
if (pntr->type == 1)
@@ -1429,9 +1429,9 @@
/* Fully-detailed listing. */
hv_store(stats, "status", 6, newSViv(a_xInfoP->status), 0);
+ hv_store(stats, "volid", 5, newSViv(a_xInfoP->volid), 0);
if (a_xInfoP->status == VOK) {
/* Volume's status is OK - all the fields are valid. */
- hv_store(stats, "volid", 5, newSViv(a_xInfoP->volid), 0);
if (a_xInfoP->type == 0)
hv_store(stats, "type", 4, newSVpv("RW", 2), 0);
@@ -1610,10 +1610,24 @@
for (i = 0; i < count; i++) {
HV *vol = (HV *) sv_2mortal((SV *) newHV());
myDisplayFormat(vol, pntr, server, part, &totalOK, &totalNotOK,
&totalBusy, fast);
- hv_store(partition, pntr->name, strlen(pntr->name), newRV_inc((SV *)
(vol)), 0);
+ char buff[32];
+ if (pntr->status == VOK) {
+ hv_store(partition, pntr->name, strlen(pntr->name), newRV_inc((SV
*) (vol)), 0);
+ }
+ else if (pntr->status == VBUSY) {
+ sprintf(buff, "volume_busy_%d", i);
+ hv_store(partition, buff, strlen(buff), newRV_inc((SV *) (vol)),
0);
+ /* fprintf(STDERR, "DEBUG-1: %s %d\n", buff, strlen(buff)); */
+ }
+ else {
+ sprintf(buff, "volume_notok_%d", i);
+ hv_store(partition, buff, strlen(buff), newRV_inc((SV *) (vol)),
0);
+ /* fprintf(STDERR, "DEBUG-2: %s %d\n", buff, strlen(buff)); */
+ }
pntr++;
}
if (!fast) {
+ hv_store(partition, " totalOK", 8, newSViv(totalOK), 0);
hv_store(partition, " totalBusy", 10, newSViv(totalBusy), 0);
hv_store(partition, " totalNotOK", 11, newSViv(totalNotOK), 0);
}
@@ -1715,12 +1729,25 @@
a_xInfoP,
a_servID,
a_partID, &totalOK, &totalNotOK, &totalBusy);
- hv_store(part, a_xInfoP->name, strlen(a_xInfoP->name), newRV_inc((SV
*) (vol)),
- 0);
+ char buff[32];
+ if (a_xInfoP->status == VOK) {
+ hv_store(part, a_xInfoP->name, strlen(a_xInfoP->name),
newRV_inc((SV *) (vol)), 0);
+ }
+ else if (a_xInfoP->status == VBUSY) {
+ sprintf(buff, "volume_busy_%d", i);
+ hv_store(part, buff, strlen(buff), newRV_inc((SV *) (vol)), 0);
+ /* fprintf(STDERR, "DEBUG-1: %s %d\n", buff, strlen(buff)); */
+ }
+ else {
+ sprintf(buff, "volume_notok_%d", i);
+ hv_store(part, buff, strlen(buff), newRV_inc((SV *) (vol)), 0);
+ /* fprintf(STDERR, "DEBUG-2: %s %d\n", buff, strlen(buff)); */
+ }
a_xInfoP++;
}
/* If any volumes were found to be busy or screwed, display them.*/
+ hv_store(part, " totalOK", 8, newSViv(totalOK), 0);
hv_store(part, " totalBusy", 10, newSViv(totalBusy), 0);
hv_store(part, " totalNotOK", 11, newSViv(totalNotOK), 0);
} /*XDisplayVolumes */
@@ -1771,9 +1798,9 @@
if (isMixed) {
if (entry->serverFlags[i] & NEW_REPSITE)
- hv_store(server, "release", 7, newSVpv("New release", 12), 0);
+ hv_store(server, "release", 7, newSVpv("New release", 11), 0);
else
- hv_store(server, "release", 7, newSVpv("Old release", 12), 0);
+ hv_store(server, "release", 7, newSVpv("Old release", 11), 0);
}
else {
if (entry->serverFlags[i] & RO_DONTUSE)
@@ -2191,7 +2218,7 @@
*code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), (char *) 0);
if (*code == 0) {
/* have tickets, will travel */
- if (ttoken.kvno >= 0 && ttoken.kvno <= 255);
+ if (ttoken.kvno >= 0 && ttoken.kvno <= 256);
else {
fprintf(stderr,
"AFS::BOS: funny kvno (%d) in ticket,
proceeding\n",
@@ -5565,11 +5592,10 @@
int extended
PREINIT:
afs_int32 apart = -1, aserver, code = 0;
- volintInfo *pntr,*oldpntr;
+ volintInfo *pntr;
afs_int32 count;
int i;
- char *base;
- volintXInfo *xInfoP, *origxInfoP; /*Ptr to current/orig extended vol
info*/
+ volintXInfo *xInfoP; /*Ptr to current/orig extended vol
info*/
int wantExtendedInfo; /*Do we want extended vol info?*/
char pname[10];
@@ -5661,21 +5687,13 @@
XSRETURN_UNDEF;
goto done;
}
- if (wantExtendedInfo) {
- origxInfoP = xInfoP;
- base = (char *) xInfoP;
- }
- else {
- oldpntr = pntr;
- base = (char *) pntr;
- }
MapPartIdIntoName(dummyPartList.partId[i], pname);
if (wantExtendedInfo) {
XDisplayVolumes(part,
aserver,
dummyPartList.partId[i],
- origxInfoP, count);
+ xInfoP, count);
if (xInfoP)
Safefree(xInfoP);
xInfoP = (volintXInfo *) 0;
@@ -5684,7 +5702,7 @@
DisplayVolumes(part,
aserver,
dummyPartList.partId[i],
- oldpntr, count, fast);
+ pntr, count, fast);
if (pntr)
Safefree(pntr);
pntr = (volintInfo *) 0;
@@ -6932,6 +6950,11 @@
continue;
}
+ if (vcode == VL_INDEXERANGE) {
+ vcode = 0;
+ break;
+ }
+
if (vcode) {
char buffer[80];
sprintf(buffer, "AFS::VLDB: could not list the server
addresses\n");
--- AFS-2.4.0-p/Makefile.PL.orig 2005-12-15 13:49:23.000000000 +0100
+++ AFS-2.4.0-p/Makefile.PL 2008-05-15 14:17:45.000000000 +0200
@@ -16,16 +16,6 @@
$rm_file = './src/AFS.pm';
}
-WriteMakefile(
- 'NAME' => 'AFS',
- 'VERSION' => $VERSION,
- ($] >= 5.005 ?
- ('AUTHOR' => 'Norbert E Gruener <[EMAIL PROTECTED]>',
- 'ABSTRACT' => 'Perl interface to AFS programming APIs',
- 'NO_META' => true) : () ),
- 'realclean' => {FILES => "Makefile.bak pod/v2/*.html
pod/v2/pod2htm* lib $rm_file" },
- );
-
# provide the POD documentation
mkdir('./lib');
mkdir('./lib/AFS');
@@ -45,6 +35,16 @@
system("cp ./pod/v2/afsperlvldb.pod lib/AFS/VLDB.pod");
system("cp ./pod/v2/afsperlvos.pod lib/AFS/VOS.pod");
+WriteMakefile(
+ 'NAME' => 'AFS',
+ 'VERSION' => $VERSION,
+ ($] >= 5.005 ?
+ ('AUTHOR' => 'Norbert E Gruener <[EMAIL PROTECTED]>',
+ 'ABSTRACT' => 'Perl interface to AFS programming APIs',
+ 'NO_META' => true) : () ),
+ 'realclean' => {FILES => "Makefile.bak pod/v2/*.html
pod/v2/pod2htm* lib $rm_file" },
+ );
+
sub MY::postamble {
'
html: Makefile