Modulize Group mapping

Stefan (metze) Metzmacher metze at metzemix.de
Wed Jun 12 02:31:01 GMT 2002


Hi,

Here is my 3. version of the module API.

Sorry,
forgot to remove,
get_group_from_gid
get_uid_list_of_group

they're high level fucntions too..


metze

-------------------------------------------------------------------------------------------------
/*****************************************************************
  Functions to be implemented by the (new) group mapping API
****************************************************************/

typedef struct group_map_context
{
         struct group_map_methods *group_map_methods;
         struct group_map_methods *grpent_methods;

         /* These functions are wrappers for the functions listed above.
            They may do extra things like re-reading a GROUP_MAP on update */

         BOOL (*add_group_mapping)(struct group_map_context *,GROUP_MAP 
*map, int flag);
         BOOL (*update_group_mapping)(struct group_map_context *,GROUP_MAP 
*map, int flag);
         BOOL (*delete_group_mapping)(struct group_map_context *,DOM_SID sid);

         BOOL (*enum_group_mappings)(struct group_map_context *,enum 
SID_NAME_USE sid_name_use, GROUP_MAP **rmap,
                         int *num_entries, BOOL unix_only, BOOL with_priv);

         BOOL (*get_group_map_from_sid)(struct group_map_context *,DOM_SID 
sid, GROUP_MAP *map, BOOL with_priv)
         BOOL (*get_group_map_from_gid)(struct group_map_context *,gid_t 
gid, GROUP_MAP *map, BOOL with_priv)
         BOOL (*get_group_map_from_ntname)(struct group_map_context *,char 
*name, GROUP_MAP *map, BOOL with_priv)


         void (*free_fn)(struct group_map_context **);

         TALLOC_CTX *mem_ctx;

} GROUP_MAP_CONTEXT;

typedef struct group_map_methods
{
         const char *name; /* What name got this module */
         struct group_map_context *parent;

         /* Use macros from dlinklist.h on these two */
         struct group_map_methods *next;
         struct group_map_methods *prev;

         BOOL (*add_group_mapping)(struct group_map_context *,GROUP_MAP 
*map, int flag);
         BOOL (*update_group_mapping)(struct group_map_context *,GROUP_MAP 
*map, int flag);
         BOOL (*del_group_mapping)(struct group_map_context *,DOM_SID sid);

         BOOL (*enum_group_mapping)(struct group_map_context *,enum 
SID_NAME_USE sid_name_use, GROUP_MAP **rmap,
                         int *num_entries, BOOL unix_only, BOOL with_priv);

         BOOL (*get_group_map_from_sid)(struct group_map_context *,DOM_SID 
sid, GROUP_MAP *map, BOOL with_priv)
         BOOL (*get_group_map_from_gid)(struct group_map_context *,gid_t 
gid, GROUP_MAP *map, BOOL with_priv)
         BOOL (*get_group_map_from_ntname)(struct group_map_context *,char 
*name, GROUP_MAP *map, BOOL with_priv)

         void *private_data;  /* Private data of some kind */

         void (*free_private_data)(void **);

} GROUP_MAP_METHODS;

typedef NTSTATUS (*group_map_init_function)(struct group_map_context *,
                         struct group_map_methods **,
                         const char *);

struct group_map_init_function_entry {
         char *name;
         /* Function to create a member of the group_map_methods list */
         group_map_init_function init;
};
-------------------------------------------------


metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de>





More information about the samba-technical mailing list