diff --git a/docs-xml/smbdotconf/security/syncmachinepasswordtokeytab.xml b/docs-xml/smbdotconf/security/syncmachinepasswordtokeytab.xml index 4cad9da73f2..f7dc30023d4 100644 --- a/docs-xml/smbdotconf/security/syncmachinepasswordtokeytab.xml +++ b/docs-xml/smbdotconf/security/syncmachinepasswordtokeytab.xml @@ -18,7 +18,11 @@ or by winbindd doing regular updates (see +If no value is present and is different from +'secrets only', the behavior differs between winbind and net utility: + + + + winbind uses value + /path/to/keytab:sync_spns:sync_kvno:machine_password + where the path to the keytab is obtained either from the krb5 library or from + . + + + + net changesecretpw -f command uses the default 'disabled' value. + + No other net subcommands use the 'disabled' value. + + + +If a single value 'disabled' is present, the synchronization process is +disabled. This is required for FreeIPA domain member setup where keytab +synchronization uses a protocol not implemented by Samba. diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c index 6ede567b75f..dbf8af44c1f 100644 --- a/source3/libads/kerberos_keytab.c +++ b/source3/libads/kerberos_keytab.c @@ -904,6 +904,11 @@ NTSTATUS sync_pw2keytabs(void) goto params_ready; } + if ((*lp_ptr != NULL) && strequal_m(*lp_ptr, "disabled")) { + DBG_DEBUG("'sync machine password to keytab' is explicitly disabled.\n"); + return NT_STATUS_OK; + } + line = lp_ptr; while (*line) { DBG_DEBUG("Scanning line: %s\n", *line); diff --git a/source3/utils/net.c b/source3/utils/net.c index 7b40d2bee95..c432ebe991f 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -207,6 +207,14 @@ static int net_changesecretpw(struct net_context *c, int argc, struct timeval tv = timeval_current(); NTTIME now = timeval_to_nttime(&tv); +#ifdef HAVE_ADS + if (USE_KERBEROS_KEYTAB) { + if (lp_sync_machine_password_to_keytab() == NULL) { + lp_do_parameter(-1, "sync machine password to keytab", "disabled"); + } + } +#endif + if (c->opt_stdin) { set_line_buffering(stdin); set_line_buffering(stdout); diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index e3ed336a79a..a31a7a8a30a 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -803,7 +803,8 @@ static int do_global_checks(void) "instead of 'kerberos method'.\n\n"); } - if (lp_ptr != NULL) { + if (lp_ptr != NULL && + ((*lp_ptr != NULL) && !strequal_m(*lp_ptr, "disabled"))) { while (*lp_ptr) { ret |= pw2kt_check_line(*lp_ptr++); }