Author Topic: Samba groups are broken  (Read 4706 times)

Doug Clark

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +11/-1
    • View Profile
Samba groups are broken
« on: July 22, 2024, 12:53:55 am »
I am trying to get samba server 3.6.25 installed on a new machine.

I am getting the message

Samba groups are broken, only 0 instead of 9 groups found.


Any ideas for how to get past / fix this?

Thanks in advance

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1074
  • Karma: +27/-0
    • View Profile
    • Blonde Guy
Re: Samba groups are broken
« Reply #1 on: July 22, 2024, 02:56:47 am »
I'm interested in getting this working as well.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Doug Clark

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +11/-1
    • View Profile
Re: Samba groups are broken
« Reply #2 on: July 22, 2024, 05:57:08 am »
To expand on this:

I have Samba server 3.6.25 running on eComStation that runs pretty well.  I can connect to that machine from Win7, Win10, and various Macs.  In order to connect from Win10 I had to add a line to smb.conf
max protocol = SMB2.  Win10 was nice enough to tell me what the problem was.

I have tried installing 3.6.25 on AOS 5.1 using the *.wpi from the AOS ISO, and using the *.wpi from Netlabs. 

I get the error of "Samba groups are broken..." with either the *.wpi from the AOS  ISO or the *.wpi from Netlabs.  The version numbers of both say they are the same but it looks like there is a 5k difference in size - the one from the AOS ISO being larger.

If I had to guess I would guess that the problem is a difference in one or more of the unix-y DLLs and such between the two machines: AOS 5.1 and ECS 2.? beta

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: Samba groups are broken
« Reply #3 on: July 22, 2024, 06:38:16 am »
Doug, you might want to compare @unixroot/etc/group and @unixroot/etc/master.password between your AOS and eCS systems. Probably not the problem but easy to check.

Doug Clark

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +11/-1
    • View Profile
Re: Samba groups are broken
« Reply #4 on: July 22, 2024, 04:58:00 pm »
Dave,

I copied the group and master.password files from unixroot\etc on ECS to AOS machines.  Same problem.

Yesterday I tried copying the installed samba files from ECS to AOS machines - that didn't work out well.  Perhaps 'cause I didn't get all the locations?

Since both ECS and AOS machines are running WSeB, I tried mapping a drive letter on AOS machine to unixroot on ECS machine and changing UNIXROOT on the AOS machine to the mapped drive letter.  SMBUSERS.EXE complains that Samba isn't running - even though it is.

I also tried just ignoring the samba groups error and seeing if I could connect to Samba on the AOS machine from Win10.  Win10 says the server does not exist on the network.

I guess I COULD install ECS on a virtual machine running in the AOS machine and install Samba on that virtualized ECS system - but that seems ... clunky.

--- a haiku to Samba -----
Unix ported app
the serenity and love
does not fill my heart
------------------------------

edit: first line because unix turns out to be 2 syllables
« Last Edit: July 22, 2024, 06:05:34 pm by Doug Clark »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2289
  • Karma: +176/-0
    • View Profile
Re: Samba groups are broken
« Reply #5 on: July 22, 2024, 10:55:11 pm »
Check \etc\pwd.db & \etc\spwd.db - as I recall - these are the actual files used by libc to determine valid users/groups. master.passwd & group are just the human readable files that can be edited.

Doug Clark

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +11/-1
    • View Profile
Re: Samba groups are broken
« Reply #6 on: July 23, 2024, 06:23:29 pm »
Thanks Dave and Paul for your help.

I copied over the group and password files from the working ECS machine to the new AOS machine.  I can see the groups from the AOS machine in the Groups tab of the Local Samba Users and Groups application, so I know it is using the file I copied over.  But I still get the message
"Samba groups are broken, only 0 instead of 9 groups found"

When I select an entry in the Groups tab/page and click on Delete I get the message
"Lookup of 'Domain Enterprise Admins' failed
which is the group I selected to delete

If I try to add a new group I get the message
"Failed to add group 'NewTestGrp' with error: Access is denied"
and then
"Samba groups are broken, only 0 instead of 9 groups found"

'NewTestGrp' is the one I tried to add.

I can successully unmap a group without an error message.

