svn commit: samba r20090 - in branches: SAMBA_3_0/source/auth SAMBA_3_0/source/groupdb SAMBA_3_0/source/lib SAMBA_3_0/source/nsswitch SAMBA_3_0/source/passdb SAMBA_3_0/source/rpcclient SAMBA_3_0/source/smbd SAMBA_3_0_24/source/auth SAMBA_3_0_24/source/groupdb SAMBA_3_0_24/source/lib SAMBA_3_0_24/source/nsswitch SAMBA_3_0_24/source/passdb SAMBA_3_0_24/source/rpcclient SAMBA_3_0_24/source/smbd

Jeremy Allison jra at samba.org
Sun Dec 10 04:04:59 GMT 2006


On Sat, Dec 09, 2006 at 05:05:42PM -0800, James Peach wrote:
> 
> But what happens to the gids that were allocated on mem_ctx by  
> pdb_default_enum_group_memberships? Previously they were allocated on  
> tmp_ctx which is destroyed on the way out. Now they are just left  
> dangling. Am I missing something here?

Nope - good catch there. I forgot about the gids array.
We only use one entry in it so we can free it afterwards.
The real problem is we should never use the null context
for these. I might just fix this in smbd/service.c and
copy the nt_user_tokens afterwards.

> I'd argue that if create_token_from_username fails it should clean  
> found_username itself. Callers shouldn't have to do this.

This isn't in the fail case - it's in the success case
where it returns a username talloc'ed on the passed in
context. Again, the underlying problem is using the
null context.

Jeremy.


More information about the samba-cvs mailing list