From d7e79460dd126ec68f54e83c755f709b1615b6b6 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 1 Jan 2016 22:00:46 -0500 Subject: [PATCH] When deleting a room, delete its netconfig configdb entry instead of the netconfig file --- citadel/config.h | 1 + citadel/room_ops.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/citadel/config.h b/citadel/config.h index 999fe7e76..8419a8c79 100644 --- a/citadel/config.h +++ b/citadel/config.h @@ -117,3 +117,4 @@ void CtdlDelConfig(char *key); char *CtdlGetSysConfig(char *sysconfname); void CtdlPutSysConfig(char *sysconfname, char *sysconfdata); void validate_config(void); +void netcfg_keyname(char *, long); diff --git a/citadel/room_ops.c b/citadel/room_ops.c index abd5e14b1..f616d7e74 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -1132,6 +1132,7 @@ void CtdlDeleteRoom(struct ctdlroom *qrbuf) { struct floor flbuf; char filename[PATH_MAX]; + char configdbkeyname[25]; syslog(LOG_NOTICE, "Deleting room <%s>", qrbuf->QRname); @@ -1143,9 +1144,9 @@ void CtdlDeleteRoom(struct ctdlroom *qrbuf) assoc_file_name(filename, sizeof filename, qrbuf, ctdl_image_dir); unlink(filename); - /* Delete the room's network config file */ - assoc_file_name(filename, sizeof filename, qrbuf, ctdl_netcfg_dir); - unlink(filename); + /* Delete the room's network configdb entry */ + netcfg_keyname(configdbkeyname, qrbuf->QRnumber); + CtdlDelConfig(configdbkeyname); /* Delete the messages in the room * (Careful: this opens an S_ROOMS critical section!) @@ -1167,7 +1168,6 @@ void CtdlDeleteRoom(struct ctdlroom *qrbuf) } - /* * Check access control for deleting a room */ -- 2.30.2