AFS

 view release on metacpan or  search on metacpan

examples/v2/kas/examine  view on Meta::CPAN

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);
    my $is_locked = (($packed >> 16) & 0xff);
    my $nfail     = (($packed >>  8) & 0xff);
    my $locktime  = (($packed >>  0) & 0xff);

    if (! $pwexpire) { print "\t password will never expire.\n"; }
    else             { print "\t password will expire: $pwexpire\n"; }

    if (! $nfail) { print "\t An unlimited number of unsuccessful authentications is permitted.\n"; }
    else          { print "\t $nfail consecutive unsuccessful authentications are permitted.\n";
                    if (! $locktime) { print "\t The lock time for this user is not limited.\n"; }
                    else             { print "\t The lock time for this user is $locktime minutes.  !!! umrechnen !!!\n"; }
                    if (! $is_locked) { print "\t IS_LOCKED: muss noch gecheckt werden !!!\n"; }
                    else              { print "\t IS_LOCKED: uss noch gecheckt werden !!!\n"; }
                }
}

my $exp_date = $$entry{'user_expiration'};
if ($$entry{'user_expiration'} < 0)       { print "\t entry never expires."; }
elsif ($$entry{'user_expiration'} < $now) { print "\t DISABLED entry at $exp_date."; }
else                                      { print "\t entry expires on $exp_date."; }

my $ticket_lifetime = $$entry{'max_ticket_lifetime'} / 3600;

examples/v2/kas/getentry  view on Meta::CPAN

$Debug && print "AFS::CODE 5 = $AFS::CODE \n";
my $entry = $kas->getentry($user->name, $user->instance);
$Debug && print "AFS::CODE 6 = $AFS::CODE \n";
print "\n\ngetentry:\n User data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
    printf("%20s  %s\n",$tp_key, $$entry{$tp_key});
    if ($tp_key =~ 'misc_auth_bytes') {
        if ($$entry{$tp_key}) {
            my $packed    = $$entry{$tp_key};
            my $pwexpire  = (($packed >> 24) & 0xff);
            my $is_locked = (($packed >> 16) & 0xff);
            my $nfail     = (($packed >>  8) & 0xff);
            my $locktime  = (($packed >>  0) & 0xff);
            print "\t\t pwexpire  $pwexpire\n";
            print "\t\t nfail     $nfail\n";
            print "\t\t locktime  $locktime\n";
            print "\t\t is_locked $is_locked\n";
        }
    }
    if ($tp_key =~ 'passwd_reuse') {
        my $reused = $$entry{'passwd_reuse'} - 0x12340000;
        print "\t\t permit password reuse $reused \n";
    }
}

$entry = $kas->KAM_GetEntry($user->name, $user->instance);
print "\n\nKAM_GetEntry:\n User data for ", $user->name, $user->instance, ": \n";

examples/v2/kas/setfields  view on Meta::CPAN

checkafs('SetFields');

$entry = $kas->getentry($user->name, $user->instance);
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});
    if ($tp_key =~ 'misc_auth_bytes') {
        if ($$entry{$tp_key}) {
            my $packed    = $$entry{$tp_key};
            my $pwexpire  = (($packed >> 24) & 0xff);
            my $is_locked = (($packed >> 16) & 0xff);
            my $nfail     = (($packed >>  8) & 0xff);
            my $locktime  = (($packed >>  0) & 0xff);
            print "\t\t pwexpire  $pwexpire\n";
            print "\t\t nfail     $nfail\n";
            print "\t\t locktime  $locktime\n";
            print "\t\t is_locked $is_locked\n";
        }
    }
    if ($tp_key =~ 'passwd_reuse') {
        my $reused = $$entry{'passwd_reuse'} - 0x12340000;
        print "\t\t permit password reuse $reused \n";
    }
}

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

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

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

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

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

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

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

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

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

incremental dump, which includes only the files and directories in the
volume that have modification timestamps later than a certain time,
specify a date and time as the value for the TIME argument.  By
default, the VL server consults the Volume Location Database (VLDB) to
learn the volume's location.  To dump the read-only volume from a
particular site, use the SERVER and PARTITION arguments to specify the
site.

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

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

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

src/AFS.xs  view on Meta::CPAN

      case VL_BADENTRY:
          sprintf(buffer, "VLDB: bad incoming vldb entry\n");
          break;
      case VL_BADVOLIDBUMP:
          sprintf(buffer, "VLDB: illegal max volid increment\n");
          break;
      case VL_IDALREADYHASHED:
          sprintf(buffer, "VLDB: (RO/BACK) Id already hashed\n");
          break;
      case VL_ENTRYLOCKED:
          sprintf(buffer, "VLDB: vldb entry is already locked\n");
          break;
      case VL_BADVOLOPER:
          sprintf(buffer, "VLDB: bad volume operation code\n");
          break;
      case VL_BADRELLOCKTYPE:
          sprintf(buffer, "VLDB: bad release lock type\n");
          break;
      case VL_RERELEASE:
          sprintf(buffer, "VLDB: status report: last release was aborted\n");
          break;

src/AFS.xs  view on Meta::CPAN

        else {
            if (entry->serverFlags[i] & RO_DONTUSE)
                safe_hv_store(server, "release", 7, newSVpv("Not released", 12), 0);
        }
        av_push(av, newRV_inc((SV *) (server)));
    }
    safe_hv_store(stats, "server", 6, newRV_inc((SV *) (av)), 0);

    safe_hv_store(stats, "flags", 5, newSViv(entry->flags), 0);
    if (entry->flags & VLOP_ALLOPERS)
        safe_hv_store(stats, "locked", 6, newSViv(entry->flags & VLOP_ALLOPERS), 0);

    return;
}

static int VolumeInfoCmd(stats, name)
    HV *stats;
    char *name;
{
    struct nvldbentry entry;
    afs_int32 vcode;

src/AFS.xs  view on Meta::CPAN


            /* If the volume name is given, Use VolumeInfoCmd to look it up
             * and not ListAttributes.
             */
        if (name) {
          /* printf("DEBUG-2 \n"); */
            if (lock) {
                char buffer[256];
                /*     printf("DEBUG-3 \n"); */
                sprintf(buffer,
                        "AFS::VLDB: illegal use of '-locked' switch, need to specify server and/or partition\n");
                VSETCODE(-1, buffer);
                XSRETURN_UNDEF;
            }
            /* printf("DEBUG-4 \n"); */
            stats = (HV *) sv_2mortal((SV *) newHV());
            code = VolumeInfoCmd(stats, name);
            if (code) {
                char buffer[256];
                set_errbuff(buffer, code);
                VSETCODE(code, buffer);

src/AFS.xs  view on Meta::CPAN

            if (vcode) {
                char buffer[256];
                sprintf(buffer, "Could not unlock entry for volume %s\n", vllist->name);
                VSETCODE(vcode, buffer);
                totalE++;
            }

        }

        if (totalE)
            fprintf(STDOUT, "Could not unlock %u VLDB entries of %u locked entries\n", totalE,
                nentries);

        if (arrayEntries.nbulkentries_val)
            free(arrayEntries.nbulkentries_val);

        SETCODE(0);
        RETVAL = 1;

        done:
        ;



( run in 0.828 second using v1.01-cache-2.11-cpan-49f99fa48dc )