Luc Lalonde
2017-Apr-26 15:47 UTC
[Samba] Unable to add a particular member to group (Samba 4.6.3)
This is the case for this user too... Could it be that Samba is trying to work with the old SID??? Le 2017-04-26 à 10:47, Dale Renton via samba a écrit :> On Tue, Apr 25, 2017 at 3:31 PM, Luc Lalonde via samba < > samba at lists.samba.org> wrote: > >> The user exists in AD: >> >> - I can see the user using 'wbinfo', 'samba-tool user list' >> >> - I can add the user to a group with 'Active Directory Users and >> Computers' in Windows 2008R2 >> >> - It's seems impossible to use 'samba-tool group addmembers foogroup >> foouser' >> >> I looked at the user's attributes but can't find anything different from >> any other user that works properly. >> >> Any other ideas? >> >> > I have the exact same problem on 4.5.1. The user I was having a problem > with was deleted and recreated I believe. > > Dale-- Luc Lalonde, analyste ----------------------------- Département de génie informatique: École polytechnique de MTL (514) 340-4711 x5049 Luc.Lalonde at polymtl.ca -----------------------------
Rowland Penny
2017-Apr-26 16:44 UTC
[Samba] Unable to add a particular member to group (Samba 4.6.3)
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
2017-Apr-26 18:25 UTC
[Samba] Unable to add a particular member to group (Samba 4.6.3)
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
-----------------------------
Possibly Parallel Threads
- Unable to add a particular member to group (Samba 4.6.3)
- Unable to add a particular member to group (Samba 4.6.3)
- Unable to add a particular member to group (Samba 4.6.3)
- Unable to add a particular member to group (Samba 4.6.3)
- Unable to add a particular member to group (Samba 4.6.3)