Samba 4.x package support thread

Checking samba4-server alone is causing image to inflate by ~40 meg. See attached screenshot.
There is no sub-option available.

Thats weird are we really talking about the final compressed image size?
My own image for arm is always around 14-18MB with samba4 and a bunch of other stuff? So i can only assume "40 meg" is the uncompressed size? The official ipk is also 7.8MB?

If you see your compressed image grow by 40meg than something is wrong, try start with a fresh clean config and just add samba4-server as comparison.

Done that already. Still the same. And it started just a few builds back. Can you confirm current menuconfig is not bringing all those libraries in your case?

As noted those libs are needed now for samba-4.11 and replace some internal older libs. Yet those extra lib deps are 1-2MB ipk's and samba4-server + samba-libs is 7.8MB. So yes samba4 needs ~10MB total compressed space, but not 40MB. As noted i did test this version and my image is still under 20MB.

If you post your diffconfig i can try replicate your build myself, but can you also post your image file size + name?

Here is the diffconfig:
https://www.dropbox.com/s/bh3cejfekqdqr40/R7800-master-r11829-e3e939d8e6-20191229-2348.diffconfig?dl=1
Sysupgrade image name (63 511 KB):
R7800-master-r11829-e3e939d8e6-20191229-2348-sysupgrade.bin

You are aware that you build with debug enabled via CONFIG_DEBUG=y ?
This means the libs/bins will be bigger, since all debug symbols will be kept so you can potentially debug stuff.
Yet this is only a developer option to fix/check bugs/problems via debuging, so not sure why you have it enabled for your build?

Just disable/remove this option from your config and your sizes will be back to normal.

2 Likes

Good hint. That setting was also before and not causing such an issue that's why I didn't spot it. Anyway after disabling it sysupgrade image came back to reasonable 24 MB.
Thank you so much!

Yeah i guess its because i had to remove the default rstrip logic for the samba package, since it broke sambas private rpath.
I'm not sure why, but it seems the rstrip logic is still run even for a DEBUG=y build, which is odd since this actually breaks the ability to debug, by stripping the debug symbols? @diizzy @jow

The normal debug scenario is using gdb + gdbserver, and that works just fine with (r)stripped executables since the symbols are looked up in the corresponding unstripped buildroot executable while the remote debug target runs stripped executables under gdbserver.

2 Likes

anyone having problems building samba4 today or it's just me?
yesterday i could build a r12157 with samba4 with no problems at all, but this morning i get compile errors..

Just updated and builds fine for me from master.

mistery for me, but i had this error starting from this morning:

Package samba4-libs is missing dependencies for the following libraries:
libpam.so.0

i had to add libpam to the build.

Yeah this happens with "unclean" builds, there is actually +PACKAGE_libpam:libpam in the makefile. The problem is if some package build libpam and you later deselect the package, the actual build libs will still be in stageing. So building from a clean checkout or a make distclean should do the trick.

PS: In short if you can find libpam in stageing, than the config should also have a PACKAGE_libpam entry. Otherwise its a leftover form some earlier build.

Is it possible to add support for older devices? I have several older devices at home that doesn't work with samba4. They can't authenticate. I tried:

ntlm auth = yes

But it doesn't work.

Logging from device:

[2020/02/02 20:55:02.633195,  3] ../../source3/smbd/process.c:1956(process_smb)
  Transaction 0 of length 194 (0 toread)
[2020/02/02 20:55:02.633385,  3] ../../source3/smbd/process.c:1549(switch_message)
  switch message SMBnegprot (pid 26385) conn 0x0
[2020/02/02 20:55:02.633709,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [PC NETWORK PROGRAM 1.0]
[2020/02/02 20:55:02.633824,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [MICROSOFT NETWORKS 1.03]
[2020/02/02 20:55:02.633921,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [MICROSOFT NETWORKS 3.0]
[2020/02/02 20:55:02.634010,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [LANMAN1.0]
[2020/02/02 20:55:02.634098,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [LM1.2X002]
[2020/02/02 20:55:02.634187,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [DOS LANMAN2.1]
[2020/02/02 20:55:02.634275,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [LANMAN2.1]
[2020/02/02 20:55:02.634361,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [Samba]
[2020/02/02 20:55:02.634448,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [NT LANMAN 1.0]
[2020/02/02 20:55:02.634538,  3] ../../source3/smbd/negprot.c:637(reply_negprot)
  Requested protocol [NT LM 0.12]
[2020/02/02 20:55:02.634851,  3] ../../source3/smbd/negprot.c:757(reply_negprot)
  reply_negprot: No protocol supported !
[2020/02/02 20:55:02.635569,  3] ../../source3/smbd/server_exit.c:244(exit_server_common)
  Server exit (no protocol supported)

There is nothing compiled out, so with the same settings samba4 should work as samba3. I can't list the default changes off the top of my head, but check the smb.conf help.

Maybe I did something wrong, I'll give it another try in a few days...

OK, I found a solution. I also had to set:

server min protocol = NT1

to get it to work

Apparently, the default settings in samba4 are not the same as the default settings mentioned in smb.conf help. Default in samba4 is 'SMB2_02', and default according to help is 'LANMAN1'.

Thanks, case closed.

For the community it is good to know that this could be a problem when switching from samba3 to samba4.

Yes i had a request for the old protocols for ksmbd as well, so maybe i will just add a UCI/Luci setting like "Allow Legacy/insecure smb1 protocol" and make the associated changes on daemon startup, so users don't have to dig through this. Seems many embedded/iot devices still rely on smbv1.

1 Like

Or you can add this to the default smb.conf.template:

##Allow Legacy/insecure smb1 protocol
#server min protocol = NT1
#ntlm auth = ntlmv1-permitted

Maybe it is also a good idea to add a "Running config" tab in Luci, with output from 'testparm -sv'.