Bug 137793 - setting samba-client requires disabling nscd cache
Summary: setting samba-client requires disabling nscd cache
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: unspecified
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Guenther Deschner
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-09 14:58 UTC by Jiří Suchomel
Modified: 2006-03-13 23:40 UTC (History)
3 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
screenshot of yast2-samba-client (103.61 KB, image/png)
2005-12-09 15:00 UTC, Jiří Suchomel
Details
flush nscd cashes at least after coming back online (2.60 KB, patch)
2006-03-10 10:37 UTC, Guenther Deschner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Suchomel 2005-12-09 14:58:26 UTC
Looks like when yast2-samba-client is configured with Active Directory, nscd cache for passwd and group has to be disabled. However I don't like doing this without notising user and without giving him the possibility to revert this settings. Several questions arise here:

- why is it necessary to remove the cache? Isn't it rather bug somewhere else (in pam_winbind...)? If so, it should be fixed at the place where it is broken.

- in yast2-samba-client it is possible to add a checbox for this setting, which would gave the information to user and possibility to (not) accept it. Is it correct to add this setting here, while other authentication methods don't require it?

Stano, could you comment?
Comment 1 Jiří Suchomel 2005-12-09 15:00:14 UTC
Created attachment 60195 [details]
screenshot of yast2-samba-client

checkbox
Comment 2 Guenther Deschner 2005-12-09 17:16:30 UTC
This requirement is caused by the caching nature of winbind itself. It uses sequence numbers (either from the SAM (NT4) or LDAP (ADS)) to maintain cached entries. When nscd is running NSS requests do not reach winbindd directly because they are answered by nscd and therefor winbind can't hold it's own cache consistent. For winbind it is necessary that it receives NSS requests directly to e.g. cleanup older entries.
Comment 3 Guenther Deschner 2005-12-09 17:17:41 UTC
Unfortunately nscd does not allow to disable caching per backend (only globally per service).
Comment 4 Lars Müller 2005-12-09 18:22:31 UTC
Thorsten: How hard is it to implement caching per backend?
Comment 5 Thorsten Kukuk 2005-12-09 19:16:18 UTC
(In reply to comment #4)
> Thorsten: How hard is it to implement caching per backend?


Impossible. nscd does not know anything about single service, this is still
done by the glibc NSS functions. nscd only caches the result of getpwnam_r()
and similar function calls, nothing else.

Comment 6 Thorsten Kukuk 2005-12-09 19:19:05 UTC
(In reply to comment #2)
> This requirement is caused by the caching nature of winbind itself. It uses
> sequence numbers (either from the SAM (NT4) or LDAP (ADS)) to maintain cached
> entries. When nscd is running NSS requests do not reach winbindd directly

nscd caches getpwnam_r(), not the underlying NSS requests.

> because they are answered by nscd and therefor winbind can't hold it's own
> cache consistent. For winbind it is necessary that it receives NSS requests
> directly to e.g. cleanup older entries.

Then something in winbind is broken. Where is the difference if an application like ls or tar caches the getpwnam_r() result itself or if a daemon is doing that? Why should it work/does it work with ls and tar and not with nscd?
Comment 7 Thorsten Kukuk 2005-12-09 19:20:37 UTC
(In reply to comment #0)

> - why is it necessary to remove the cache? Isn't it rather bug somewhere else
> (in pam_winbind...)? If so, it should be fixed at the place where it is broken.

pam_winbind is a PAM module and should have nothing to do with NSS and nscd. PAM is something complety different than NSS.
Comment 8 Jiří Suchomel 2005-12-12 09:35:10 UTC
ad comment #6
> Then something in winbind is broken. Where is the difference if an application
> like ls or tar caches the getpwnam_r() result itself or if a daemon is doing
> that? Why should it work/does it work with ls and tar and not with nscd?

Lars, Guenther: can you comment?
What is the correct solution?

JFYI: it is - technically - easy to "solve" it on the YaST level, but solving it this way looks like workaround for some bug which is deeper.

BTW, it was already discussed earlier, at some time yast2-samba-client used to disable nscd, then not and now it is required again.

Comment 9 Jiří Suchomel 2005-12-16 16:34:32 UTC
Lars - any news?
Comment 10 Jiří Suchomel 2005-12-20 14:12:02 UTC
Looks like Lars has vacations - Guenther, can you answer?
Comment 11 Jiří Suchomel 2006-01-10 16:03:30 UTC
Any news here?
If I won't have an answer, it cannot be implemented... (subproblem: if it requires new texts for YaST, e.g. for a checkbox, it might not get implemented because of the text freeze...)
Comment 12 Lars Müller 2006-01-13 15:38:52 UTC
We, Günther and me, had a discussion regarding this. Günther will provide the current state till 2006-01-14.
Comment 13 Jiří Suchomel 2006-01-17 11:00:19 UTC
Uhm, the comment is still missing. 
I propose just to stop nscd when winbind is set for authentication as it used to be in older yast2-samba-client.

(btw, i'm in NBG this week)
Comment 14 Jiří Suchomel 2006-01-24 14:46:48 UTC
any news?
Comment 15 Jiří Suchomel 2006-01-25 13:50:36 UTC
Sorry, but no information => no action.
Comment 16 Lars Müller 2006-02-24 11:44:42 UTC
Reopen as Günther should provide the missing information.  See comment #12.
Comment 17 Jiří Suchomel 2006-02-24 12:52:16 UTC
btw, what's the relation with bug #143927?
Comment 18 Guenther Deschner 2006-03-10 10:37:16 UTC
Ok, after thinking a little more about that I discovered libnscd which could be quite usefull for us. If I understand that library correct, it will allow us to flush the nscd caches for passwd and group at any time (in particular after we are switching from offline to online mode, Jiri, this is the relation with bug 143927).

It still needs some more testing but I think with the attached patch we can cope with nscd running better.

Thorsten, do I use libnscd correct here? 
Comment 19 Guenther Deschner 2006-03-10 10:37:59 UTC
Created attachment 72204 [details]
flush nscd cashes at least after coming back online
Comment 20 Thorsten Kukuk 2006-03-10 16:36:36 UTC
libnscd will only flush the cache, nscd will not reread any configuration files.

If this is what you wish to archive, the patch looks correct.
Comment 21 Guenther Deschner 2006-03-13 23:40:10 UTC
Ok, thanks Thorsten.

Fixed upstream and committed to autobuild.

We might need to pull a flush_nscd_cache also when starting offline later... but closing for now.