samba shares access issue in Solaris from a MT program

Richard Sharpe rsharpe at richardsharpe.com
Fri Sep 24 16:24:16 GMT 2004


On Fri, 24 Sep 2004, Narayana Pattipati wrote:

[Nice description of problem redacted.]

> If samba is build with "-mt" flags, then the errno will be pointed
> to __errno() macro, instead of global errno, and thread executing samba
> code will be able to access correct errno.
>
> I have few open questions based on this:
> a) I read from samba site that its not MT safe. But since the code runs in
>    one thread only, is it OK to build samba with "-mt" compiler flags ?
>    What would be the side effects if samba is build with -mt compiler
>    flags ?

I cannot see any problems with this, off my head.

> b) One workaround to fix this issue is to define errno as __errno() in the
>    file samba/sources/lib/util_sock.c file. Again what would be the side
>    affects of this change ?

I doubt that this will happen. This code is deep in Samba 3 and we do not
want to disturb it.

> c) There is a mention that in samba 4.0.0, the libraries will be made
>    thread compliant so that they can be called from MT applications.
>    Is that correct ? If so, what would be the time frame for samba 4
>    release.

There are two issues here:

1. Any Samba 4 release might not happen for a year yet.

2. Libsmbclient will then have to be ported over to Samba 4 and possibly
made thread safe or reentrant or both.

Regards
-----
Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org,
sharpe[at]ethereal.com, http://www.richardsharpe.com


More information about the samba-technical mailing list