ScanBinderyObjectTrusteePaths

Returns the paths to which an object has trustee rights (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWScanObjectTrusteePaths )

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

Syntax

   #include <\nlm\nit\nwdir.h>  
    
   int ScanBinderyObjectTrusteePaths (  
      LONG   objectID,  
      BYTE   volumeNumber,  
      int    *sequenceNumber,  
      WORD   *trusteeAccessMask,  
      char   *trusteePathName); 
   

Parameters

objectID
(IN) Specifies a unique bindery object ID for which trustee information should be found.
volumeNumber
(IN) Specifies the volume number of the volume to be searched (0 to 31).
sequenceNumber
(IN) Contains the sequence number from the previous search (initial search requires a -1).
trusteeAccessMask
(OUT) Receives the object’s trustee rights to trusteePathName (the returned path).
trusteePathName
(OUT) Receives a string containing a path of which the object is a trustee. The path is in the form:
   volume:directory\...\directory | file  
   

The maximum is 319 characters (MAX_SERVER + MAX_VOLUME + MAX_PATH). If the buffer allocated to this parameter is smaller than 319 characters, the server can abend if the buffer is overwritten.

Return Values

0

(0x00)

ESUCCESS

137

(0x89)

ERR_NO_SEARCH_PRIVILEGE

150

(0x96)

ERR_SERVER_OUT_OF_MEMORY

156

(0x9C)

ERR_NO_MORE_TRUSTEES

240

(0xF0)

ERR_WILDCARD_NOT_ALLOWED

241

(0xF1)

ERR_INVALID_BINDERY_SECURITY

252

(0xFC)

ERR_NO_SUCH_OBJECT

254

(0xFE)

ERR_SERVER_BINDERY_LOCKED

255

(0xFF)

ERR_BINDERY_FAILURE

Remarks

This function is used iteratively to scan and return all of the paths (directories and files) and the corresponding access masks for which the specified object is a trustee.

The sequenceNumber parameter should initially be set to -1 to get the first trustee path. Upon return, the sequence number is set to the value needed for the next call. Do not modify this value as this function is iteratively called to obtain all of the trustee’s paths.

When all valid trustee paths have been returned, ERR_NO_MORE_TRUSTEES is returned and trusteePathName is set to "\0."

Only the supervisor, the object, or a bindery object that is security equivalent to the supervisor or object, can scan an object’s trustee paths.

The trusteeAccessMask gives the trustee specific rights within the directory or the file, and if it is a directory, in all that directory’s subdirectories, unless the trustee’s rights are explicitly disallowed (using the Inherited Rights Mask) in those directories.

Figure 6-2 The trusteeAccessMask for NetWare 3.0 and above

For versions of NetWare previous to 3.0, the trustee rights appear in a 1-byte format as follows:

Figure 6-3 The 1-byte trustee rights mask for NetWare 2.x

See Also

GetVolumeNumber (NetWare SDK)

ScanBinderyObjectTrusteePaths Example

   #include <stdlib.h>  
   #include <stddef.h>  
   #include <stdio.h>  
   #include <nwconio.h>  
   #include <nwtypes.h>  
   #include <nwdir.h>  
    
   main()  
   {  
      int rc,i;  
      long oid;  
      int sn;  
      WORD tam;  
      char path[1000];  
    
      printf("object id to scan (hex): ");  
      scanf("%x",&oid);  
      i = 0;  
      sn = 0;  
      while(!(rc = ScanBinderyObjectTrusteePaths  
           (oid,0,&sn,&tam,path)))  
      {  
         i++;  
         printf("sequence number = %d\n",sn);  
         printf("access mask = %#X\n",tam);  
         printf("path name is\n%s\n\n",path);  
      }  
      printf("number of paths = %d\n",i);  
      printf("rc = %x\n",rc);  
   }