OSF DCE Administration Guide--Core Components

Writing Scripts and dcecp Objects
{create command function_call _dcp_create_user
"Create a DCE user" }
{delete command function_call _dcp_delete_user
"Delete a DCE user"}
{show command function_call _dcp_show_user
"Show the attributes of a DCE user"}
{help help help_list
"Print summary of command-line options and abort"}
{operations operations operation_list
"Return valid operations for command."}}
set verbose_prose
"This object allows the manipulation of a DCE user. A user is
represented as a principal and account with membership in a group and
organization as well as having a directory in the CDS namespace. A user
may be created, deleted or have attribute information returned. The
argument is a list of either relative or fully qualified principal names.
All fixed attributes of the principal and account object may be specified
when creating a user. The -force option to the create verb allows the
group or organization for that user to be created if necessary. The user
is provided a directory in the CDS namespace, with the appropriate ACLs.
Access to create a user requires the correct ACLs on principal, group and
organization directories within the registry and the clearinghouse and
users directory in the CDS namespace."
set local_args $args
parseargs $arg_table local_args -found_one
if { [info local help_pros e]>0}{return $help_prose }
if { [info local function_call]>0}{
return [$function_call local_args]
} else {
error "\"user\" object requires a verb to form a command."
}
}
The next part of the script examines a procedure that takes many options or attributes as
input: the _dcp_create_user procedure. While this procedure relies on numerous lower-
level procedures to do the actual work of creating a user, the example begins by showing
just one of the lower-level procedures, _dcp_create_principal_entry.
Then the script continues with the _dcp_create_user procedure. Notice that the name of
this procedure (and all lower-level procedures) begins with an underscore. That’s
because the Tcl info command is frequently used to return the names of all procedures.
This convention distinguishes these internal procedure names from procedures like user,
which are documented procedures. Furthermore, the _dcp part of the name distinguishes
dcecp procedures from other Tcl procedures on a host.
The _dcp_create_user procedure has an argument table defining its available options.
This argument table differs from the script’s initial argument table in that it lacks the
command keyword and the function_call variable that define separate procedures in the
124243 Tandem Computers Incorporated 35