On kwi 06, Jan Kowalsky wrote:
> a few things, namely makes the posixGroup object clas an
AUXILLIARY class,
> which lets you apply it to existing objects. You can then create an
> inetOrgPerson object with posixGroup class and define gidNumber in
> a single object - that's how DebOps handles User Private Groups in
> LDAP[3].
Here began the problem in interaction with fusiondirectory and I think
I understood now why:
The User Private Groups are implemented in debops in a very special way
I think. (I don't know how common it is - I haven't found much about.
It seems quite clever because you only need one object - but I think it
restricts interoperability with other tools.
By combining the personal object with the group object, the LDAP directory
itself can ensure that the UID/GID stays consistent, there's no need for
external application to keep track when UID or GID changes, moving the check
to outside of the directory. It's a bit tricky, since you need to filter the
groups on the baseDN with specific object classes. Tradeoffs, I suppose.
> As for th constraint violation - gidNumber uniqueness is enfoced
globally
> by the 'slapd' role[4] to avoid collisions and accidental security issues.
> If you want to create a new user with unique UID and GID number, it's best
> to reserve one via special LDAP objects prepared just for that[5], similar
> to how FusionDirectory does it.
FusionDirectory creates two objects for User Private Groups: one in
ou=People and one in ou=Groups, eg:
uid=tuser,ou=people,dc=example,dc=org
cname=tuser,ou=groups,dc=example,dc=org
but both with gidNumber set to the same value.
This clashs with the
/etc/ldap/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={2}unique.ldif
So I configured:
slapd__tasks:
- name: 'Configure Unique overlay in the main database'
dn: 'olcOverlay={2}unique,olcDatabase={1}mdb,cn=config'
attributes:
olcUniqueURI:
# - 'ldap:///{{ slapd__basedn }}?uidNumber?sub'
# - 'ldap:///{{ slapd__basedn }}?gidNumber?sub'
- 'ldap:///{{ slapd__basedn }}?mail?sub'
- 'ldap:///{{ slapd__basedn }}?mailAddress,mailAlternateAddress?sub'
- 'ldap:///ou=People,{{ slapd__basedn }}?employeeNumber?sub'
- 'ldap:///ou=People,{{ slapd__basedn }}?uid?sub'
- 'ldap:///ou=People,{{ slapd__basedn }}?gid?sub'
state: 'exact'
(omitted the ldap:///{{ slapd__basedn }}?gidNumber?sub)
Nicely done. :)
and now I can add Users with Private User Groups in fusiondirectory.
They are stored in two objects anyway. But I think this is standard in
many environments. Isn't it?
It is standard, because rfc2037 has the posixGroup as a STRUCTURAL object,
which was later considered to be a mistake, hence rfc2037bis. But, due to the
former schema used by default in many OpenLDAP installations, the separation
of users and groups became the rule, I suppose.
Probably it would be enough to use
olcUniqueURI:
- 'ldap:///ou=People,{{ slapd__basedn }}?uidNumber?sub'
- 'ldap:///ou=groups,{{ slapd__basedn }}?gidNumber?sub'
Because we only need same gidNumber in People/Groups once.
Yeah, I suppose. But that would require external logic to handle any UID/GID
changes, maybe add an 'owner' attribute that points to the owner of
a particular group, and so on. Currently there's no official management
interface for the LDAP directory in DebOps that would do the job.
But the roles in DebOps are flexible enough that the possibility of changing
the defaults is there. Perhaps you could add a guide that explains how to
modify the default configuration to be compatible with FusionDirectory? I'm
sure that many users would be interested in it.
What's interesting: fusiondirectory understands the objects
written
with debops. The default user is shown as posix user and also on
editing everything is stored in one ldap object.
Of course, the underlying LDAP schemas are largely unchanged.
My task is to use openldap and fusiondirectory for an "old
style" samba
directory with posix and samba users. This is in my opinion still the
easiest way for mixed environments with mainly linux desktop clients
and central file storage + home on network when we do not need any
domain logon with Windows clients. I wanted to try to map as much as I
can with debops. But we need a grafical user interface for ldap admin
tasks for the local administration inside the organisations.
At my workplace we have an existing integration database that gathers data
from various sources. Then, a script converts the relevant information and
updates the entries in LDAP, so that a custom interface is not needed.
I suppose if LDAP is your central truth surce about users, you need to have
a way to manage it directly though.
Since it's a Linux-based environment, why not look into Kerberos and NFS
instead of Samba? These should be more "native" than CIFS shares, and perhaps
could be better integrated in your environment, with native UNIX accounts in
the filesystem and so on. And if you don't care too much about secure file
access, Kerberos could be ditched as well. Somehow putting Samba smack in the
middle of Linux environment feels a bit wrong to me.
Cheers,
Maciej