<div dir="ltr"><div><div>Sorry I should have given some more information. We are trying to allow the user's from the trusted windows domain to login to the Solaris client and the only way I have found to have this work is by using the cn=compat,$SUFFIX for the passwd as this will force the ldap client to to use the slapi plugin on the ipa server.  This required using ldapclient manual on the solaris system instead of the default profile (which uses cn=accounts for passwd).<br><br></div><div>ex:<br>ldapclient list for default profile shows: (supports IPA users just fine)<br>NS_LDAP_SEARCH_BASEDN= $SUFFIX<br>NS_LDAP_SERVICE_SEARCH_DESC= passwd:cn=users,cn=accounts,$SUFFIX<br>NS_LDAP_SERVICE_SEARCH_DESC= group:cn=groups,cn=compat,$SUFFIX<br><br></div><div>ldaplist list for my manual profile shows: (supports windows users just fine)<br>NS_LDAP_SEARCH_BASEDN= $SUFFIX<br>NS_LDAP_SERVICE_SEARCH_DESC= passwd:cn=users,cn=compat,$SUFFIX<br>NS_LDAP_SERVICE_SEARCH_DESC= group:cn=groups,cn=compat,$SUFFIX</div><div><br></div>What we were trying to do is also allow IPA created user's to login to the Solaris client in addition to the windows user's.  This is where I started to run into problems with the pam_ldap module as it was detecting the duplicate entries from the "bug" above.<br><br></div><div>If you are interesting in seeing this action, you can see the duplicate entries in the compat tree on the lab system right now.<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 12, 2017 at 2:58 PM, Alexander Bokovoy <span dir="ltr"><<a href="mailto:abokovoy@redhat.com" target="_blank">abokovoy@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On su, 12 maalis 2017, Robert Johnson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Mar 10, 2017 at 1:16 AM, Alexander Bokovoy <<a href="mailto:abokovoy@redhat.com" target="_blank">abokovoy@redhat.com</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On to, 09 maalis 2017, Robert Johnson wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Mar 9, 2017 at 4:06 PM, Alexander Bokovoy <<a href="mailto:abokovoy@redhat.com" target="_blank">abokovoy@redhat.com</a>><br>
wrote:<br>
<br>
On to, 09 maalis 2017, Robert Johnson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hello,<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I am running into an odd issue haven't been able to find any information<br>
through searching on this issue online.<br>
<br>
Environment: We are currently have a IPA master running<br>
ipa-server-4.4.0-14.el7_3.4.x8<wbr>6_64 on a RHEL 7.3 server.  We have a mix<br>
of<br>
RHEL 6.8, RHEL 7.x and Solaris 10 clients. We also have a one way trust<br>
to<br>
a windows domain.  Compatibility mode is enabled.<br>
<br>
The issue I'm seeing is that when I delete an IPA domain user through<br>
the<br>
web gui, the user account doesn't appear to be removed completely from<br>
the<br>
system.  I verified via "ipa user-find" that the user is no longer in<br>
the<br>
system.  I also checked via "ldapsearch" that the user account doesn't<br>
exist in the "accounts" container.  However, when I look in the "users,<br>
compat" container, that user still exists.<br>
<br>
This is causing problems with my Solaris clients since they are pointing<br>
to<br>
the compat tree so that we can login with the windows accounts on those<br>
servers.  The Solaris client is still seeing the account as being valid<br>
and<br>
is asking the user for a password on login which fails because the<br>
account<br>
doesn't exist in the IPA domain anymore.<br>
<br>
Do I need to remove the account from the ldap compat container manually<br>
or<br>
is the IPA user delete command (through the gui and/or command line)<br>
suppose to take care of this ?  Or is there is some sort of clean up<br>
process that I have to wait for to occur before this account gets<br>
removed<br>
from that container ?  If so, what is the time frame ?<br>
<br>
Compat tree is automatically generated. It also tracks existing objects,<br>
</blockquote>
so any time the object is removed from the primary tree, it should be<br>
cleared from the compat tree as well.<br>
<br>
If you can reliably demonstrate the problem using<br>
<a href="http://www.freeipa.org/page/Demo" rel="noreferrer" target="_blank">http://www.freeipa.org/page/De<wbr>mo</a> (it has compat tree enabled), then feel<br>
free to open a bug.<br>
<br>
--<br>
/ Alexander Bokovoy<br>
<br>
<br>
</blockquote>
So after doing some more digging using ldapsearch, I discovered some "odd"<br>
entries.  It appears that all my IPA users appear to have duplicate<br>
entries<br>
under the compat tree. So on a hunch I deleted another IPA user and one of<br>
the two entries disappeared from the container.  I tried to use ldapdelete<br>
(and ldapmodify) to remove the "ghost" entry using the DN I found from the<br>
search and I get a "object not found" and then it says that it matched the<br>
base tree.  If I dump the whole compat tree out to a file, the ghost<br>
objects look to be exact duplicates of the original entries (minus the<br>
guid<br>
which is different).  I can't seem to find a way to remove them.<br>
<br>
Any ideas ?<br>
<br>
</blockquote>
Demonstrate your problem using the FreeIPA demo instance, please.<br>
<br>
Compat tree is not writable, thus you cannot delete anything from it<br>
directly. You only can delete the original entry to cause removal of a<br>
compat entry.<br>
<br>
Show how it is not removed with step by step ldapsearch/ipa CLI<br>
operations against our demo instance, please.<br>
<br>
--<br>
/ Alexander Bokovoy<br>
<br>
</blockquote>
<br>
Ok, I believe I have been able to reproduce the problem.<br>
1) Before I created the new user, I verified by using the ldapsearch<br>
command on the compat tree that the user I was going to create didn't exist:<br>
ldapsearch -b "cn=compat,dc=demo1,dc=freeipa<wbr>,dc=org" -h<br>
<a href="http://ipa.demo1.freeipa.org" rel="noreferrer" target="_blank">ipa.demo1.freeipa.org</a> -s sub "(&(objectclass=*)(uid=123456)<wbr>)"<br>
Returns nothing<br>
ldapsearch -b "cn=accounts,dc=demo1,dc=freei<wbr>pa,dc=org" -h<br>
<a href="http://ipa.demo1.freeipa.org" rel="noreferrer" target="_blank">ipa.demo1.freeipa.org</a> -s sub "(&(objectclass=*)(uid=123456)<wbr>)"<br>
Returns nothing<br>
Note: I also tried just dumping all the user objects to a file and made<br>
sure it wasn't there.<br>
<br>
2) Next, I login to the webui and then create the new user.<br>
userlogin: 123456<br>
First Name: Test<br>
Last Name: User<br>
and then a password.<br>
<br>
3) Next I verified that the account was showing up in the compat tree:<br>
ldapsearch -b "cn=compat,dc=demo1,dc=freeipa<wbr>,dc=org" -h<br>
<a href="http://ipa.demo1.freeipa.org" rel="noreferrer" target="_blank">ipa.demo1.freeipa.org</a> -s sub "(&(objectclass=*)(uid=123456)<wbr>)"<br>
version: 1<br>
dn: uid=123456,cn=users,cn=compat,<wbr>dc=demo1,dc=freeipa,dc=org<br>
objectClass: posixAccount<br>
objectClass: ipaOverrideTarget<br>
objectClass: top<br>
gecos: Test User<br>
cn: Test User<br>
uidNumber: 1120000053<br>
gidNumber: 1120000053<br>
loginShell: /bin/sh<br>
homeDirectory: /home/123456<br>
ipaAnchorUUID::<br>
OlNJRDpTLTEtNS0yMS0zNjIwNjU0OD<wbr>cyLTY4NzE1NzE0Mi00MDUwMjk3OTIz<wbr>L<br>
TEwNTM=<br>
uid: 123456<br>
<br>
4) I delete the same user account via the webgui (full delete).<br>
<br>
5) I then check the compat tree again and here is the result:<br>
ldapsearch -b "cn=compat,dc=demo1,dc=freeipa<wbr>,dc=org" -h<br>
<a href="http://ipa.demo1.freeipa.org" rel="noreferrer" target="_blank">ipa.demo1.freeipa.org</a> -s sub "(&(objectclass=*)(uid=123456)<wbr>)"<br>
version: 1<br>
dn: uid=123456,cn=users,cn=compat,<wbr>dc=demo1,dc=freeipa,dc=org<br>
objectClass: posixAccount<br>
objectClass: ipaOverrideTarget<br>
objectClass: top<br>
gecos: Test User<br>
cn: Test User<br>
uidNumber: 1120000053<br>
gidNumber: 1120000053<br>
loginShell: /bin/sh<br>
homeDirectory: /home/123456<br>
ipaAnchorUUID::<br>
OlNJRDpTLTEtNS0yMS0zNjIwNjU0OD<wbr>cyLTY4NzE1NzE0Mi00MDUwMjk3OTIz<wbr>L<br>
TEwNTM=<br>
uid: 123456<br>
<br>
The user account is still there.<br>
</blockquote></div></div>
Thanks, this is helpful. <br><span class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now what is really weird is that if I recreate the user 123456 through the<br>
webgui and perform the ldapsearch, I see two entries.  If I delete the<br>
user, it removes one of the entries and leaves the shadow one above.  I can<br>
tell because the accounts look identical except for the ipaAnchorUUID<br>
attribute.<br>
</blockquote></span>
This is a bug then. Could you please file a ticket?<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- This is a problem for our Solaris systems, as the ldap client is pointing<br>
to the compat tree so when the accounts are still active in the ipa domain<br>
(ie they are in the accounts tree) I am seeing 2 entries when using the<br>
getent passwd command.  Needless to say the pam_ldap module doesn't like<br>
the two entries.<br>
</blockquote></span>
No, this is a wrong setup. Either you are using compat tree and have your<br>
base DN in pam_ldap config set to cn=compat,$SUFFIX, or you are using<br>
primary tree and then set base dn to cn=accounts,$SUFFIX. You shouldn't<br>
mix them in your configuration.<br>
<br>
Compat tree is just that: a tree that returns data in a format<br>
compatible with RFC2307 to clients that do not understand RFC2307bis. A<br>
second use for the compat tree is to provide unified virtual tree for<br>
clients that do not use SSSD so that both users from IPA and from<br>
trusted Active Directory forests are accessible by such 'legacy'<br>
clients. This second use case requires that you are using RFC2307 schema<br>
in your client setup and that AD users are always fully qualified<br>
(user@ad.domain).<br>
<br>
So if you have configured your client to look at $SUFFIX, it is actually<br>
expected that the client would see both entries (original one and the<br>
one from the virtual tree) because that's how they were designed. Thus,<br>
use a proper, narrow, base DN, like cn=accounts,$SUFFIX for the primary<br>
IPA tree and cn=compat,$SUFFIX for the compat tree but never $SUFFIX.<br>
<br>
SSSD clients handle this automatically. For IPA provider, SSSD<br>
automatically sets search base to cn=accounts,$SUFFIX and uses<br>
IPA-specific LDAP extended operation to query IPA servers for<br>
information about users from Active Directory forests IPA domain trusts.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
/ Alexander Bokovoy<br>
</font></span></blockquote></div><br></div>