System Administration Guide: Naming and Directory Services (FNS and NIS+)

Administering Enterprise Level Contexts

A number of tools are provided for examining and managing FNS contexts. The commands and their syntax are shown in the sections that follow.

Displaying the Binding

fnlookup displays the binding of the given composite name.


fnlookup [-v][-L] composite_name
Table 25–14 fnlookup Command Options

Option 

Description 

-v

Displays the binding in more detail 

-L

Displays the reference to which the XFN link is bound 

For example, to show the binding for the user darwin in detail, you would enter:


# fnlookup -v user/darwin/
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 length: 52
 context type: user
 representation: normal
 version: 0
 internal name: fns_user_darwin.ctx_dir.sales.doc.com.

Suppose user/Charles.Darwin is linked to user/darwin. The first command in the following example shows what user/Charles.Darwin is bound to (an XFN link). The second command follows the XFN link, user/darwin, and shows what user/darwin is bound to (the user context).


# fnlookup user/Charles.Darwin
Reference type: fn_link_ref
Address type: fn_link_addr
 Link name: user/darwin
# fnlookup -L user/Charles.Darwin
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 context type: user

Listing the Context

fnlist lists the contents of the context identified by the given name.


fnlist [-lv] [name]
Table 25–15 fnlist Command Options

Option 

Description 

-v

Displays the binding in more detail 

-l

Displays the bindings of the names bound in the named context 

For example, to display the bindings under the user context:


# fnlist user/
Listing 'user/':
jjones
julio
chaim
James.Jones

If no name is given, the command lists the contents of the initial context.


# fnlist
Listing '':
_myorgunit
...
_myself
thishost
myself
_orgunit
_x500
_host
_thisens
myens
thisens
org
orgunit
_dns
thisuser
_thishost
myorgunit
_user
thisorgunit
host
_thisorgunit
_myens
user

When the -l option is given, the bindings of the names bound in the named context are displayed.


# fnlist -l user/
Listing bindings 'user/':
name: julio
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 context type: user
name: chaim
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 context type: user
name: James.Jones
Reference type: fn_link_ref
Address type: fn_link_addr
 Link name: user/jjones
name: jjones
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 context type: user

When the -v option is given in conjunction with the -l option, the bindings are displayed in detail.


# fnlist -lv user/
Listing bindings 'user/':
name: julio
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 length: 52
 context type: user
 representation: normal
 version: 0
 internal name: fns_user_julio.ctx_dir.sales.doc.com.
name: chaim
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 length: 52
 context type: user
 representation: normal
 version: 0
 internal name: fns_user_chaim.ctx_dir.sales.doc.com.
name: James.Jones
Reference type: fn_link_ref
Address type: fn_link_addr
 length: 11
 data: 0x75 0x73 0x65 0x72 0x2f 0x6a 0x6a 0x6f 0x6e 0x65
user/jjones
name: jjones
Reference type: onc_fn_user
Address type: onc_fn_nisplus
 length: 52
 context type: user
 representation: normal
 version: 0
 internal name: fns_user_jjones.ctx_dir.sales.doc.com.

Binding a Composite Name to a Reference

fnbind allows you to bind a composite name to a reference.

There are two uses of this command.

Binding an Existing Name to a New Name

The syntax of fnbind for binding existing names to new names is:


fnbind [-s][-v][-L] oldname newname
Table 25–16 fnbind Command Options (Binding Names)

Option 

Description 

oldname

The existing composite name. 

newname

The new name to which you are binding the old name. 

-s

Supersedes any existing binding of the original composite name. 

-v

Prints out the reference used for the binding. 

-L

Creates an XFN link using name and binding it to new_name.

For example, to bind the name user/julio/service/printer to the reference of myorgunit/service/printer you would enter:


# fnbind myorgunit/service/printer user/julio/service/printer

If the given newname is already bound, fnbind -s must be used or the operation will fail. In the above example, if user/julio/service/printer is already bound, the -s option must be used to overwrite the existing binding with that of myorgunit/service/printer as shown below:


