Strategies to debug cpython modules during provision

William Brown william at blackhats.net.au
Tue Apr 10 01:05:27 UTC 2018


Hi,

I'm trying to start on some samba4 development. During the provision
process I have encountered an error:

Setting up sam.ldb users and groups
ERROR(ldb): uncaught exception - operations error at
../source4/dsdb/samdb/ldb_modules/password_hash.c:3144
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/netcmd/__init__.py", line 176, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/netcmd/domain.py", line 501, in run
    plaintext_secrets=plaintext_secrets)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/__init__.py", line 2267, in provision
    skip_sysvolacl=skip_sysvolacl)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/__init__.py", line 1866, in provision_fill
    next_rid=next_rid, dc_rid=dc_rid)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/__init__.py", line 1527, in fill_samdb
    }, controls=["relax:0", "provision:0"])
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/common.py", line 55, in setup_add_ldif
    ldb.add_ldif(data, controls)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/__init__.py", line 229, in add_ldif
    self.add(msg, controls)


Inspecting the code, I see this is from password_hash.c's call to
smb_krb5_init_context, and reading that code in
source4/auth/kerberos/krb5_init_context.c between smb_krb5_init_context
and smb_krb5_init_context_basic I can see some areas that *could* be
the cause of the issue with regard to the system krb5.conf from MIT vs
embedded heimdal.

However to be 100% sure, I would like to attach a debugger into this
process so that I can observe the error.

As I haven't debugging the samba-tool domain provision process before,
I would like to know if there is any advice on how to go about doing
this that could make my life a bit easier. Additionally, it would be
great to know how to "clean up" after a failed installation like this.

Thank you,

William Brown



More information about the samba-technical mailing list