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 -----------------------------
Luc Lalonde
2017-Apr-28 13:41 UTC
[Samba] Unable to add a particular member to group (Samba 4.6.3)
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 -----------------------------
Rowland Penny
2017-Apr-28 14:04 UTC
[Samba] Unable to add a particular member to group (Samba 4.6.3)
On Fri, 28 Apr 2017 09:41:31 -0400 Luc Lalonde <Luc.Lalonde at polymtl.ca> wrote:> 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. >Yes and to confirm it, I just did it again: samba-tool user create User2 passw2rd* --given-name=Jane --surname=Doe User 'User2' created successfully samba-tool user delete User2 Deleted user User2 samba-tool user create User2 passw2rd* --given-name=Jane --surname=Doe User 'User2' created successfully samba-tool group addmembers wingroup User2 Added members to group wingroup dn: CN=wingroup,CN=Users,DC=testing,DC=tld objectClass: top objectClass: group cn: wingroup instanceType: 4 whenCreated: 20170428115757.0Z uSNCreated: 3776 name: wingroup objectGUID: 251d7f63-0da9-4c4f-b4fc-4419c565318d objectSid: S-1-5-21-1674337020-2794997694-142666819-1103 sAMAccountName: wingroup sAMAccountType: 268435456 groupType: -2147483646 objectCategory: CN=Group,CN=Schema,CN=Configuration,DC=testing,DC=tld member: CN=Jane Doe,CN=Users,DC=testing,DC=tld whenChanged: 20170428135214.0Z uSNChanged: 3792 distinguishedName: CN=wingroup,CN=Users,DC=testing,DC=tld I cannot confirm your problem, I can create a user and add it to a group, I even tried it with the username that doesn't work for you and it worked for me. I am beginning to think it might be easier to get your user to change their name ;-) I think it may be a locale problem, what locale are you using ? Rowland
Reasonably Related 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)