# fnbind -s myorgunit/service/printer user/julio/service/printer

The -v option prints out the reference used for the binding.


# fnbind -v myorgunit/service/printer user/julio/service/printer
Reference type: onc_printers
Address type: onc_fn_printer_nisplus

The following command constructs an XFN link out of user/jjones and binds it to the name user/James.Jones:


# fnbind -L user/jjones user/James.Jones

Similarly, to create a link from user/julio/service/printer to myorgunit/service/printer you would enter:


# fnbind -sL myorgunit/service/printer user/julio/service/printer

Constructing a Reference on the Command Line

The syntax of fnbind for building a reference on the command line is:


fnbind -r [-s] [-v] newname [-O | -U] reftype {[-O | -U] | addresstype 
[-c|-x] addresscontents}+
Table 25–17 fnbind Command Options (Reference Construction)

Option 

Description 

newname

The new name for which you are constructing a reference. 

reftype

The type of reference you are creating. Unless the -O or -U options are used, FN_ID_STRING is used as the indentifier for reftype.

addresstype

The type of address you are creating. Unless the -O or -U options are used, FN_ID_STRING is used as the indentifier for addresstype.

addresscontents

The address of the reference you are creating. Unless the -c or -x options are used, the address is stored as an XDR-encoded string.

-s

Supersedes any existing binding of the original composite name. 

-v

Prints out the reference used for the binding. 

-c

Stores address contents without XDR encoding. 

-x

Interprets address contents as a hexadecimal input string and store it as is. 

-r

Creates a reference with a specified type and binds the reference to a name specified on the command line. 

-O

Interprets and stores type string as ASN.1 dot-separated integer list. 

-U

Interprets and stores type string as a DCE UUID. 

For example, to bind the name thisorgunit/service/calendar to the address contents of staff@cygnus with a reference type of onc_calendar and and an address type onc_cal_str you would enter:


# fnbind -r thisorgunit/service/calendar onc_calendar 
onc_cal_str staff@cygnus

By default, the address contents supplied in the command line is XDR-encoded before being stored in the reference. If the -c option is given, the address contents are stored in normal, readable characters, not as an XDR-encoded string. If the -x option is given, the address contents supplied in the command line are interpreted as a hexadecimal string and stored (and not XDR-encoded).

By default, the reference and address types of the reference to be constructed uses the FN_ID_STRING identifier format. If the -O option is given, the identifier format is FN_ID_ISO_OID_STRING, an ASN.1 dot-separated integer list string. If the -U option is given, the identifier format is FN_ID_DCE_UUID, a DCE UUID in string form.


Note –

For more information on ASN.1, see ISO 8824: 1990, Information Technology — Open Systems Interconnection — Specification of Abstract Syntax Notation One (ASN.1). For more information on DCE UUID see X/Open Preliminary Specification, October 1993, X/Open DCE: Remote Procedure Call (ISBN: 1-872630-95-2).


For example, to bind to the name thisorgunit/service/nx a reference with a hexadecimal string as the address contents and OIDs as reference and address types, you would enter:


# fnbind -r thisorgunit/service/nx -O 1.2.99.6.2.1 
-O 1.2.99.6.2.3 -x ef12eab67290

Removing a Composite Name

fnunbind removes the given composite name from the namespace. Note that this does not remove the object associated with the name; it only unbinds the name from the object.

For example, to remove the binding associated with the name user/jjones/service/printer/color, you would enter:


# fnunbind user/jjones/service/printer/color

Renaming an Existing Binding

The fnrename command renames an existing binding.

For example, to rename the binding of clndr to calendar, in the context named by user/jjones/service/ you would enter:


# fnunbind user/jjones/service/printer/color

Destroying a Context

fndestroy removes the given composite name from the namespace and destroys the context named by the composite name.

For example, to unbind the name user/jones/ from the namespace and destroys the context named by user/jjones/ you would enter:


# fndestroy user/jjones/

If the composite name identifies a context to be removed, the command fails if the context contains subcontexts.