init_srv_share_info2_str(&sh2->info_2_str, net_name, remark, path, passwd);
}
+/*******************************************************************
+ What to do when smb.conf is updated.
+ ********************************************************************/
+
+static void smb_conf_updated(int msg_type, pid_t src, void *buf, size_t len)
+{
+ DEBUG(10,("smb_conf_updated: Got message saying smb.conf was updated. Reloading.\n"));
+ reload_services(False);
+}
+
/*******************************************************************
Create the share security tdb.
********************************************************************/
tdb_store_int(share_tdb, vstring, SHARE_DATABASE_VERSION);
}
tdb_unlock_bystring(share_tdb, vstring);
+
+ message_register(MSG_SMB_CONF_UPDATED, smb_conf_updated);
return True;
}
return ERROR_ACCESS_DENIED;
}
- /* Send SIGHUP to process group. */
- kill(0, SIGHUP);
+ /* Tell everyone we updated smb.conf. */
+ message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False);
+
} else {
DEBUG(10,("_srv_net_share_set_info: No change to share name (%s)\n", share_name ));
}
share_name ));
}
- /* Send SIGHUP to process group. */
- kill(0, SIGHUP);
+ /* Tell everyone we updated smb.conf. */
+ message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False);
/*
- * We don't call reload_services() here, the SIGHUP will
+ * We don't call reload_services() here, the message will
* cause this to be done before the next packet is read
* from the client. JRA.
*/
/* Delete the SD in the database. */
delete_share_security(snum);
- /* Send SIGHUP to process group. */
- kill(0, SIGHUP);
+ /* Tell everyone we updated smb.conf. */
+ message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False);
lp_killservice(snum);