Bug 584497

Summary: RFE: Allow DNA plugin to set same value on multiple attributes
Product: [Retired] 389 Reporter: Rob Crittenden <rcritten>
Component: Directory ServerAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: low    
Version: 1.2.6CC: amsharma, jgalipea, nkinder, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:37:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 639035    
Attachments:
Description Flags
Proposed Patch nkinder: review?, rmeggins: review+

Description Rob Crittenden 2010-04-21 17:54:35 UTC
Description of problem:

In IPA we are trying to implement Magic Private Groups (MPG).

With MPG when a user is created a group is created with the same name and the gidNumber the same as the uidNumber.

Part of this is achieved with the Managed Entries plugin. The group is created/removed along with the user.

We currently use DNA to obtain a uidNumber (and gidNumber for new posix groups).

What we need for MPG is to set the gidNumber to the uidNumber when the user is created. This currently seems to happen prior to the Managed Entries plugin being executed which is a good thing, so we can use the gidNumber attribute from the user entry to populate the group entry.

Version-Release number of selected component (if applicable):

389-ds-base-1.2.6-0.3.a3.fc12.x86_64

Comment 1 Nathan Kinder 2010-04-29 00:40:02 UTC
Created attachment 409993 [details]
Proposed Patch

This patch allows one to set multiple dnaType attributes for a single
DNA range.  This allows the same value to be used for each dnaType
(such as ensuring the uidNumber and gidNumber are the same value
from the range when ading a posixAccount).

There are some differences with the way DNA works for multi-type
ranges.  For a value to be generated from a multi-type range, the
magic value must be specified to indicate which attributes should
use the newly generated value.  This allows a range to be shared
across different entry types (such as having a uidNumber/gidNumber
range that is used or posixAccount and posixGroup entries).  A
multi-type range will not generate a value for missing attributes
as DNA does for single-type ranges.

Since a range can have multiple types, the internal ordering of
config structs had to be changed to order by scope only.  It was
previously ordered by type and then scope, which allowed us to
easily detect if we had already generated a value for a given type.
This change required a number of helper functions to be added for
tracking and checking which types we have already generated values
for.

Comment 4 Nathan Kinder 2010-04-30 17:19:27 UTC
Pushed to master.  Thanks to Rich for his review!

Counting objects: 13, done.
Delta compression using 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 4.96 KiB, done.
Total 7 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   0501282..a0b60b0  master -> master

Comment 6 Amita Sharma 2011-07-08 12:56:13 UTC
DNA startup 	100% (1/1) 	  	 
DNA run 	100% (61/61) 	  	 
DNA cleanup 	100% (1/1)

Hence VERIFIED.