Bug 584497 - RFE: Allow DNA plugin to set same value on multiple attributes
Summary: RFE: Allow DNA plugin to set same value on multiple attributes
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.2.6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Viktor Ashirov
Depends On:
Blocks: 639035
TreeView+ depends on / blocked
Reported: 2010-04-21 17:54 UTC by Rob Crittenden
Modified: 2015-12-07 16:37 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-12-07 16:37:31 UTC

Attachments (Terms of Use)
Proposed Patch (31.02 KB, patch)
2010-04-29 00:40 UTC, Nathan Kinder
nkinder: review?
rmeggins: review+
Details | Diff

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):


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

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)


Note You need to log in before you can comment on or make changes to this bug.