Objects in an NIS+ namespace can be identified with two types of names: partially qualified and fully qualified. A partially qualified name, also called a simple name, is simply the name of the object or any portion of the fully qualified name. If during any administration operation, you type the partially qualified name of an object or principal, NIS+ attempts to expand the name into its fully qualified version.
A fully qualified name is the complete name of the object, including all the information necessary to locate it in the namespace, such as its parent directory, if it has one, and its complete domain name, including a trailing dot.
This varies among different types of objects, so the conventions for each type, as well as for NIS+ principals, are described separately. The following namespace is an example.
Figure 4-6. Named Objects in Example NIS+ Namespace. This illustration shows a domain (wiz.com.), a subdomain (sales.wiz.com.), and subdirectories (groups_dir and org_dir). Within org_dir, the hosts and cred tables are labeled as Principals.
The fully qualified names for all the objects in this namespace, including NIS+ principals, are summarized in the following figure.
Figure 4-7. Fully Qualified Names of Namespace Components. This illustration shows fully qualified name examples: In the sales.wiz.com. domain, sales is the local domain and wiz.com. is the root domain. In the groups_dir.sales.wiz.com. directory object, groups_dir is the directory and sales.wiz.com. is the domain. In the hosts.org_dir.sales.wiz.com. table object, hosts is the table, org_dir is the directory, and sales.wiz.com. is the domain. In the admin.groups_dir.sales.wiz.com. group object, admin is the group, groups_dir is the directory, and sales.wiz.com. is the domain. For the principal_name.sales.wiz.com. NIS+ principal, principal_name is the variable for the actual principal name and sales.wiz.com. is the domain.
A fully qualified NIS+ domain name is formed from left to right, starting with the local domain and ending with the root domain, as shown in the following example:
wiz.com. sales.wiz.com. intl.sales.wiz.com.
The first line shows the name of the root domain. The root domain must always have at least two labels and must end in a dot. The second label can be an Internet domain name, such as com. The second and third lines show the names of lower-level domains.
A directory's simple name is simply the name of the directory object. Its fully qualified name consists of its simple name plus the fully qualified name of its domain (which always includes a trailing dot). For example:
groups_dir (simple name)
groups_dir.manf.wiz.com. (fully qualified name)
If you set up an unusual hierarchy in which several layers of directories do not form a domain, be sure to include the names of the intermediate directories. For example:
lowest_dir.lower_dir.low_dir.mydomain.com.
The simple name is normally used from within the same domain, and the fully qualified name is normally used from a remote domain. However, by specifying search paths in a domain's NIS_PATH environment variable, you can use the simple name from remote domains (see NIS+ Name Expansion).
Fully qualified table and group names are formed by starting with the object name and appending the directory name, followed by the fully qualified domain name. All system table objects are stored in an org_dir directory, and all group objects are stored in a groups_dir directory. (If you create your own NIS+ tables, you can store them in any directory.) The following are examples of group and table names:
admin.groups_dir.wiz.Inc. admin.groups_dir.wiz.com. admin.groups_dir.sales.wiz.Inc. admin.groups_dir.sales.wiz.com. hosts.org_dir.wiz.Inc. hosts.org_dir.wiz.com. hosts.org_dir.sales.wiz.Inc. hosts.org_dir.sales.wiz.com.
To identify an entry in an NIS+ table, you need to identify the table object and the entry within it. This type of name is called an indexed name. It has the following syntax:
[column=value,column=value,...],table-name
Column is the name of the table column. Value is the actual value of that column. Table-name is the fully qualified name of the table object. Here are a few examples of entries in the hosts table:
[addr=129.44.2.1,name=pine],hosts.org_dir.sales.wiz.com. [addr=129.44.2.2,name=elm],hosts.org_dir.sales.wiz.com. [addr=129.44.2.3,name=oak],hosts.org_dir.sales.wiz.com.
You can use as few column-value pairs inside the brackets as required to uniquely identify the table entry.
Some NIS+ administrative commands accept variations on this syntax. For details, see the nistbladm, nismatch, and nisgrep commands.
Host names may contain up to 24 characters. Letters, numbers, the dash (-) and underscore (_) characters are allowed in host names. Host names are not case sensitive. The first character of a host name must be a letter of the alphabet. Blank spaces are not permitted in host names.
Note: Dots (.) are not permitted in host names, even if they are enclosed in quotation marks. For example, a host names such as myco.2 or 'myco.2' are not permitted. Dots are only used as part of a fully qualified host name to identify the domain components. For example, myco-2.sales.wiz.com is a correct fully qualified host name.
Domains and hosts should not have the same name. For example, if you have a sales domain you should not have a machine named sales. Similarly, if you have a machine named home, you do not want to create a domain named home. This caution also applies to subdomains. For example, if you have a machine named west you do not want to create a sales.west.myco.com subdomain.
NIS+ principal names are sometimes confused with Secure RPC netnames. Both types of names are described in Chapter 7, Security. However, one difference is worth noting now because it can cause confusion: NIS+ principal names always end in a dot and Secure RPC netnames never do. For example:
olivia.sales.wiz.com. (NIS+ principal name)
unix.olivia@sales.wiz.com (Secure RPC netname)
Even though credentials for principals are stored in a cred table, neither the name of the cred table nor the name of the org_dir directory is included in the principal name.
You can form namespace names from any printable character in the ISO Latin 1 set. However, the names cannot start with any of the following characters:
@ < > + [ ] - / = . , : ;
To use a string, enclose it in double quotes. To use a quote sign in the name, quote the sign too (for example, to use o'henry, type o"'"henry). To include white space (as in John Smith), use double quotes within single quotes, like this:
`"John Smith"`
See Host Names for restrictions that apply to host names.
NIS+ provides a name-expansion facility to ease the task of entering fully qualified names with NIS+ commands. When you enter a partially qualified name, NIS+ attempts to find the object by looking for it under different directories. It starts by looking in the default domain. This is the home domain of the client from which you type the command. If it does not find the object in the default domain, NIS+ searches through each of the default domain's parent directories in ascending order until it finds the object. It stops after reaching a name with only two labels. Examples shown in the following figure (assume you are logged onto a client that belongs to the software.big.sales.wiz.com. domain).
Figure 4-8. Partly Qualified Name Expanding to Fully Qualified Name. This illustration shows partly qualified names expanding to fully qualified names. hosts.org_dir, for example, expands to hosts.org_dir.software.big.sales.wiz.com., hosts.org_dir.sales.wiz.com., hosts.org_dir.sales.wiz.com., and hosts.org_dir.wiz.com.