From 7202fdfff37c9518ff93bb65fd8d85956316ee71 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 31 Jul 2021 15:06:10 -0400 Subject: [PATCH] misc cleanup --- citadel/citadel.h | 45 +++++------------ citadel/citadel_ldap.h | 24 ++++----- citadel/citserver.h | 23 ++++----- citadel/clientsocket.h | 24 ++++----- citadel/config.h | 69 ++++++++++++-------------- citadel/modules/listsub/serv_listsub.c | 1 - citadel/room_ops.h | 13 ++--- citadel/sysconfig.h | 32 +++++------- 8 files changed, 92 insertions(+), 139 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index 35237621b..6561315b9 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -1,16 +1,14 @@ -/* - * Main Citadel header file - * - * Copyright (c) 1987-2021 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Main Citadel header file +// +// Copyright (c) 1987-2021 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. /* system customizations are in sysconfig.h */ @@ -74,23 +72,6 @@ struct ExpirePolicy { #define EXPIRE_AGE 3 // Expire messages after n days -/* - * This struct stores a list of rooms with new messages which the client - * fetches from the server. This allows the client to "march" through - * relevant rooms without having to ask the server each time where to go next. - */ -typedef struct march march; -struct march { - struct march *next; - char march_name[ROOMNAMELEN]; - unsigned int march_flags; - char march_floor; - char march_order; - unsigned int march_flags2; - int march_access; -}; - - /* * User records. */ @@ -191,8 +172,8 @@ struct floor { */ #define AUTHMODE_NATIVE 0 // Native (self-contained or "black box") #define AUTHMODE_HOST 1 // Authenticate against the host OS user database -#define AUTHMODE_LDAP 2 // Authenticate against an LDAP server with RFC 2307 schema -#define AUTHMODE_LDAP_AD 3 // Authenticate against non-standard MS Active Directory LDAP +#define AUTHMODE_LDAP 2 // Authenticate using LDAP server with RFC 2307 schema +#define AUTHMODE_LDAP_AD 3 // Authenticate using LDAP server with Active Directory schema #ifdef __cplusplus } diff --git a/citadel/citadel_ldap.h b/citadel/citadel_ldap.h index b1305b83c..926fbde56 100644 --- a/citadel/citadel_ldap.h +++ b/citadel/citadel_ldap.h @@ -1,16 +1,14 @@ -/* - * Configuration for LDAP authentication. Most of this stuff gets pulled out of our site config file. - * - * Copyright (c) 1987-2017 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Configuration for LDAP authentication. Most of this stuff gets pulled out of our site config file. +// +// Copyright (c) 1987-2017 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. int CtdlTryUserLDAP(char *username, char *found_dn, int found_dn_size, char *fullname, int fullname_size, uid_t *found_uid); int CtdlTryPasswordLDAP(char *user_dn, const char *password); diff --git a/citadel/citserver.h b/citadel/citserver.h index adfe476c1..effe9557a 100644 --- a/citadel/citserver.h +++ b/citadel/citserver.h @@ -1,14 +1,12 @@ -/* - * Copyright (c) 1987-2019 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Copyright (c) 1987-2019 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. /* I fucking hate const and want it to die. */ #pragma GCC diagnostic ignored "-Wcast-qual" @@ -44,10 +42,9 @@ void do_async_loop(void); void begin_session(struct CitContext *con); void citproto_begin_session(void); void citproto_begin_admin_session(void); - void help_subst (char *strbuf, char *source, char *dest); +char CtdlCheckExpress(void); extern int panic_fd; -char CtdlCheckExpress(void); extern time_t server_startup_time; extern int openid_level_supported; diff --git a/citadel/clientsocket.h b/citadel/clientsocket.h index f0d7c6a32..cc275e1a5 100644 --- a/citadel/clientsocket.h +++ b/citadel/clientsocket.h @@ -1,16 +1,14 @@ -/* - * Header file for TCP client socket library - * - * Copyright (c) 1987-2012 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Header file for TCP client socket library +// +// Copyright (c) 1987-2012 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. int sock_connect(char *host, char *service); int sock_write(int *sock, const char *buf, int nbytes); diff --git a/citadel/config.h b/citadel/config.h index 4c6d050ab..23f144a48 100644 --- a/citadel/config.h +++ b/citadel/config.h @@ -1,50 +1,45 @@ -/* - * Copyright (c) 1987-2016 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Copyright (c) 1987-2016 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. #include "serv_extensions.h" #include "citadel_dirs.h" - - -/* - * This is the format of the legacy config file. Do not attempt to do anything with it other - * than migrate it into the new format. DO NOT EDIT -- EVER. - */ +// This is the format of the legacy config file. Do not attempt to do anything with it other +// than migrate it into the new format. Seriously -- DO NOT CHANGE IT. The only purpose of this +// struct is to represent the OLD configuration format. struct legacy_config { - char c_nodename[16]; /* short name of this node on a Citadel network */ - char c_fqdn[64]; /* this site's fully qualified domain name */ - char c_humannode[21]; /* human-readable site name */ + char c_nodename[16]; // short name of this node on a Citadel network + char c_fqdn[64]; // this site's fully qualified domain name + char c_humannode[21]; // human-readable site name char c_niu_7[16]; uid_t c_niu_6; - char c_creataide; /* 1 = creating a room auto-grants room aide privileges */ - int c_sleeping; /* watchdog timer (seconds) */ - char c_initax; /* initial access level for new users */ - char c_regiscall; /* after c_regiscall logins user will be asked to register */ - char c_twitdetect; /* automatically move messages from problem users to trashcan */ - char c_twitroom[ROOMNAMELEN]; /* name of trashcan */ - char c_moreprompt[80]; /* paginator prompt */ - char c_restrict; /* require per-user permission to send Internet mail */ + char c_creataide; // 1 = creating a room auto-grants room aide privileges + int c_sleeping; // watchdog timer (seconds) + char c_initax; // initial access level for new users + char c_regiscall; // after c_regiscall logins user will be asked to register + char c_twitdetect; // automatically move messages from problem users to trashcan + char c_twitroom[ROOMNAMELEN]; // name of trashcan + char c_moreprompt[80]; // paginator prompt + char c_restrict; // require per-user permission to send Internet mail long c_niu_1; - char c_site_location[32]; /* geographic location of this Citadel site */ - char c_sysadm[26]; /* name of system administrator */ + char c_site_location[32]; // geographic location of this Citadel site + char c_sysadm[26]; // name of system administrator char c_niu_2[15]; int c_niu_3; - int c_maxsessions; /* maximum number of concurrent sessions allowed */ - char c_ip_addr[20]; /* bind address for listening sockets */ - int c_port_number; /* port number for Citadel protocol (usually 504) */ + int c_maxsessions; // maximum number of concurrent sessions allowed + char c_ip_addr[20]; // bind address for listening sockets + int c_port_number; // port number for Citadel protocol (usually 504) int c_niu_4; - struct ExpirePolicy c_ep; /* default expire policy for the entire site */ - int c_userpurge; /* user purge time (in days) */ - int c_roompurge; /* room purge time (in days) */ + struct ExpirePolicy c_ep; // default expire policy for the entire site + int c_userpurge; // user purge time (in days) + int c_roompurge; // room purge time (in days) char c_logpages[ROOMNAMELEN]; char c_createax; long c_maxmsglen; @@ -101,8 +96,6 @@ struct legacy_config { }; - - void initialize_config_system(void); void shutdown_config_system(void); void put_config(void); diff --git a/citadel/modules/listsub/serv_listsub.c b/citadel/modules/listsub/serv_listsub.c index 34939eb15..073ddafae 100644 --- a/citadel/modules/listsub/serv_listsub.c +++ b/citadel/modules/listsub/serv_listsub.c @@ -351,7 +351,6 @@ void cmd_lsub(char *cmdbuf) { char cmd[20]; char roomname[ROOMNAMELEN]; char emailaddr[1024]; - char options[256]; char url[1024]; char token[128]; diff --git a/citadel/room_ops.h b/citadel/room_ops.h index 20a843654..a9a77f9e7 100644 --- a/citadel/room_ops.h +++ b/citadel/room_ops.h @@ -1,25 +1,20 @@ -int is_known (struct ctdlroom *roombuf, int roomnum, - struct ctdluser *userbuf); -int has_newmsgs (struct ctdlroom *roombuf, int roomnum, - struct ctdluser *userbuf); -int is_zapped (struct ctdlroom *roombuf, int roomnum, - struct ctdluser *userbuf); +int is_known (struct ctdlroom *roombuf, int roomnum, struct ctdluser *userbuf); +int has_newmsgs (struct ctdlroom *roombuf, int roomnum, struct ctdluser *userbuf); +int is_zapped (struct ctdlroom *roombuf, int roomnum, struct ctdluser *userbuf); void b_putroom(struct ctdlroom *qrbuf, char *room_name); void b_deleteroom(char *); void lgetfloor (struct floor *flbuf, int floor_num); void lputfloor (struct floor *flbuf, int floor_num); int sort_msglist (long int *listptrs, int oldcount); void list_roomname(struct ctdlroom *qrbuf, int ra, int current_view, int default_view); - void convert_room_name_macros(char *towhere, size_t maxlen); - typedef enum _POST_TYPE{ POST_LOGGED_IN, POST_EXTERNAL, CHECK_EXISTANCE, POST_LMTP -}PostType; +} PostType; int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, size_t n, diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 068ad88da..99947bc0c 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -1,17 +1,15 @@ -/* - * Tuning of various parameters of the system. - * Normally you don't want to mess with any of this. - * - * Copyright (c) 1987-2018 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Tuning of various parameters of the system. +// Normally you don't want to mess with any of this. +// +// Copyright (c) 1987-2021 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. /* * NLI is the string that shows up in a ho's online listing for sessions @@ -73,12 +71,6 @@ #define PAGELOGROOM "Sent/Received Pages" #define SYSCONFIGROOM "Local System Configuration" #define SMTP_SPOOLOUT_ROOM "__CitadelSMTPspoolout__" - -/* - * Where we keep messages containing the vCards that source our directory. It - * makes no sense to change this, because you'd have to change it on every - * system on the network. That would be stupid. - */ #define ADDRESS_BOOK_ROOM "Global Address Book" /* -- 2.30.2