1999-04-12 Nathan Bryant <bryant@cs.usm.maine.edu>
* configure.in, Makefile.in: taught it how to generate OpenBSD shared
libraries
+ * config.c, sysdep.c: fix -h option not setting proper modules dir
+ * configure.in, citadel.spec: make --enable-chkpwd the default
+ * setup.c: don't chown chkpwd
1999-04-11 Nathan Bryant <bryant@cs.usm.maine.edu>
* configure.in: another OpenBSD fix, but we're still not quite there yet
%setup -n citadel
%build
-CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-chkpwd --with-pam
+CFLAGS="$RPM_OPT_FLAGS" ./configure --with-pam
make
%install
#include "config.h"
struct config config;
-char bbs_home_directory[PATH_MAX];
+char bbs_home_directory[PATH_MAX] = BBSDIR;
int home_specified = 0;
/*
fi
AC_ARG_ENABLE(autologin, [ --disable-autologin disable autologin (default is enabled if possible)])
-AC_ARG_ENABLE(chkpwd, [ --enable-chkpwd build 'chkpwd' (use this if you have shadow passwords)])
+AC_ARG_ENABLE(chkpwd, [ --disable-chkpwd don't build 'chkpwd'])
AC_ARG_WITH(pam, [ --with-pam use PAM if present (see PAM.txt before you try this)])
AC_ARG_WITH(kthread, [ --with-kthread use kernel threads (on FreeBSD) (not recommended yet)])
AC_CHECK_LIB(pam, pam_start, [chkpwd_LIBS="-lpam $chkpwd_LIBS"
LIBS="-lpam $LIBS"])
AC_CHECK_FUNCS(pam_start)
- test "$enable_chkpwd" = yes && LIBS=$save_LIBS
+ test "$enable_chkpwd" != no && LIBS=$save_LIBS
fi
if test "$ac_cv_func_pam_start" = no -o "$with_pam" != yes; then
AC_CHECK_LIB(shadow, getspnam)
if test "$ac_cv_func_crypt" = no; then
AC_CHECK_LIB(crypt, crypt, [chkpwd_LIBS=-lcrypt
- test "$enable_chkpwd" != yes && \
+ test "$enable_chkpwd" = no && \
LIBS="-lcrypt $LIBS"])
fi
fi
if test "$ac_cv_func_crypt" = yes -o "$ac_cv_lib_crypt_crypt" = yes -o "$ac_cv_func_pam_start" = yes; then
AC_DEFINE(ENABLE_AUTOLOGIN)
- if test "$enable_chkpwd" = yes; then
+ if test "$enable_chkpwd" != no; then
AC_DEFINE(ENABLE_CHKPWD)
CHKPWD=chkpwd
else
else
gid = pw->pw_gid;
- progress("Setting file permissions", 0, 4);
+ progress("Setting file permissions", 0, 5);
chown(".", config.c_bbsuid, gid);
- progress("Setting file permissions", 1, 4);
+ progress("Setting file permissions", 1, 5);
chown("citadel.config", config.c_bbsuid, gid);
- progress("Setting file permissions", 2, 4);
- sprintf(aaa, "find . -exec chown %d:%d {} \\; 2>/dev/null",
+ progress("Setting file permissions", 2, 5);
+ sprintf(aaa, "find . | grep -v chkpwd | xargs chown %d:%d 2>/dev/null",
config.c_bbsuid, gid);
system(aaa);
- progress("Setting file permissions", 2, 4);
- system("chmod 600 citadel.config");
- progress("Setting file permissions", 3, 4);
+ progress("Setting file permissions", 3, 5);
+ chmod("citadel.config", S_IRUSR | S_IWUSR);
+ progress("Setting file permissions", 4, 5);
important_message("Setup finished",
"Setup is finished. You may now start the Citadel server.");
struct CitContext *con; /* Temporary context pointer */
char tracefile[128]; /* Name of file to log traces to */
int a, i; /* General-purpose variables */
- char convbuf[128];
fd_set readfds;
struct timeval tv;
struct passwd *pw;
int drop_root_perms = 1;
+ char *moddir;
/* specify default port name and trace file */
strcpy(tracefile, "");
/* -x specifies the desired logging level */
else if (!strncmp(argv[a], "-x", 2)) {
- strcpy(convbuf, argv[a]);
- verbosity = atoi(&convbuf[2]);
+ verbosity = atoi(&argv[a][2]);
}
else if (!strncmp(argv[a], "-h", 2)) {
- strcpy(convbuf, argv[a]);
- strcpy(bbs_home_directory, &convbuf[2]);
+ safestrncpy(bbs_home_directory, &argv[a][2],
+ sizeof bbs_home_directory);
home_specified = 1;
}
}
lprintf(7, "Initializing loadable modules\n");
- DLoader_Init(BBSDIR "/modules");
+ if ((moddir = malloc(strlen(bbs_home_directory) + 9)) != NULL) {
+ sprintf(moddir, "%s/modules", bbs_home_directory);
+ DLoader_Init(moddir);
+ free(moddir);
+ }
lprintf(9, "Modules done initializing.\n");
/*