Removed some more portability hacks that were made for systems that are now completel...
authorArt Cancro <ajc@citadel.org>
Wed, 15 Jun 2022 18:49:41 +0000 (14:49 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 15 Jun 2022 18:49:41 +0000 (14:49 -0400)
citadel/server/citadel.h
citadel/server/sysdep.h
citadel/server/user_ops.c
textclient/citadel.c

index 62dbf52f545ec0afbc9a6eff25287871b8f39c1c..40b308f6829a22ccd52e324ee626176d8545c789 100644 (file)
@@ -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.
index 20d5a601dee0410164a494596afc529f3c1b1ccb..213ff658def91b7549fcc55c6c99683ccf1c7c88 100644 (file)
@@ -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 <inttypes.h> 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 <ndir.h> header file, and it defines `DIR'. */
-/* #undef HAVE_NDIR_H */
-
 /* Define to 1 if you have the <netinet/in.h> header file. */
 #define HAVE_NETINET_IN_H 1
 
 /* 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 <stdint.h> header file. */
 #define HAVE_STDINT_H 1
 
 /* Define to 1 if you have the <syslog.h> header file. */
 #define HAVE_SYSLOG_H 1
 
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-/* #undef HAVE_SYS_DIR_H */
-
 /* Define to 1 if you have the <sys/ioctl.h> header file. */
 #define HAVE_SYS_IOCTL_H 1
 
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-/* #undef HAVE_SYS_NDIR_H */
-
 /* Define to 1 if you have the <sys/prctl.h> header file. */
 #define HAVE_SYS_PRCTL_H 1
 
 /* Define to 1 if you have the <termios.h> 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 <unistd.h> 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 <utmpx.h> header file. */
 #define HAVE_UTMPX_H 1
 
 /* 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
 
 /* 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 <sys/time.h> and <time.h>. */
 #define TIME_WITH_SYS_TIME 1
 
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-/* #undef TM_IN_SYS_TIME */
-
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # define _ALL_SOURCE 1
 #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 <sys/types.h> does not define. */
-/* #undef pid_t */
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef size_t */
index d45e5004469d69739dc7adc5d1805af2988ce2dd..d341b31c0158db7d25df6575e3c3945a5bfb1d25 100644 (file)
@@ -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;
        }
 
index c22a2efacc3da0bdf0e21d9a9b9309d7424a423e..c4d85b1f944b518349974bce75ac124e3219d948 100644 (file)
@@ -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) {