[GSoC][Samba4] Segfault after calling libnet_UserInfo_send()

Andrew Bartlett abartlet at samba.org
Tue Jul 31 22:15:14 GMT 2007


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).  

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...

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.                  http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20070801/90a7f40d/attachment.bin


More information about the samba-technical mailing list