The fnattr command lets you update and examine attributes associated with FNS named objects. You can perform four attribute operations with the fnattr command:
fnattr -a [-s] name [-O|-U] identifier values |
fnattr -d name [[-O|-U] identifier [values]] |
fnattr -m name [-O|-U identifier oldvalue newvalue |
fnattr -l name [[-O|-U] identifier |
Option |
Description |
---|---|
name |
Composite name. |
identifier |
Attribute name. |
values |
One or more attributes values. |
oldvalue |
The attribute value that you want to change. |
newvalue |
The new attribute value. |
-aa |
Add (create) a new attribute. |
-d |
Delete an attribute. |
-m |
Change (modify) an attribute. |
-l |
List attribute values. |
-s |
Add in “supersede” mode. Removes any existing values for the identifier attribute and creates new attribute values. |
-l |
List attributes and values. |
-O |
Use an OSI OID as the identifier. |
-U |
Use a DCE UUID as the identifier. |
In each of these cases, the identifier format is FN_ID_STRING, unless the option -O or -U is used.
The -a option is for adding an attribute or adding a value to an attribute. Specify the composite name the attribute is associated with, the attribute identifier, and the values to add.
fnattr -a [-s] name [-O | -U] identifier value1 [value2+] |
The following example adds the attribute identifier model and the value hplaser to thisorgunit/service/printer.
# fnattr -a thisorgunit/service/printer model hplaser |
The -s option means “add in supersede” mode. If an attribute with the specified identifier already exists, -s removes all of its values and replaces them with the values added. If this option is omitted, the resulting values for the specified attribute includes the existing values and the new values added.
# fnattr -as thisorgunit/service/printer model hplaser |
The example above will first remove any existing values associated with model and add hplaser as the value.
To delete an attribute associated with an FNS named object, use the -d option.
fnattr -d name [[-O | -U] identifier value1 [value2+]]] |
You can control what to delete:
Name only. If only the composite name is specified and no attribute identifier is specified, all the attributes associated with the named object are removed.
Name and identifier only. If only the composite name and an attribute identifier is specified, but no attribute values are specified, the entire attribute identified by identifier is removed.
Name, identifier, and values. If the composite name, an attribute identifier, and one or more attribute values are specified, then only those values are removed from the attribute. (Removal of the last remaining value of an attribute is the same as removing the attribute itself.)
For example, to delete all the attributes associated with thisorgunit/service/printer.
# fnattr -d thisorgunit/service/printer |
The -l option is for listing attributes and their values.
fnattr -l name [[-O | -U] identifier] |
For example to list the values of the model attribute of thisorgunit/service/printer.
# fnattr -l thisorgunit/service/printer model laser postscript |
If an identifier is not specified, all the attributes associated with the named object are displayed.
The -m option lets you modify an attribute value.
fnattr -m name [-O | -U] identifier old_value new_value |
For example, to replace the value postscript with laser you would enter:
# fnattr -m thisorgunit/service/printer model postscript laser |
Only the specified values are affected. Other attributes and values associated with the name are not affected.
The -O option assumes the format of the attribute identifier is an ASN.1 dot-separated integer string list (FN_ID_ISO_OID_STRING).
The -U option assumes the format of the attribute identifier is a DCE UUID string form (FN_ID_DCE_UUID).