AFS

 view release on metacpan or  search on metacpan

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

names or groups the high-level methods accept either numeric IDs or
names.

=head1 COMPATIBILITY

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

=head1 METHODS

=over 4

=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>

=item S< >

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

Destroys the ubik connection to the Protection Server and frees the ubik
connection structure.

=item B<CLASS METHODS>

=item S< >

=item B<$bits = AFS::PTS-E<gt>ascii2ptsaccess(FLAGS);>

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

=item B<$flags = AFS::PTS-E<gt>ptsaccess2ascii(BITS);>

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

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

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

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

=item S< >

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

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

=item S< >

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

Adds the given user NAME to the specified GROUP.  It calls the AFS
system library function 'PR_AddToGroup'.

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

Changes the id for the given entry NAME to NEWID.  It calls the AFS
system library function 'PR_ChangeEntry'.

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

Changes the owner of the given entry NAME to OWNER.  It calls the AFS
system library function 'PR_ChangeEntry'.

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

Creates the new group NAME. You can optionally specify the OWNER and
the id GID of the new group.  If successful, the group ID allocated
for this new entry is returned. It calls the AFS system library
function 'PR_INewEntry' or 'PR_NewEntry'.

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

Creates the new user NAME. You can optionally specify the id UID of
the new user.  If successful, the user ID allocated for this new entry
is returned. It calls the AFS system library function 'PR_INewEntry'
or 'PR_NewEntry'.

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

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

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

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

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

Returns the I<Current Protection Subdomain> (CPS) for the given PTS

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Removes the user NAME from GROUP.  It calls the AFS system library
function 'PR_RemoveFromGroup'.

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

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

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

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

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

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

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

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

=item S< >

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

The following low-level methods deal only with numeric AFS ids.

=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



( run in 2.192 seconds using v1.01-cache-2.11-cpan-0bb4e1dffa6 )