The good news, for me at least, is that even though I get these error messages about the groups, I can still connect to the new Samba server running on AOS from other Windows machines (haven't tried connecting from any Macs yet)  So my workaround is making user/group changes on the ECS machine and copying the files to the AOS machine.  That probably is not a viable solution for Neil.

For anyone else installing the Samba server, I offer these suggestions.

1) For AOS users there is a Selective Install for Networking in the System - Install/Remove - folder.  Try that first.

Since I did not know that existed I installed samba.wpi from CID/serversamba.

If you install that it will complain about missing runtime libraries (Chris Wohlgemuth's and Dave Bolls, among others).
Those are contained in the file rxlib4smb.wpi.  However my version of that file installed the libraries in C:\ECS\DLL
Which is OK I guess as long as C:\ECS is on the libpath, but AOS users will probably want to copy the stuff rom C:\ECS to C:\SYS

Again - thanks Paul and Dave for your suggestions.  At least I now have a process for updating users and groups - clunky as that is.

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1074
  • Karma: +27/-0
    • View Profile
    • Blonde Guy
Re: Samba groups are broken
« Reply #7 on: July 24, 2024, 05:54:42 pm »
I am also using password files I created on eCS.

I found that almost all of the user and groups commands will fail.

smbpasswd.exe is called for many user create, edit and delete functions from Samba Users and Groups.

Things work better if I edit smb.conf and change some of the lines to use forward slashes instead of backward slashes.

Code: [Select]
add user script = E:/Programs/samba/usermod.cmd -a "%u"
rename user script = E:/Programs/samba/usermod.cmd -r "%uold" "%unew"
delete user script = E:/Programs/samba/usermod.cmd -x "%u"
add group script = E:/Programs/samba/groupmod.cmd -a "%g"
delete group script = E:/Programs/samba/groupmod.cmd -x "%g"
add user to group script = E:/Programs/samba/groupmod.cmd -j "%g" "%u"
delete user from group script = E:/Programs/samba/groupmod.cmd -l "%g" "%u"
set primary group script = E:/Programs/samba/usermod.cmd -p "%u" "%g"
add machine script = E:/Programs/samba/usermod.cmd -a "%u"

This should not be needed, of course. And groups still doesn't work. Maybe the answer is to move some functions back to an eCS virtual machine.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Steven Levine

  • Newbie
  • *
  • Posts: 48
  • Karma: +10/-0
    • View Profile
Re: Samba groups are broken
« Reply #8 on: July 26, 2024, 01:09:43 am »
If you want to debug this on your system, here are a couple of ideas in case you have not already tried them.

If you grab a copy of the smbusers sources from

  http://svn.netlabs.org/repos/samba/trunk/guitools/smbusers

you might find it easier to follow the code path

The message

  Samba groups are broken, only 0 instead of 9 groups found

is defined at

  guitools\smbusers\rc\lang\smbusers_en.mkm:129
  SMU0112I: Samba groups are broken, only %1 instead of %2 groups found.

and generated for display at

guitools\smbusers\SMBUSERS.VRX:1278
        Msg.Text = NLVGetMessage(112, gline.0, gname.0)

The 0 in gline.0 is the result of the output of the net rpc command invoked at:

guitools\smbusers\SMBUSERS.VRX:1231
    address cmd samba.!netexe' rpc group -l 'DebugLevel' 'UserCred' 1>'grouplistf' 2>'samba.!error

The code that follows parses the content of the "grouplistf" file and sets gline.0

The grouplistf file name is defined at

guitools\smbusers\SMBUSERS.VRX:1227
    grouplistf = TempDir'netgrouplist.txt'

The content of this file might give you some ideas as to what is not working correctly.  You are either getting no output from the net rpc command or output that the code does not understand.

If the file content is not helpful, mapping

    address cmd samba.!netexe' rpc group -l 'DebugLevel' 'UserCred' 1>'grouplistf' 2>'samba.!error

to something you can run from the command line might give you some useful information.  You can start with

  net rpc group -l

and add options as you go.

The samba.!error file might also contain some useful info.  The file is generated by:

guitools\shared\cltinit.vrs:205
    samba.!error = SysTempFileName(TempDir'smb_err.???')

so look for the newest smb_err.* file in your temp directory.