[Samba] Semantics of "smb ports = 0"

Nikolaus Rath Nikolaus at rath.org
Fri Apr 27 08:56:59 MDT 2012

On 04/26/2012 09:13 PM, Jeremy Allison wrote:
> On Wed, Apr 25, 2012 at 10:04:30AM -0400, Nikolaus Rath wrote:
>> Hello,
>> The qemu emulator has a feature to fork a samba instance for file
>> sharing with the emulated hosts. It communicates with smbd over stdin.
>> The generated configuration file contains a "smb ports = 0" directive to
>> prevent smbd from listening to any ports.
>> Unfortunately, with at least Samba 3.6.4 this causes a segfault
>> instead:
>> [0] vostro:/tmp/qemu-smb.6836-0# smbd -i -s smb.conf
>> Unable to setup corepath for smbd: Operation not permitted
>> smbd version 3.6.4 started.
>> Copyright Andrew Tridgell and the Samba Team 1992-2011
>> open_sockets_smbd: No sockets available to bind to.
>> ===============================================================
>> Abnormal server exit: open_sockets_smbd() failed
>> ===============================================================
>> BACKTRACE: 6 stack frames:
>>  #0 smbd(log_stack_trace+0x1a) [0x7fe50c14f8ba]
>>  #1 smbd(+0x6a0743) [0x7fe50c3bd743]
>>  #2 smbd(+0x6a0a41) [0x7fe50c3bda41]
>>  #3 smbd(main+0xa52) [0x7fe50be26d42]
>>  #4 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7fe508ac0ead]
>>  #5 smbd(+0x10a6b9) [0x7fe50be276b9]
>> Also, there is some confusion as to whether this option was actually
>> ever necessary.
>> Could someone clarify if something like this is still needed, or if
>> Samba does the right think automatically? In the later case, has this
>> always been the case or was it introduced in a specific version (and the
>> "smb ports = 0" required before)?
> In fack looking at the current code in v3-6-test, so long as
> you ensure that you run without the '-D' (deamonize) option,
> and fd 0 is a socket (we use getsockopt(fd, SOL_SOCKET, SO_TYPE...)
> to detect this) then we'll go into 'inetd' mode, which I
> think is what you want.

Yes. I am just wondering if this has always been the case, or if this is
a recent feature and smb ports = 0 may have been required in earlier



 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C

More information about the samba mailing list