srvsrvc: Reload conf after changing a share
authorVolker Lendecke <vl@samba.org>
Tue, 9 Mar 2021 07:50:26 +0000 (08:50 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 9 Mar 2021 22:36:28 +0000 (22:36 +0000)
The call to messaging_send_all() skips ourselves. This is tested in
source3/script/tests/test_rpcclientsrvsvc.sh, which right now we only
survive because the rpcclient call spawns a new smbd, which reloads
smb.conf. Once you start running srvsvcd in a long-running daemon,
this fails.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/srvsvc/srv_srvsvc_nt.c

index 474c0397ae6d56f2dab8f7e0644f2df7d70ffafc..8576e9d2ce24e1202ebe467dbff23c917ae3e1cf 100644 (file)
@@ -1958,6 +1958,8 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p,
 
                ret = smbrun(command, NULL, NULL);
                if (ret == 0) {
+                       reload_services(NULL, NULL, false);
+
                        /* Tell everyone we updated smb.conf. */
                        messaging_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED,
                                           NULL, 0);