From: Art Cancro Date: Sat, 2 Jan 2016 03:00:46 +0000 (-0500) Subject: When deleting a room, delete its netconfig configdb entry instead of the netconfig... X-Git-Tag: Release_902~89 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=d7e79460dd126ec68f54e83c755f709b1615b6b6 When deleting a room, delete its netconfig configdb entry instead of the netconfig file --- 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 */