diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /source4/scripting/bin/machineaccountccache | |
parent | Initial commit. (diff) | |
download | samba-4f5791ebd03eaec1c7da0865a383175b05102712.tar.xz samba-4f5791ebd03eaec1c7da0865a383175b05102712.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | source4/scripting/bin/machineaccountccache | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source4/scripting/bin/machineaccountccache b/source4/scripting/bin/machineaccountccache new file mode 100755 index 0000000..5e6d3c5 --- /dev/null +++ b/source4/scripting/bin/machineaccountccache @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +import optparse +import sys + +# Find right directory when running from source tree +sys.path.insert(0, "bin/python") + + +import samba +from samba import getopt as options +from samba.credentials import Credentials +parser = optparse.OptionParser("machineaccountccache <ccache name>") +sambaopts = options.SambaOptions(parser) +parser.add_option_group(sambaopts) +parser.add_option_group(options.VersionOptions(parser)) +opts, args = parser.parse_args() + +if len(args) != 1: + parser.print_usage() + sys.exit(1) + +ccachename = args[0] + +lp_ctx = sambaopts.get_loadparm() + +creds = Credentials() + +creds.guess(lp_ctx) +creds.set_machine_account(lp_ctx) +creds.get_named_ccache(lp_ctx, ccachename) |