Destroying Contexts
The fndestroy command is used to destroy empty contexts.
For example, to destroy the service context of the user patel:
# fndestroy user/patel/service |
Working With Attributes
The fnattr command can be used to add, delete or modify attributes associated with a name. You can make modifications one at a time, or batch several within the same command.
fnattr [-l] name to list attributes for name.
fnattr name -a-s -U -O attrib values to add an attribute
fnattr name -m -O -U attrib oldvalue newvalue to modify an attribute
fnattr name -d -O | -U [values attrib] to destroy an attribute
Table 25-8 fnattr Command Options
Option | Description |
---|---|
name | The composite name. |
attrib | The identifier of an attribute. |
values | One or more attribute values. |
oldvalue | An attribute value to be replaced by a new value. |
newvalue | The attribute value that replaces an old value. |
-a | Add an attribute. |
-d | Destroy an attribute. |
-l | List attributes. |
-m | Modify an attribute. |
-s | Replace all old attribute values with the new values for the attribute specified. |
-O | The identifier format is FN_ID_ISO_OID_STRING, an ASN.1 dot-separated integer list string. |
-U | The identifier format is FN_ID_DCE_UUID, a DCE UUID in string form. |
For example:
To show all of the attributes associated with the user name rosa:
# fnattr user/rosa |
To display the size attribute associated with the user uri:
# fnattr user/uri/ size |
For a user named devlin, to add an attribute named shoesize with a value of small, delete the hatsize attribute, and change the dresssize attribute value from 12 to 8:
# fnattr user/devlin -a shoesize small -d hatsize -m dresssize 12 8 |
Federating a Global Namespace
You can federate NIS+ or NIS to a global naming service like DNS and X.500.
To federate an NIS+ or NIS namespace under DNS or X.500, you first need to obtain the root reference for the NIS+ hierarchy or NIS domain.
From the point of view of the global name service, the root reference is known as the next naming system reference because it refers to the next naming system beneath the DNS domain or X.500 entry. To federate NIS+ or NIS with a global name service, you add the root reference information to that global service.
Once you have added the root reference information to the global service, clients outside of your NIS+ hierarchy or NIS domain can access and perform operations on the contexts in the NIS+ hierarchy or NIS domain. Foreign NIS+ clients access the hierarchy as unauthenticated NIS+ clients.
For example:
If NIS+ is federated underneath the DNS domain doc.com., you can now list the root of the NIS+ enterprise using the command
# fnlist .../doc.com/ |
If NIS+ is federated underneath the X.500 entry /c=us/o=doc, you can list the root of the NIS+ enterprise using the command:
# fnlist .../c=us/o=doc/ |
Note the mandatory trailing slash in both examples.
Copying and Converting FNS Contexts
The fncopy command can be used to copy or convert an FNS context and attributes to a new FNS context.
By using the -i and -o options, you can copy FNS contexts based on one underlying enterprise-level name service to a context based on a different underlying name service. For example, if you have an FNS installation running on top of NIS, and you upgrade your NIS service to NIS+, you can use fncopy to create a new context using NIS+.
Note that:
If the new FNS context that you are copying an old context to already exists for the target name service, only new contexts and bindings are copied. The contexts are not over-written or changed.
fncopy does not follow links, but copies the FNS link bound to a name to the new context namespace.
Table 25-9 fncopy Command Options
Option | Description |
---|---|
-i oldservice | The old (input) underlying enterprise-level name service. For example, -i nis specifies that the old service is NIS. Allowed values are files, nis, nisplus. |
-o newservice | The new (output) underlying enterprise-level name. For example, o nisplus specifies that the new service is NIS+. Allowed values are files, nis, nisplus. |
-f filename | A text file listing FNS contexts to be copied. In the absence of the -i and -o options, contexts must be identifies using global names. |
oldcontext | The name of the context being copied. |
newcontext | The name of the context being created or copied to. |
For example, to copy the doc.com printer contexts (and sub-contexts) and bindings to orgunit/east/doc.com:
# fncopy .../doc.com/service/printer .../doc.com/orgunit/east/service/printer |
To copy the NIS FNS users' contexts specified in the file user_list to an NIS+ FNS users' context of the orgunit west/doc.com:
# fncopy -i nis -o nisplus -f /etc/user_list thisorgunit/user org/doc.com/user |
Namespace Browser Programming Examples
The programming examples in this section shows the usage of XFN APIs to perform the following operations: