NWDSModifyObject(3nw)


NWDSModifyObject -- modifies an object or its alias

Synopsis

   #include <nwnet.h> 
   or 
   #include <nwdsdsa.h> 
   

NWDSCCODE N_API NWDSModifyObject (NWDSContextHandle context, pnstr8 objectName, pnint32 iterationHandle, nbool8 more, pBuf_T changes);

Description

The parameters are as follows:

context
(IN) Specifies the Directory context for the request.

objectName
(IN) Points to the object name to be modified.

iterationHandle
(IN/OUT) Reserved; pass in NULL.

more
(IN) Reserved; pass in 0.

changes
(IN) Points to the set of changes to be applied to the object.

Return values

0x0000
SUCCESSFUL

Negative Value
Negative values indicate errors. For errors returned by Directory Services, see ``Directory Services OS Errors'' (-001 to -255), ``Directory Services Client Library Errors'' (-301 to -399), or ``Directory Services Agent in the Server Errors'' (-601 to -699).

0x8996
SERVER_OUT_OF_MEMORY

0x89E2
TOO_FEW_FRAGMENTS

0x89E3
TOO_MANY_FRAGMENTS

0x89E4
PROTOCOL_VIOLATION

0x89E5
SIZE_LIMIT_EXCEEDED

0x89FD
UNKNOWN_REQUEST

0x89FD
INVALID_PACKET_LENGTH

0x89FE
BAD_PACKET

0x89FF
Failure not related to Directory Services

Notices

NWDSModifyObject cannot modify an object's RDN. It can perform only the following:

objectName identifies the object to be modified. The object can be an alias. Any aliases in the name are not dereferenced.

changes defines a sequence of modifications, which are applied in the order specified. The buffer is allocated by calling NWDSAllocBuf and initialized for DSV_MODIFY_ENTRY by calling NWDSInitBuf. The specified changes are inserted into the buffer by calling NWDSPutChange and NWDSPutAttrVal.

If any of the individual modifications fail, an error is generated and the object is left in the state it was prior to the operation. Furthermore, the end result of the sequence of modifications may not violate the Directory schema. (However, it is possible, and sometimes necessary, for the individual object modification changes to appear to do so.) If an attempt is made to modify the object class attribute, an error is returned.

Change records are inserted into the buffer by calling NWDSPutChange. Each type of change modification is explained below:

C Value Value Name Value Description
0 DS_ADD_ATTRIBUTE Specifies a new attribute to be added to the object. An attempt to add an already-existing attribute results in an error.
1 DS_REMOVE_ATTRIBUTE Specifies an attribute to be removed from the object. An attempt to remove a non-existing attribute results in an error. This operation is not allowed if the attribute is present in the RDN.
2 DS_ADD_VALUE Specifies the values to be added to an attribute. An attempt to add an already-existing value results in an error. An attempt to add a value to a nonexistent attribute results in an error.
3 DS_REMOVE_VALUE Specifies the values to be removed from an attribute. If the values are not present in the attribute, an error results. This operation is not allowed if any of the values is present in the RDN.

 
 ------------------------------------------------------ 
| C Value|  Value Name         |  Value Description   | 
|--------|---------------------|----------------------| 
| 0      |  DS_ADD_ATTRIBUTE   |  Specifies a new     | 
|        |                     |  attribute to be     | 
|        |                     |  added to the object.| 
|        |                     |  An attempt to add an| 
|        |                     |  already-existing    | 
|        |                     |  attribute results in| 
|        |                     |  an error.           | 
|--------|---------------------|----------------------| 
| 1      |  DS_REMOVE_ATTRIBUTE|  Specifies an        | 
|        |                     |  attribute to be     | 
|        |                     |  removed from the    | 
|        |                     |  object. An attempt  | 
|        |                     |  to remove a non-    | 
|        |                     |  existing attribute  | 
|        |                     |  results in an error.| 
|        |                     |  This operation is   | 
|        |                     |  not allowed if the  | 
|        |                     |  attribute is present| 
|        |                     |  in the RDN.         | 
|--------|---------------------|----------------------| 
| 2      |  DS_ADD_VALUE       |  Specifies the values| 
|        |                     |  to be added to an   | 
|        |                     |  attribute. An       | 
|        |                     |  attempt to add an   | 
|        |                     |  already-existing    | 
|        |                     |  value results in an | 
|        |                     |  error. An attempt to| 
|        |                     |  add a value to a    | 
|        |                     |  nonexistent         | 
|        |                     |  attribute results in| 
|        |                     |  an error.           | 
|--------|---------------------|----------------------| 
| 3      |  DS_REMOVE_VALUE    |  Specifies the values| 
|        |                     |  to be removed from  | 
|        |                     |  an attribute. If the| 
|        |                     |  values are not      | 
|        |                     |  present in the      | 
|        |                     |  attribute, an error | 
|        |                     |  results. This       | 
|        |                     |  operation is not    | 
|        |                     |  allowed if any of   | 
|        |                     |  the values is       | 
|        |                     |  present in the RDN. | 
|--------|---------------------|----------------------| 

Values may be replaced by a combination of Remove Values and Add Values operations in a single call to NWDSModifyObject. Aliases are never dereferenced by NWDSModifyObject. The setting of the context flag associated with DCV_DEREF_ALIASES is not relevant to NWDSModifyObject and is ignored.

Services

Directory

NCP calls

0x2222 23 17
Get File Server Information

0x2222 23 22
Get Station's Logged Info (old)

0x2222 23 28
Get Station's Logged Info

0x2222 104 01
Ping for NDS NCP

0x2222 104 02
Send NDS Fragmented Request/Reply

References

NWDSModifyDN(3nw), NWDSRemoveObject(3nw), NWDSModifyRDN(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.