return True;
}
+/****************************************************************************
+ Convert a gid to SID - algorithmic.
+****************************************************************************/
+
+DOM_SID *algorithmic_gid_to_sid(DOM_SID *psid, uid_t gid)
+{
+ if ( !lp_enable_rid_algorithm() )
+ return NULL;
+
+ DEBUG(8,("algorithmic_gid_to_sid: falling back to RID algorithm\n"));
+ sid_copy( psid, get_global_sam_sid() );
+ sid_append_rid( psid, pdb_gid_to_group_rid(gid) );
+ DEBUG(10,("algorithmic_gid_to_sid: gid (%d) -> SID %s.\n",
+ (unsigned int)gid, sid_string_static(psid) ));
+
+ return psid;
+}
+
/****************************************************************************
Convert a gid to SID - locally.
****************************************************************************/
/* fallback to rid mapping if enabled */
if ( lp_enable_rid_algorithm() ) {
- sid_copy(psid, get_global_sam_sid());
- sid_append_rid(psid, pdb_gid_to_group_rid(gid));
DEBUG(10,("local_gid_to_sid: Fall back to algorithmic mapping: %u -> %s\n",
(unsigned int)gid, sid_string_static(psid)));
- return psid;
+ return algorithmic_gid_to_sid(psid, gid);
}
else
return NULL;