From 6d2e796f35dea93ca31e6879e79942a02572754d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 18 May 2010 22:07:48 +1000 Subject: s3:param Add helper function to get at Gobals.iDomainMaster This is needed for a future split out of the server_role code. Andrew Bartlett Signed-off-by: Stefan Metzmacher --- source3/include/proto.h | 1 + source3/param/loadparm.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'source3') diff --git a/source3/include/proto.h b/source3/include/proto.h index 237772e9bd..7af8035126 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4283,6 +4283,7 @@ struct share_params *snum2params_static(int snum); const char *volume_label(int snum); int lp_server_role(void); bool lp_domain_master(void); +bool lp_domain_master_true_or_auto(void); bool lp_preferred_master(void); void lp_remove_service(int snum); void lp_copy_service(int snum, const char *new_name); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2d389d4fa6..09d89f5d7f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -9690,6 +9690,18 @@ bool lp_domain_master(void) return (bool)Globals.iDomainMaster; } +/*********************************************************** + If we are PDC then prefer us as DMB +************************************************************/ + +bool lp_domain_master_true_or_auto(void) +{ + if (Globals.iDomainMaster) /* auto or yes */ + return true; + + return false; +} + /*********************************************************** If we are DMB then prefer us as LMB ************************************************************/ -- cgit