From b0b857d6ca842fb516b3330a11e0d6d78f35aded Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 26 Feb 2010 17:09:35 +1100 Subject: s4-dns: use a loadparm list for samba_runcmd() commands This allows commands with multiple arguments and quoting to be used, while still avoiding running a shell (and this having shell expansion problems) --- source4/param/loadparm.c | 12 ++++++------ source4/param/param.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'source4/param') diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 5eaf67fab5..46bbceb862 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -186,8 +186,8 @@ struct loadparm_global int bDisableNetbios; int bRpcBigEndian; char *szNTPSignDSocketDirectory; - char *szRNDCCommand; - char *szDNSUpdateCommand; + const char **szRNDCCommand; + const char **szDNSUpdateCommand; char *szNSUpdateCommand; struct parmlist_entry *param_opt; }; @@ -506,8 +506,8 @@ static struct parm_struct parm_table[] = { {"idmap trusted only", P_BOOL, P_GLOBAL, GLOBAL_VAR(bIdmapTrustedOnly), NULL, NULL}, {"ntp signd socket directory", P_STRING, P_GLOBAL, GLOBAL_VAR(szNTPSignDSocketDirectory), NULL, NULL }, - {"rndc command", P_STRING, P_GLOBAL, GLOBAL_VAR(szRNDCCommand), NULL, NULL }, - {"dns update command", P_STRING, P_GLOBAL, GLOBAL_VAR(szDNSUpdateCommand), NULL, NULL }, + {"rndc command", P_LIST, P_GLOBAL, GLOBAL_VAR(szRNDCCommand), NULL, NULL }, + {"dns update command", P_LIST, P_GLOBAL, GLOBAL_VAR(szDNSUpdateCommand), NULL, NULL }, {"nsupdate command", P_STRING, P_GLOBAL, GLOBAL_VAR(szNSUpdateCommand), NULL, NULL }, {NULL, P_BOOL, P_NONE, 0, NULL, NULL} @@ -660,8 +660,8 @@ _PUBLIC_ FN_GLOBAL_STRING(lp_dos_charset, dos_charset) _PUBLIC_ FN_GLOBAL_STRING(lp_unix_charset, unix_charset) _PUBLIC_ FN_GLOBAL_STRING(lp_display_charset, display_charset) _PUBLIC_ FN_GLOBAL_STRING(lp_piddir, szPidDir) -_PUBLIC_ FN_GLOBAL_STRING(lp_rndc_command, szRNDCCommand) -_PUBLIC_ FN_GLOBAL_STRING(lp_dns_update_command, szDNSUpdateCommand) +_PUBLIC_ FN_GLOBAL_LIST(lp_rndc_command, szRNDCCommand) +_PUBLIC_ FN_GLOBAL_LIST(lp_dns_update_command, szDNSUpdateCommand) _PUBLIC_ FN_GLOBAL_STRING(lp_nsupdate_command, szNSUpdateCommand) _PUBLIC_ FN_GLOBAL_LIST(lp_dcerpc_endpoint_servers, dcerpc_ep_servers) _PUBLIC_ FN_GLOBAL_LIST(lp_server_services, server_services) diff --git a/source4/param/param.h b/source4/param/param.h index 4ac7eef0f1..f72fa76174 100644 --- a/source4/param/param.h +++ b/source4/param/param.h @@ -130,8 +130,8 @@ const char **lp_wins_server_list(struct loadparm_context *); const char **lp_interfaces(struct loadparm_context *); const char *lp_socket_address(struct loadparm_context *); const char **lp_netbios_aliases(struct loadparm_context *); -const char *lp_rndc_command(struct loadparm_context *); -const char *lp_dns_update_command(struct loadparm_context *); +const char **lp_rndc_command(struct loadparm_context *); +const char **lp_dns_update_command(struct loadparm_context *); bool lp_disable_netbios(struct loadparm_context *); bool lp_wins_support(struct loadparm_context *); bool lp_wins_dns_proxy(struct loadparm_context *); -- cgit