[Samba] Unable to add a particular member to group (Samba 4.6.3)

Luc Lalonde Luc.Lalonde at polymtl.ca
Fri Apr 28 13:41:31 UTC 2017


Hello Rowland,

Have you tried deleting a user, re-creating the same user and then try 
to add him to a group?

I'm convinced that this will point us in the right direction to correct 
the bug.

Thanks!


Le 2017-04-26 à 14:25, Luc Lalonde a écrit :
> Still doesn't work for that user... for works for another user:
>
> [root at roquefort samba]# cp -av 
> ./lib64/python2.6/site-packages/samba/samdb.py 
> ./lib64/python2.6/site-packages/samba/samdb.py.bak
> « ./lib64/python2.6/site-packages/samba/samdb.py » -> « 
> ./lib64/python2.6/site-packages/samba/samdb.py.bak »
> [root at roquefort samba]# vi ./lib64/python2.6/site-packages/samba/samdb.py
> [root at roquefort samba]# /usr/local/samba/bin/samba-tool group 
> addmembers foogroup foouser
> ERROR(exception): Failed to add members "foouser" to group "foogroup" 
> - Unable to find "foouser". Operation cancelled.
>   File 
> "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/group.py", 
> line 239, in run
>     add_members_operation=True)
>   File 
> "/usr/local/samba/lib64/python2.6/site-packages/samba/samdb.py", line 
> 275, in add_remove_group_members
>     raise Exception('Unable to find "%s". Operation cancelled.' % member)
> [root at roquefort samba]# /usr/local/samba/bin/samba-tool group 
> removemembers foogroup foouser2
> Removed members from group foogroup
> [root at roquefort samba]# /usr/local/samba/bin/samba-tool group 
> addmembers foogroup foouser2
> Added members to group foogroup
> [root at roquefort samba]# cp -av 
> ./lib64/python2.6/site-packages/samba/samdb.py.bak 
> ./lib64/python2.6/site-packages/samba/samdb.py
> cp : voulez-vous écraser « 
> ./lib64/python2.6/site-packages/samba/samdb.py » ? y
> « ./lib64/python2.6/site-packages/samba/samdb.py.bak » -> « 
> ./lib64/python2.6/site-packages/samba/samdb.py »
>
> Thanks again for your help!
>
> Le 2017-04-26 à 12:44, Rowland Penny a écrit :
>> On Wed, 26 Apr 2017 11:47:03 -0400
>> Luc Lalonde via samba <samba at lists.samba.org> wrote:
>>
>>> This is the case for this user too... Could it be that Samba is
>>> trying to work with the old SID???
>>>
>> It doesn't work with SID.
>>
>> Are you up to trying something ?
>>
>> If so, first find a Samba python file 'samdb.py' this is usually in
>> this directory path 'python2.x/site-packages/samba/'
>>
>> Backup your original file, then open the original in an editor and find
>> this line:
>>
>> ldb.binary_encode(member), ldb.binary_encode(member)), attrs=[])
>>
>> In my copy it is line 271 under 'def add_remove_group_members(self,
>> groupname, members,'
>>
>> Change it to:
>>
>> member, member), attrs=[])
>>
>> Make sure the characters start at the same place as they do now.
>>
>> close and save the file.
>>
>> Now, try again.
>>
>> Rowland
>>
>>
>

-- 
Luc Lalonde, analyste
-----------------------------
Département de génie informatique:
École polytechnique de MTL
(514) 340-4711 x5049
Luc.Lalonde at polymtl.ca
-----------------------------




More information about the samba mailing list