#include <stdarg.h>
#include <syslog.h>
#include <grp.h>
-#ifdef __GNUC__
-#include <malloc.h>
-#endif
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif
int drop_root_perms = 1;
char *moddir;
struct worker_node *wnp;
+ size_t size;
/* specify default port name and trace file */
strcpy(tracefile, "");
freopen(tracefile, "r", stdin);
freopen(tracefile, "w", stdout);
freopen(tracefile, "w", stderr);
+ chmod(tracefile, 0600);
}
/* run in the background if -d was specified */
/* 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();
* 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);
}
*/
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));
}