[GSoC][Samba4] Segfault after calling libnet_UserInfo_send()
Rafal Szczesniak
mimir at samba.org
Wed Aug 8 12:38:01 GMT 2007
On Wed, Aug 01, 2007 at 08:15:14AM +1000, Andrew Bartlett wrote:
> On Tue, 2007-07-31 at 18:49 +0200, Kai Blin wrote:
>
> As far as I can tell, the issue is here:
>
> > +static void cmd_getpwnam_recv_domain(struct composite_context *ctx)
> > +{
> > + struct cmd_getpwnam_state *state = talloc_get_type(
> > + ctx->async.private_data, struct
> > cmd_getpwnam_state);
> > + struct wbsrv_domain *domain;
> > + struct libnet_UserInfo *user_info;
> > + char *user_dom, *user_name;
> > +
> > + state->ctx->status = wb_name2domain_recv(ctx, &domain);
> > + if(!composite_is_ok(state->ctx)) return;
> > +
> > + user_info = talloc(state, struct libnet_UserInfo);
> > + if (user_info == NULL) return;
> > +
> > + if(!wb_samba3_split_username(state, state->name, &user_dom,
> > &user_name))
> > + return;
> > +
> > + user_info->in.user_name = user_name;
> > + user_info->in.domain_name = user_dom;
>
> I don't know why the attempt to close the samr handle fails, but it's a
> good thing that it doesn't work, as these are long-term resources
> handled by winbind, not libnet... (Perhaps that code should cope with
> multiple open domains, rather than closing one).
Correct. libnet code is designed to handle one domain at a time. Since
(usually) different domains require different set of credentials, they
can be handled with separate libnet contexts.
> Anyway, if you set
>
> user_info->in.domain_name = domain->libnet_ctx->samr.name
>
> Then this should null out the check in lit libnet_UserInfo code that is
> trying to close the pipe...
The thing I need to check is why the function segfaulted instead of
closing the handle and opening the new one.
cheers,
--
Rafal Szczesniak
Samba Team member http://www.samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20070808/8027dc85/attachment.bin
More information about the samba-technical
mailing list