[PATCH] samba-tool: Adding/removing none-existent users to/from groups doesn't fail

Michael Adam obnox at samba.org
Fri Oct 17 04:08:25 MDT 2014


FYI: failed autobuild twice for me

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1656/1688 in 1h40m22s] samba4.blackbox.group.py
UNEXPECTED(failure): samba4.blackbox.group.py.group addmembers(none)
REASON: _StringException: _StringException: ERROR(exception): Failed to add members "newuser,newuser1" to group "dsg" - Unable to find "newuser". Operation cancelled.
  File "bin/python/samba/netcmd/group.py", line 217, in run
    add_members_operation=True)
  File "bin/python/samba/samdb.py", line 263, in add_remove_group_members
    raise Exception('Unable to find "%s". Operation cancelled.' % member)

FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Apparently it was premature?

Michael

On 2014-10-17 at 01:02 +0200, Michael Adam wrote:
> pushed to autobuild, thanks!
> 
> Just a minor commit message cleanup:
> 
> git usually wants 1 short 1st commit messag line,
> then 1 blank line and then more stuff.
> I reformatted the commit msg accordingly.
> Also, I added "samba-tool: " to the beginning
> of the first commit msg line
> 
> Cheers - Michael
> 
> On 2014-10-13 at 22:52 +0200, Marc Muehlfeld wrote:
> > Hello,
> > 
> > attached a small patch, that solves the request of
> > https://bugzilla.samba.org/show_bug.cgi?id=10871
> > 
> > Please review and push, if OK. Thanks.
> > 
> > 
> > Regards,
> > Marc
> 
> > From 6379a9736f716db8723f2d570625d2251ce63917 Mon Sep 17 00:00:00 2001
> > From: Marc Muehlfeld <mmuehlfeld at samba.org>
> > Date: Sun, 12 Oct 2014 16:32:08 +0200
> > Subject: [PATCH 1/2] Add exception when trying to add/remove none existent
> >  users from a group. This allows a better scripting around samba-tool for
> >  adding/removing users to/from groups. Before the output and the return code
> >  had indicated that everything was successul.
> > 
> > See: https://bugzilla.samba.org/show_bug.cgi?id=10871
> > 
> > Signed-off-by: Marc Muehlfeld <mmuehlfeld at samba.org>
> > ---
> >  python/samba/samdb.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/python/samba/samdb.py b/python/samba/samdb.py
> > index 2dfc839..e6d99bc 100644
> > --- a/python/samba/samdb.py
> > +++ b/python/samba/samdb.py
> > @@ -260,7 +260,7 @@ changetype: modify
> >                      ldb.binary_encode(member), ldb.binary_encode(member)), attrs=[])
> >  
> >                  if len(targetmember) != 1:
> > -                    continue
> > +                    raise Exception('Unable to find "%s". Operation cancelled.' % member)
> >  
> >                  if add_members_operation is True and (targetgroup[0].get('member') is None or str(targetmember[0].dn) not in targetgroup[0]['member']):
> >                      modified = True
> > -- 
> > 1.9.3
> > 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141017/ed960bc7/attachment.pgp>


More information about the samba-technical mailing list