* config.c, sysdep.c: fix -h option not setting proper modules dir
authorNathan Bryant <loanshark@uncensored.citadel.org>
Tue, 13 Apr 1999 17:09:54 +0000 (17:09 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Tue, 13 Apr 1999 17:09:54 +0000 (17:09 +0000)
        * configure.in, citadel.spec: make --enable-chkpwd the default
        * setup.c: don't chown chkpwd

citadel/ChangeLog
citadel/citadel.spec
citadel/config.c
citadel/configure.in
citadel/setup.c
citadel/sysdep.c

index 94342c4bccb30dd243f4f2b0d28a6cdcd371368d..24b237d761d772a331f90f30f40aa5fbb76b0724 100644 (file)
@@ -5,6 +5,9 @@ Mon Apr 12 22:13:26 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 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
index c38b23676ffa69d80418b95ef8bf78f10c67de79..46b4ac19e1d8612a9fbdc97d46cfe11632196e9d 100644 (file)
@@ -17,7 +17,7 @@ driven, and accessible via a growing selection of front ends.
 %setup -n citadel
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-chkpwd --with-pam
+CFLAGS="$RPM_OPT_FLAGS" ./configure --with-pam
 make
 
 %install
index e178561b06294629b56ec1e455007ddc42fb0aab..87f4f49f3dafd26fb3f7aa46aaed283457dbc39c 100644 (file)
@@ -17,7 +17,7 @@
 #include "config.h"
 
 struct config config;
-char bbs_home_directory[PATH_MAX];
+char bbs_home_directory[PATH_MAX] = BBSDIR;
 int home_specified = 0;
 
 /*
index 7ddcdbd50855c7e591196bc61e6b20bd06a20d0c..0d12ea3e15453401f62de908e6e3c2bf3e3f9498 100644 (file)
@@ -10,7 +10,7 @@ else
 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)])
 
@@ -108,19 +108,19 @@ if test "$enable_autologin" != no; then
                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
index e1bc7cc109703fd909795789f3a20f4cee79a052..8a19ead50d8eb93642ed257e9b0c51a3a1ae986c 100644 (file)
@@ -968,17 +968,17 @@ int main(int argc, char *argv[])
        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.");
index 7a4f5c36eed4d2ce8eb7c605fd700f4867b60512..fbc42d2ab1924950df03960e5a8cecb74c83d45b 100644 (file)
@@ -788,11 +788,11 @@ int main(int argc, char **argv)
        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, "");
@@ -816,13 +816,12 @@ int main(int argc, char **argv)
 
                /* -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;
                        }
 
@@ -885,7 +884,11 @@ int main(int argc, char **argv)
                }
 
        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");
 
        /*