summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cabrero <scabrero@samba.org>2022-03-02 18:16:51 +0100
committerJeremy Allison <jra@samba.org>2022-04-08 20:13:37 +0000
commit11d0266c7431f0602c83fbfac1160c41c22ae085 (patch)
tree6d10aef1b587ae57b6757d384e8e1808afd0663a
parentd41698169d9eb13e74184a1c4a8804c68c5d8dbb (diff)
downloadsamba-11d0266c7431f0602c83fbfac1160c41c22ae085.tar.gz
s3:winbind: Move servide reload related functions to winbindd-lib subsystem
The source3/winbindd/winbindd.c file does not belong to 'winbindd-lib' subsystem. Funtions called from winbindd-lib must be part of it. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/winbindd/winbindd.c60
-rw-r--r--source3/winbindd/winbindd_misc.c60
2 files changed, 60 insertions, 60 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index e93e7114d93..088773b6b4c 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -60,42 +60,11 @@
static bool client_is_idle(struct winbindd_cli_state *state);
static void remove_client(struct winbindd_cli_state *state);
-static void winbindd_setup_max_fds(void);
static bool interactive = False;
/* Reload configuration */
-bool winbindd_reload_services_file(const char *lfile)
-{
- const struct loadparm_substitution *lp_sub =
- loadparm_s3_global_substitution();
- bool ret;
-
- if (lp_loaded()) {
- char *fname = lp_next_configfile(talloc_tos(), lp_sub);
-
- if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
- set_dyn_CONFIGFILE(fname);
- }
- TALLOC_FREE(fname);
- }
-
- reopen_logs();
- ret = lp_load_global(get_dyn_CONFIGFILE());
-
- /* if this is a child, restore the logfile to the special
- name - <domain>, idmap, etc. */
- if (lfile && *lfile) {
- lp_set_logfile(lfile);
- }
-
- reopen_logs();
- load_interfaces();
- winbindd_setup_max_fds();
-
- return(ret);
-}
static void winbindd_status(void)
@@ -1208,35 +1177,6 @@ static void winbindd_listen_fde_handler(struct tevent_context *ev,
* Winbindd socket accessor functions
*/
-static void winbindd_setup_max_fds(void)
-{
- int num_fds = MAX_OPEN_FUDGEFACTOR;
- int actual_fds;
-
- num_fds += lp_winbind_max_clients();
- /* Add some more to account for 2 sockets open
- when the client transitions from unprivileged
- to privileged socket
- */
- num_fds += lp_winbind_max_clients() / 10;
-
- /* Add one socket per child process
- (yeah there are child processes other than the
- domain children but only domain children can vary
- with configuration
- */
- num_fds += lp_winbind_max_domain_connections() *
- (lp_allow_trusted_domains() ? WINBIND_MAX_DOMAINS_HINT : 1);
-
- actual_fds = set_maxfiles(num_fds);
-
- if (actual_fds < num_fds) {
- DEBUG(1, ("winbindd_setup_max_fds: Information only: "
- "requested %d open files, %d are available.\n",
- num_fds, actual_fds));
- }
-}
-
static bool winbindd_setup_listeners(void)
{
struct winbindd_listen_state *pub_state = NULL;
diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c
index f8173f19a4f..3155a2224de 100644
--- a/source3/winbindd/winbindd_misc.c
+++ b/source3/winbindd/winbindd_misc.c
@@ -415,3 +415,63 @@ bool winbindd_priv_pipe_dir(struct winbindd_cli_state *state)
return true;
}
+
+static void winbindd_setup_max_fds(void)
+{
+ int num_fds = MAX_OPEN_FUDGEFACTOR;
+ int actual_fds;
+
+ num_fds += lp_winbind_max_clients();
+ /* Add some more to account for 2 sockets open
+ when the client transitions from unprivileged
+ to privileged socket
+ */
+ num_fds += lp_winbind_max_clients() / 10;
+
+ /* Add one socket per child process
+ (yeah there are child processes other than the
+ domain children but only domain children can vary
+ with configuration
+ */
+ num_fds += lp_winbind_max_domain_connections() *
+ (lp_allow_trusted_domains() ? WINBIND_MAX_DOMAINS_HINT : 1);
+
+ actual_fds = set_maxfiles(num_fds);
+
+ if (actual_fds < num_fds) {
+ DEBUG(1, ("winbindd_setup_max_fds: Information only: "
+ "requested %d open files, %d are available.\n",
+ num_fds, actual_fds));
+ }
+}
+
+bool winbindd_reload_services_file(const char *lfile)
+{
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ bool ret;
+
+ if (lp_loaded()) {
+ char *fname = lp_next_configfile(talloc_tos(), lp_sub);
+
+ if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
+ set_dyn_CONFIGFILE(fname);
+ }
+ TALLOC_FREE(fname);
+ }
+
+ reopen_logs();
+ ret = lp_load_global(get_dyn_CONFIGFILE());
+
+ /* if this is a child, restore the logfile to the special
+ name - <domain>, idmap, etc. */
+ if (lfile && *lfile) {
+ lp_set_logfile(lfile);
+ }
+
+ reopen_logs();
+ load_interfaces();
+ winbindd_setup_max_fds();
+
+ return(ret);
+}