return arcfour_crypt_blob(data, key)
+def enable_net_export_keytab():
+ """This function modifies the samba.net.Net class to contain
+ an export_keytab() method."""
+ # This looks very strange because it is.
+ #
+ # The dckeytab modules contains nothing, but the act of importing
+ # it pushes a method into samba.net.Net. It ended up this way
+ # because Net.export_keytab() only works on Heimdal builds, and
+ # people sometimes want to compile Samba without Heimdal while
+ # still having a working samba-tool.
+ #
+ # There is probably a better way to do this than a magic module
+ # import (yes, that's a FIXME if you can be bothered).
+ from samba import net
+ from samba import dckeytab
+
+
version = _glue.version
interface_ips = _glue.interface_ips
fault_setup = _glue.fault_setup
from samba import werror
from getpass import getpass
from samba.net import Net, LIBNET_JOIN_AUTOMATIC
+from samba import enable_net_export_keytab
import samba.ntacls
from samba.join import join_RODC, join_DC
from samba.auth import system_session
try:
- import samba.dckeytab
+ enable_net_export_keytab()
except ImportError:
cmd_domain_export_keytab = None
else:
import sys
import string
from samba.net import Net
-import samba.dckeytab
+from samba import enable_net_export_keytab
+
from samba import tests
from samba.param import LoadParm
+enable_net_export_keytab()
+
+
def open_bytes(filename):
if sys.version_info[0] == 3:
return open(filename, errors='ignore')