diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-12-01 05:20:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:46:56 -0500 |
commit | 9c6b7f2d62e134a4bc15efc04e05be25e4a53dc7 (patch) | |
tree | 8ef389a528fdc2caca79f279c086b4f8bea7afeb /source4/scripting/ejs | |
parent | 22f1de0998ee34be4c032b16e4a6d30c9f8e6b85 (diff) | |
download | samba-9c6b7f2d62e134a4bc15efc04e05be25e4a53dc7.tar.gz samba-9c6b7f2d62e134a4bc15efc04e05be25e4a53dc7.tar.bz2 samba-9c6b7f2d62e134a4bc15efc04e05be25e4a53dc7.zip |
r11995: A big kerberos-related update.
This merges Samba4 up to current lorikeet-heimdal, which includes a
replacement for some Samba-specific hacks.
In particular, the credentials system now supplies GSS client and
server credentials. These are imported into GSS with
gss_krb5_import_creds(). Unfortunetly this can't take an MEMORY
keytab, so we now create a FILE based keytab as provision and join
time.
Because the keytab is now created in advance, we don't spend .4s at
negprot doing sha1 s2k calls. Also, because the keytab is read in
real time, any change in the server key will be correctly picked up by
the the krb5 code.
To mark entries in the secrets which should be exported to a keytab,
there is a new kerberosSecret objectClass. The new routine
cli_credentials_update_all_keytabs() searches for these, and updates
the keytabs.
This is called in the provision.js via the ejs wrapper
credentials_update_all_keytabs().
We can now (in theory) use a system-provided /etc/krb5.keytab, if
krb5Keytab: FILE:/etc/krb5.keytab
is added to the secrets.ldb record. By default the attribute
privateKeytab: secrets.keytab
is set, pointing to allow the whole private directory to be moved
without breaking the internal links.
(This used to be commit 6b75573df49c6210e1b9d71e108a9490976bd41d)
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r-- | source4/scripting/ejs/smbcalls_creds.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/scripting/ejs/smbcalls_creds.c b/source4/scripting/ejs/smbcalls_creds.c index cc2ccf8c47..3cd554b957 100644 --- a/source4/scripting/ejs/smbcalls_creds.c +++ b/source4/scripting/ejs/smbcalls_creds.c @@ -240,6 +240,16 @@ int ejs_credentials_cmdline(int eid, int argc, struct MprVar **argv) return ejs_credentials_obj(obj, cmdline_credentials); } +static int ejs_credentials_update_all_keytabs(MprVarHandle eid, int argc, struct MprVar **argv) +{ + if (!NT_STATUS_IS_OK(cli_credentials_update_all_keytabs(mprMemCtx()))) { + mpr_Return(eid, mprCreateBoolVar(False)); + } else { + mpr_Return(eid, mprCreateBoolVar(True)); + } + return 0; +} + /* setup C functions that be called from ejs @@ -247,4 +257,6 @@ int ejs_credentials_cmdline(int eid, int argc, struct MprVar **argv) void smb_setup_ejs_credentials(void) { ejsDefineCFunction(-1, "credentials_init", ejs_credentials_init, NULL, MPR_VAR_SCRIPT_HANDLE); + ejsDefineCFunction(-1, "credentials_update_all_keytabs", ejs_credentials_update_all_keytabs, NULL, MPR_VAR_SCRIPT_HANDLE); } + |