On Feb 20 11:41, Tom Honermann wrote: > On 02/20/2015 11:24 AM, Corinna Vinschen wrote: > >On Feb 20 11:07, Tom Honermann wrote: > >>On 02/20/2015 04:56 AM, Corinna Vinschen wrote: > >>>>Lastly, running cygserver to cache the LDAP data has another side-effect > >>>>when using VPN. Since the cygserver is usually started before you've > >>>>dialed into the VPN, your username and some groups will get reported as > >>>>"DOM+User(12345)". You have to restart cygserver after the VPN is up to > >>>>correct that. > >>> > >>>Yep. We should contemplate to allow sending a signal to cygserver to > >>>invalidate its cache. > >> > >>Perhaps cygserver could subscribe to network event notifications and > >>automatically invalidate its cache? > >> > >>https://msdn.microsoft.com/en-us/library/windows/desktop/aa366334%28v=vs.85%29.aspx > > > >How do you know if and when an interface change requires a cache > >invalidation? > > I doubt there is a perfect algorithm, but perhaps a heuristic would work > fairly well. For non-mobile systems, interface changes are presumably > rather rare and invalidation on the addition of any new interface might be > acceptable. For mobile systems migrating between networks, the situation is > tougher > [...]
Maybe it is actually simpler than that. Invalidating the cache as a whole probably never makes sense. In fact there are two reasons for invalidation: - The pw_name, pw_shell, pw_home, pw_gecos settings for a user changed. - The interface to the DC was broken and there are entries of the type Achim mentioned, "DOM+User(RID)". The first case can only be fixed by invalidating the cache on a regular basis. If we didn't fetch the info for a user for, say, 5 minutes, drop the entry from the cache and renew the information by asking the DC again. As for the second case, the DOM+User(RID) entries are undesired and wrong anyway. So maybe the caching code could do what you said in the first place. Invalidate the cache on every network change. But then, only invalidate the entries of the aforementioned type. Care to hack a bit? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat
pgpy8hasBMOL5.pgp
Description: PGP signature