ChangePropertySecurity

Changes the security of a bindery object’s property (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWChangePropertySecurity )

Local Servers:blocking
Remote Servers:blocking
Classification:3.x, 4.x, 5.x, 6.x
Service:Server-Based Bindery

Syntax

   #include <\nlm\nit\nwbindry.h>  
    
   int ChangePropertySecurity (  
      char   *objectName,  
      WORD   objectType,  
      char   *propertyName,  
      BYTE   newPropertySecurity); 
   

Parameters

objectName
(IN) Specifies the string containing the name of the bindery object (maximum 48 characters, including the NULL terminator).
objectType
(IN) Specifies the type of the bindery object (OT_USER, OT_GROUP, OT_PRINT_SERVER, and so on).
propertyName
(IN) Specifies the string containing the name of the property whose security is to be changed (maximum16 characters, including the NULL terminator).
newPropertySecurity
(IN) Indicates the read/write access of others to the property.

Return Values

0

(0x00)

ESUCCESS

150

(0x96)

ERR_SERVER_OUT_OF_MEMORY

240

(0xF0)

ERR_WILDCARD_NOT_ALLOWED

241

(0xF1)

ERR_INVALID_BINDERY_SECURITY

251

(0xFB)

ERR_NO_SUCH_PROPERTY

252

(0xFC)

ERR_NO_SUCH_OBJECT

254

(0xFE)

ERR_SERVER_BINDERY_LOCKED

255

(0xFF)

ERR_BINDERY_FAILURE

Remarks

The objectName, objectType, and propertyName parameters must uniquely identify the property and must not contain wildcard characters. The objectName can be from 1 to 48 characters long, including the NULL terminator. The propertyName can be from 1 to 15 characters long. Only printable characters can be used. Slashes, backslashes, colons, semicolons, commas, asterisks, and question marks are prohibited.

The newPropertySecurity parameter is actually two nibbles. The low-order nibble determines who can scan for and find the object. The high-order nibble determines who can add properties to the object. The following values are defined for each nibble:

0

0 0 0 0

Anyone

1

0 0 0 1

Logged

2

0 0 1 0

Object

3

0 0 1 1

Supervisor

4

0 1 0 0

NetWare Operating System

For example, 0x31 indicates that any user logged in to the server can find the object, but only the supervisor can add a property to the object.

See Also

ChangeBinderyObjectSecurity

ChangePropertySecurity Example

   #include <stdio.h>  
   #include <\nlm\nit\nwbindry.h>  
    
   main()  
   {  
      int   completionCode;  
      char  objectName[48];  
      int   objectType;  
      char  propertyName[16];  
      BYTE  newAccessFlags;  
      strcpy (objectName, "JDOE");  
      objectType = OT_USER;  
      strcpy (propertyName, "GROUP_MEMBERS");  
      newAccessFlags = 0x31;  
      completionCode =ChangePropertySecurity (objectName, objectType,
         propertyName, newAccessFlags);  
      if (completionCode)  
         switch (completionCode)  
         {  
            case 150:  
            printf ("SERVER OUT OF MEMORY\n\n");  
            break; 
     
            case 240:  
            printf ("WILDCARD NOT ALLOWED\n\n");  
            break;  
    
            case 241:  
            printf ("INVALID BINDERY SECURITY\n\n");  
            break;  
    
            case 251:  
            printf ("NO SUCH PROPERTY\n\n");  
            break;  
    
            case 252:  
            printf ("NO SUCH OBJECT\n\n");  
            break;  
    
            case 254:  
            printf ("SERVER BINDERY LOCKED\n\n");  
            break;  
    
            case 255:  
            printf ("BINDERY FAILURE\n\n");  
            break;  
    
            case default:  
            printf ("completionCode=%d\n", completionCode);  
            break;  
         }  
      else  
         printf ("Access flags for %s is %2X\n",  
         propertyName,  
         newAccessFlags);  
   }