]> code.citadel.org Git - citadel.git/blobdiff - citadel/server_main.c
- pass -Wcast-qual to gcc
[citadel.git] / citadel / server_main.c
index 8cd53e9b7f075a256d7ed0937f4900e3670735b3..c7b73329c1dd59659502e25e9912886beb6e8f20 100644 (file)
@@ -70,6 +70,7 @@ int main(int argc, char **argv)
        int drop_root_perms = 1;
        char *moddir;
        struct worker_node *wnp;
+       size_t size;
         
        /* specify default port name and trace file */
        strcpy(tracefile, "");
@@ -128,12 +129,13 @@ int main(int argc, char **argv)
 
        /* Tell 'em who's in da house */
        lprintf(1,
-"\nMultithreaded message server for Citadel/UX\n"
+"\n"
+"Citadel/UX messaging server engine v%d.%02d\n"
 "Copyright (C) 1987-2001 by the Citadel/UX development team.\n"
-"Citadel/UX is free software, covered by the GNU General Public License, and\n"
-"you are welcome to change it and/or distribute copies of it under certain\n"
-"conditions.  There is absolutely no warranty for this software.  Please\n"
-"read the 'COPYING.txt' file for details.\n\n");
+"Citadel/UX is released under the terms of the GNU General Public License.\n"
+"If you paid for this software, someone is ripping you off.\n\n",
+       (REV_LEVEL/100),
+       (REV_LEVEL%100));
 
        /* Initialize... */
        init_sysdep();
@@ -169,8 +171,9 @@ int main(int argc, char **argv)
         * Load any server-side modules (plugins) available here.
         */
        lprintf(7, "Initializing loadable modules\n");
-       if ((moddir = malloc(strlen(bbs_home_directory) + 9)) != NULL) {
-               sprintf(moddir, "%s/modules", bbs_home_directory);
+       size = strlen(bbs_home_directory) + 9;
+       if ((moddir = mallok(size)) != NULL) {
+               snprintf(moddir, size, "%s/modules", bbs_home_directory);
                DLoader_Init(moddir);
                free(moddir);
        }
@@ -194,16 +197,16 @@ int main(int argc, char **argv)
         */
        if (drop_root_perms) {
                if ((pw = getpwuid(BBSUID)) == NULL)
-                       lprintf(1, "WARNING: getpwuid(%d): %s\n"
-                                  "Group IDs will be incorrect.\n", BBSUID,
+                       lprintf(1, "WARNING: getpwuid(%ld): %s\n"
+                                  "Group IDs will be incorrect.\n", (long)BBSUID,
                                strerror(errno));
                else {
                        initgroups(pw->pw_name, pw->pw_gid);
                        if (setgid(pw->pw_gid))
-                               lprintf(3, "setgid(%d): %s\n", pw->pw_gid,
+                               lprintf(3, "setgid(%ld): %s\n", (long)pw->pw_gid,
                                        strerror(errno));
                }
-               lprintf(7, "Changing uid to %d\n", BBSUID);
+               lprintf(7, "Changing uid to %ld\n", (long)BBSUID);
                if (setuid(BBSUID) != 0) {
                        lprintf(3, "setuid() failed: %s\n", strerror(errno));
                }