From e58ab5fd6a62f31bac31ff246d3b89f8534672a6 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 15 Jun 2022 14:49:41 -0400 Subject: [PATCH] Removed some more portability hacks that were made for systems that are now completely obsolete. --- citadel/server/citadel.h | 8 ++-- citadel/server/sysdep.h | 95 --------------------------------------- citadel/server/user_ops.c | 12 ++--- textclient/citadel.c | 2 +- 4 files changed, 13 insertions(+), 104 deletions(-) diff --git a/citadel/server/citadel.h b/citadel/server/citadel.h index 62dbf52f5..40b308f68 100644 --- a/citadel/server/citadel.h +++ b/citadel/server/citadel.h @@ -24,9 +24,6 @@ extern "C" { #endif -// Text description of this software -// (We used to define this ourselves, but why bother when the build tools do it for us?) -#define CITADEL "Citadel" PACKAGE_VERSION #define REV_LEVEL 956 // This version #define REV_MIN 591 // Oldest compatible database @@ -34,6 +31,11 @@ extern "C" { #define LIBCITADEL_MIN 951 // Minimum required version of libcitadel #define SERVER_TYPE 0 // zero for stock Citadel; other developers please obtain SERVER_TYPE codes for your implementations +// hats off to https://stackoverflow.com/questions/5459868/concatenate-int-to-string-using-c-preprocessor +#define STR_HELPER(x) #x +#define STR(x) STR_HELPER(x) +#define CITADEL "Citadel Server " STR(REV_LEVEL) + #ifdef LIBCITADEL_VERSION_NUMBER #if LIBCITADEL_VERSION_NUMBER < LIBCITADEL_MIN #error libcitadel is too old. Please upgrade it before continuing. diff --git a/citadel/server/sysdep.h b/citadel/server/sysdep.h index 20d5a601d..213ff658d 100644 --- a/citadel/server/sysdep.h +++ b/citadel/server/sysdep.h @@ -4,9 +4,6 @@ #error CTDLDIR is not defined , did we not run configure ? #endif -/* define, if the user suplied a data-directory to use. */ -/* #undef DATA_DIR */ - /* whether we have NLS support */ #define ENABLE_NLS /**/ @@ -68,9 +65,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 -/* Define to 1 if you have the `nsl' library (-lnsl). */ -/* #undef HAVE_LIBNSL */ - /* Define to 1 if you have the `pthread' library (-lpthread). */ #define HAVE_LIBPTHREAD 1 @@ -95,9 +89,6 @@ /* Define to 1 if you have the `mktime' function. */ #define HAVE_MKTIME 1 -/* Define to 1 if you have the header file, and it defines `DIR'. */ -/* #undef HAVE_NDIR_H */ - /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 @@ -122,12 +113,6 @@ /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 -/* enable alternate spool dir? */ -/* #undef HAVE_SPOOL_DIR */ - -/* should we activate an alternate static text location? */ -/* #undef HAVE_STATICDATA_DIR */ - /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -164,17 +149,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_SYSLOG_H 1 -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_DIR_H */ - /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_NDIR_H */ - /* Define to 1 if you have the header file. */ #define HAVE_SYS_PRCTL_H 1 @@ -199,19 +176,12 @@ /* Define to 1 if you have the header file. */ #define HAVE_TERMIOS_H 1 -/* Define if you don't have `tm_gmtoff' but do have the external variable - `timezone'. */ -/* #undef HAVE_TIMEZONE */ - /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `uselocale' function. */ #define HAVE_USELOCALE 1 -/* should we put our helper binaries to another location? */ -/* #undef HAVE_UTILBIN_DIR */ - /* Define to 1 if you have the header file. */ #define HAVE_UTMPX_H 1 @@ -227,42 +197,12 @@ /* Define to 1 if you have the `vprintf' function. */ #define HAVE_VPRINTF 1 -/* Define to 1 if you have the `vw_printw' function. */ -/* #undef HAVE_VW_PRINTW */ - -/* Define to 1 if you have the `wcolor_set' function. */ -/* #undef HAVE_WCOLOR_SET */ - -/* Define to 1 if you have the `wresize' function. */ -/* #undef HAVE_WRESIZE */ - -/* define, if the user suplied a helpfile-directory to use. */ -/* #undef HELP_DIR */ - /* where to find our pot files */ #define LOCALEDIR "/root/citadel/citadel" -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "http://uncensored.citadel.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "Citadel" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "citadel" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "951" - /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void -/* define, where the config should go in unix style */ -/* #undef RUN_DIR */ - /* The size of `char', as computed by sizeof. */ #define SIZEOF_CHAR 1 @@ -281,27 +221,15 @@ /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 8 -/* do we need to use solaris call syntax? */ -/* #undef SOLARIS_GETPWUID */ - -/* where do we place our spool dirs? */ -/* #undef SPOOL_DIR */ - /* were should we put our keys? */ #define SSL_DIR "/root/citadel/citadel/keys" -/* where do we put our static text data? */ -/* #undef STATICDATA_DIR */ - /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 -/* Define to 1 if your declares `struct tm'. */ -/* #undef TM_IN_SYS_TIME */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -322,26 +250,3 @@ #ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 #endif - - -/* were to put our helper programs */ -/* #undef UTILBIN_DIR */ - -/* Define to 1 if on MINIX. */ -/* #undef _MINIX */ - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -/* #undef _POSIX_SOURCE */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `int' if does not define. */ -/* #undef pid_t */ - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ diff --git a/citadel/server/user_ops.c b/citadel/server/user_ops.c index d45e50044..d341b31c0 100644 --- a/citadel/server/user_ops.c +++ b/citadel/server/user_ops.c @@ -475,10 +475,11 @@ int CtdlLoginExistingUser(const char *trythisname) { if (trythisname == NULL) return login_not_found; - if (!strncasecmp(trythisname, "SYS_", 4)) { - syslog(LOG_DEBUG, "user_ops: system user \"%s\" is not allowed to log in.", trythisname); - return login_not_found; - } + // We handle this a different way now (see below) + //if (!strncasecmp(trythisname, "SYS_", 4)) { + //syslog(LOG_DEBUG, "user_ops: system user \"%s\" is not allowed to log in.", trythisname); + //return login_not_found; + //} // Continue attempting user validation... safestrncpy(username, trythisname, sizeof (username)); @@ -567,7 +568,8 @@ int CtdlLoginExistingUser(const char *trythisname) { } // User 0 is a system account and must not be used by a real user - if (&CC->user.usernum <= 0) { + if (CC->user.usernum <= 0) { + syslog(LOG_DEBUG, "user_ops: system account <%s> is not allowed to log in.", trythisname); return login_not_found; } diff --git a/textclient/citadel.c b/textclient/citadel.c index c22a2efac..c4d85b1f9 100644 --- a/textclient/citadel.c +++ b/textclient/citadel.c @@ -1471,7 +1471,7 @@ int main(int argc, char **argv) { logoff(ipc, atoi(aaa)); } -#ifdef HAVE_OPENSSL +#ifdef HAVE_OPENSSLLLLLL /* Evaluate encryption preferences */ if (arg_encrypt != RC_NO && rc_encrypt != RC_NO) { if (!ipc->isLocal || arg_encrypt == RC_YES || rc_encrypt == RC_YES) { -- 2.30.2