[PATCH] RFC debug detect winbindd version mismatches

Andrew Bartlett abartlet at samba.org
Fri Feb 14 11:47:19 MST 2014


On Fri, 2014-02-14 at 10:27 +0000, Noel Power wrote:
> On 11/02/14 21:58, Andrew Bartlett wrote:
> > Thanks for getting back to us, and I do apologise for the delay in
> > reviewing this.
> >
> > On Thu, 2014-01-30 at 09:36 +0000, Noel Power wrote:
> >
> >>      if ((winbind_open_and_version_check_socket(&request, &response) !
> >> = NSS_STATUS_SUCCESS) || (response.data.interface_version !=
> >> WINBIND_INTERFACE_VERSION)) {
> >>                 return -1;
> >>         }
> > Why do you need to check the interface_version here again?  By my
> > reading winbind_open_and_version_check_socket should have already done
> > that.
> was trying maybe too hard to preserve the orig code, does checking
> winbindd_fd
> 
> e.g.
>         if (winbindd_fd == -1) {
>                 return -1;
>         }
> 
> work for you?
> 
> Noel

Thinking over this a bit more, I think
winbind_open_and_version_check_socket should simply return a wbclient
error or if not practical, a (new) enum as an error code:
 - 0 success
 - 1 not connected
 - 2 wrong version

I don't see why it should take a request/response at all, and callers
shouldn't need to re-check the version. 

I'm also not convinced about the extra call - why can't the original
failure communicate enough?

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list