diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-02-04 07:17:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:31 -0500 |
commit | 744dddd75be73e4e883241b808b37a12a7a39ac1 (patch) | |
tree | be0695eb7e6692452f515395663edb63df52d56e /source4/scripting | |
parent | 627595b7a3c91d02fe8a29737beb77b2a4c4ae0f (diff) | |
download | samba-744dddd75be73e4e883241b808b37a12a7a39ac1.tar.gz samba-744dddd75be73e4e883241b808b37a12a7a39ac1.tar.bz2 samba-744dddd75be73e4e883241b808b37a12a7a39ac1.zip |
r21135: Instead of having hooks to update keytabs as an explicit thing, update
them as a hook on ldb modify, via a module.
This should allow the secrets.ldb to be edited by the admin, and to
have things update in the on-disk keytab just as an in-memory keytab
would.
This isn't really a dsdb plugin, but I don't have any other good ideas
about where to put it.
Andrew Bartlett
(This used to be commit 6ce557a1aff4754d2622be8f1c6695d9ee788d54)
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/ejs/smbcalls_creds.c | 12 | ||||
-rw-r--r-- | source4/scripting/libjs/provision.js | 17 |
2 files changed, 6 insertions, 23 deletions
diff --git a/source4/scripting/ejs/smbcalls_creds.c b/source4/scripting/ejs/smbcalls_creds.c index c6ad64933b..6e2c87a9b3 100644 --- a/source4/scripting/ejs/smbcalls_creds.c +++ b/source4/scripting/ejs/smbcalls_creds.c @@ -266,23 +266,11 @@ 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 */ 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); } diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index 3e409c0dfb..23f26a6b86 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -488,16 +488,14 @@ function provision_become_dc(subobj, message, paths, session_info) assert(ok); message("Setting up " + paths.secrets + "\n"); - setup_ldb("secrets.ldif", info, paths.secrets); + setup_ldb("secrets_init.ldif", info, paths.secrets); + + setup_ldb("secrets.ldif", info, paths.secrets, false); tmp = lp.get("secrets database"); ok = lp.set("secrets database", paths.secrets); assert(ok); - message("Setting up keytabs\n"); - var keytab_ok = credentials_update_all_keytabs(); - assert(keytab_ok); - ok = lp.set("secrets database", tmp); assert(ok); @@ -547,12 +545,9 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda setup_ldb("share.ldif", info, paths.shareconf); } - message("Setting up secrets.ldb\n"); - setup_ldb("secrets.ldif", info, paths.secrets); - - message("Setting up keytabs\n"); - var keytab_ok = credentials_update_all_keytabs(); - assert(keytab_ok); + message("Setting up " + paths.secrets + "\n"); + setup_ldb("secrets_init.ldif", info, paths.secrets); + setup_ldb("secrets.ldif", info, paths.secrets, false); message("Setting up hklm.ldb\n"); setup_ldb("hklm.ldif", info, paths.hklm); |