Is there any way to rename a NIS+ table? I cannot find any program
that allows this to be done, but the man page for nis_modify()
states:
The function nis_modify() will modify the object named by
name to the field values in the object pointed to by obj.
This object should contain a copy of the object from the
name space that is being modified. This operation will fail
with the error NIS_NOTSAMEOBJ if the object identifier of
the passed object does not match that of the object being
modified in the namespace.
Note: Normally the contents of the member zo_name in the
nis_object structure would be constructed from the name
passed in the name parameter. However, if it is non-NULL the
client library will use the name in the zo_name member to
perform a rename operation on the object. This name must not
contain any unquoted `.'(dot) characters. If these condi-
tions are not met the operation will fail and return the
NIS_BADNAME error code.
This lead me to believe that I could write my own rename utility.
However, I read the table object in, change the zo_name field to
point to the string containing the new name (and a nis_print_object()
on that object shows the new name), and call nis_modify().
It returns a NIS_SUCCESS result code, but when I look at the
namespace, the table has not been renamed, and when I look at the
log using nislog, it shows that the object has been modified, but
that it still has its old name.
Is this possible, or are the man pages misleading? Thanks!
Brad Debroni
BC Systems Corporation