[Samba] Compiling within Samba Source-Tree

Peter Koch sambamailinglist at gmail.com
Sun Oct 15 13:10:14 UTC 2023


Hi Ralph,

Thanks - you were absolutely right.

I added crypto to the list of the dependencies. Also I
removed all dependencies that I copied from the
smbpasswd-dependency-list besides smbconf and pdb.

Now the wscrip_build entry for my daemon is:

bld.SAMBA3_BINARY('smbscardd',
                  source='smbscardd.c',
                  deps='''
                  smbconf
                  pdb
                  crypto
                  ''')

I tried to do all the initialization that smbpasswd is doing
but I overlooked the first line in the main() routine of
smbpasswd.c:

/*********************************************************
  Start here.
**********************************************************/
int main(int argc, char **argv)
{
         TALLOC_CTX *frame = talloc_stackframe();
         int local_flags = 0;
         int ret;

So I added this line to my main() routine and the final result
is:

root at ns1:/var/tmp/samba-4.19.0# make
PYTHONHASHSEED=1 WAF_MAKE=1  ./buildtools/bin/waf build
Waf: Entering directory `/var/tmp/samba-4.19.0/bin/default'
         Selected embedded Heimdal build
[4229/4400] Compiling source3/utils/smbscardd.c
[4375/4400] Linking bin/default/source3/utils/smbscardd
Waf: Leaving directory `/var/tmp/samba-4.19.0/bin/default'
'build' finished successfully (15.537s)


Thanks again - I love this mailing list

Peter

Am 15.10.2023 um 14:38 schrieb Peter Koch:
> Hi Ralph,
>
> Thanks very much - I will try your suggestions and let you know
> wether that helped or not
>
> Peter
>
> Am 15.10.2023 um 14:33 schrieb Ralph Boehme:
>> On 10/14/23 23:43, Peter Koch via samba wrote:
>>> It must be possible to tell the build-system that smbscardd needs 
>>> -lcrypto
>>> Please let me know how.
>>
>> ./source3/wscript:    conf.CHECK_FUNCS_IN('DES_pcbc_encrypt', 'crypto')
>>
>> As we already seem to check for libcrypto and store the dependency, 
>> you should be able to just add crypto to your list of deps.
>>
>>> no talloc stackframe at 
>>> ../../source3/passdb/machine_account_secrets.c:60, leaking memory
>>>
>>> So here's my second question: How do I avoid this warning?
>>
>> I guess you're missing a
>>
>> TALLOC_CTX *frame = talloc_stackframe();
>>
>> in your initialisation.
>>
>> -slow
>>
>> -- 
>> Ralph Boehme, Samba Team         https://samba.org/
>> SerNet Samba Team Lead        https://sernet.de/en/
>> Worldwide Samba Support, Consulting and Development
>> SAMBA+ Samba packages           https://samba.plus/
>>



More information about the samba mailing list