files are now prefixed with either `confdir' or `logdir'.
authorswa <swa@users.sourceforge.net>
Mon, 4 Jun 2001 18:31:58 +0000 (18:31 +0000)
committerswa <swa@users.sourceforge.net>
Mon, 4 Jun 2001 18:31:58 +0000 (18:31 +0000)
`make redhat-dist' replaces both entries confdir and logdir
with redhat values

.gitignore
Makefile.in
config
junkbuster-rh.spec
junkbuster.logrotate
loadcfg.c
project.h

index ef833b0..a9ad28a 100644 (file)
@@ -34,5 +34,6 @@ config.log
 config.status
 junkbuster
 junkbuster.log
 config.status
 junkbuster
 junkbuster.log
+logfile
 permissionsfile
 re_filterfile
 permissionsfile
 re_filterfile
index d9839ec..bd61a7e 100644 (file)
@@ -1,6 +1,6 @@
 # Note:  Makefile is built automatically from Makefile.in
 #
 # Note:  Makefile is built automatically from Makefile.in
 #
-# $Id: Makefile.in,v 1.7 2001/06/03 17:09:09 swa Exp $
+# $Id: Makefile.in,v 1.8 2001/06/04 10:44:57 swa Exp $
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # IJBSWA team.  http://ijbswa.sourceforge.net
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # IJBSWA team.  http://ijbswa.sourceforge.net
 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
 # $Log: Makefile.in,v $
 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
 # $Log: Makefile.in,v $
+# Revision 1.8  2001/06/04 10:44:57  swa
+# `make redhatr-dist' now works. Except for the paths
+# in the config file.
+#
 # Revision 1.7  2001/06/03 17:09:09  swa
 # swa for oes: reversed my earlier change
 #
 # Revision 1.7  2001/06/03 17:09:09  swa
 # swa for oes: reversed my earlier change
 #
@@ -203,7 +207,7 @@ sregexp.txt: re_filterfile
 redhat-dist:
        @make clobber
 # verify that i'm root needs to be done
 redhat-dist:
        @make clobber
 # verify that i'm root needs to be done
-       tar --exclude "ijb/CVS" -cvzf ../ijbswa.tar.gz .
+       tar  -cvzf ../ijbswa.tar.gz .
 # verify all version strings, FLAGS, etc. in the spec file
        cat junkbuster-rh.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(VERSION_POINT)/g' > /tmp/abc && cp -f /tmp/abc junkbuster-rh.spec
 # verify all files in their correct location needs to be done
 # verify all version strings, FLAGS, etc. in the spec file
        cat junkbuster-rh.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(VERSION_POINT)/g' > /tmp/abc && cp -f /tmp/abc junkbuster-rh.spec
 # verify all files in their correct location needs to be done
diff --git a/config b/config
index 078a95d..4fa0a37 100644 (file)
--- a/config
+++ b/config
@@ -1,7 +1,7 @@
 #  Sample Configuration file for the Internet Junkbuster 2.0
 
 #
 #  Sample Configuration file for the Internet Junkbuster 2.0
 
 #
-# $Id: config,v 1.11 2001/06/03 18:38:11 oes Exp $
+# $Id: config,v 1.12 2001/06/04 10:44:57 swa Exp $
 #
 
 #  Table of Contents
 #
 
 #  Table of Contents
 # Now, only confdir/templates is used for storing HTML templates
 # for CGI results.
 #
 # Now, only confdir/templates is used for storing HTML templates
 # for CGI results.
 #
-confdir /home/swa/sourceforge/current
+# No trailing /, please.
+confdir .
+
+#
+# The directory where all logging (i.e. logfile and jarfile) takes place
+# No trailing /, please.
+#
+logdir .
+
+#
+# Note that all file specifications below are relative to 
+# the above two directories!!!
+#
 
 #  The permissions file contains patterns to specify the
 #  filtering rules to apply to each site.
 
 #  The permissions file contains patterns to specify the
 #  filtering rules to apply to each site.
@@ -76,7 +88,7 @@ confdir /home/swa/sourceforge/current
 #           All sites are filtered if re_filterfile specified.
 #           No sites are blocked.  Nothing is an image.
 #
 #           All sites are filtered if re_filterfile specified.
 #           No sites are blocked.  Nothing is an image.
 #
-permissionsfile ./permissionsfile
+permissionsfile permissionsfile
 
 #
 #  The re_filterfile contains content modification rules.  These rules
 
 #
 #  The re_filterfile contains content modification rules.  These rules
@@ -87,7 +99,7 @@ permissionsfile ./permissionsfile
 #
 #  Default: No content modification.
 #
 #
 #  Default: No content modification.
 #
-re_filterfile   ./re_filterfile
+re_filterfile   re_filterfile
 
 #
 #  The logfile is where all logging and error messages are written.
 
 #
 #  The logfile is where all logging and error messages are written.
@@ -106,7 +118,7 @@ re_filterfile   ./re_filterfile
 #
 #  Default: Log to the standard error channel, not to a file
 #
 #
 #  Default: Log to the standard error channel, not to a file
 #
-logfile      ./junkbuster.log
+logfile      logfile
 
 #
 #  The jarfile defines where Junkbuster stores the cookies it
 
 #
 #  The jarfile defines where Junkbuster stores the cookies it
@@ -115,7 +127,7 @@ logfile      ./junkbuster.log
 #
 #  Default: Don't store intercepted cookies
 #
 #
 #  Default: Don't store intercepted cookies
 #
-#jarfile     ./jarfile
+#jarfile     jarfile
 
 #
 #  The forwardfile defines domain-specific forwarding of HTTP
 
 #
 #  The forwardfile defines domain-specific forwarding of HTTP
@@ -126,7 +138,7 @@ logfile      ./junkbuster.log
 #
 #  Default: Make all connections directly.
 #
 #
 #  Default: Make all connections directly.
 #
-forwardfile   ./forward
+forwardfile   forward
 
 #
 #  Generally, Junkbuster is used as a personal proxy.  The default
 
 #
 #  Generally, Junkbuster is used as a personal proxy.  The default
@@ -144,7 +156,7 @@ forwardfile   ./forward
 #  Default: No access control. Everybody that can reach junkbuster
 #           will be served.
 #
 #  Default: No access control. Everybody that can reach junkbuster
 #           will be served.
 #
-#aclfile   ./aclfile
+#aclfile   aclfile
 
 #
 #  4. OPTIONS
 
 #
 #  4. OPTIONS
index e36423a..e17a594 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.7 2001/06/03 17:09:09 swa Exp $
+# $Id: junkbuster-rh.spec,v 1.1 2001/06/04 10:44:57 swa Exp $
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # IJBSWA team.  http://ijbswa.sourceforge.net
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # IJBSWA team.  http://ijbswa.sourceforge.net
 # or write to the Free Software Foundation, Inc., 59
 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
 # or write to the Free Software Foundation, Inc., 59
 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Log: Makefile.in,v $
+# $Log: junkbuster-rh.spec,v $
+# Revision 1.1  2001/06/04 10:44:57  swa
+# `make redhatr-dist' now works. Except for the paths
+# in the config file.
+#
 #
 #
 %define PACKAGE_NAME junkbuster
 #
 #
 %define PACKAGE_NAME junkbuster
@@ -255,7 +259,20 @@ cp -f re_filterfile $RPM_BUILD_ROOT/etc/junkbuster/re_filterfile
 # cp -f imagelist $RPM_BUILD_ROOT/etc/junkbuster/imagelist
 # cp -f cookiefile $RPM_BUILD_ROOT/etc/junkbuster/cookiefile
 cp -f aclfile $RPM_BUILD_ROOT/etc/junkbuster/aclfile
 # cp -f imagelist $RPM_BUILD_ROOT/etc/junkbuster/imagelist
 # cp -f cookiefile $RPM_BUILD_ROOT/etc/junkbuster/cookiefile
 cp -f aclfile $RPM_BUILD_ROOT/etc/junkbuster/aclfile
-cp -f config $RPM_BUILD_ROOT/etc/junkbuster/config
+
+# verify all file locations, etc. in the config file
+# don't start with ^ or commented lines are not replaced
+cat config | \
+    sed 's/^confdir.*/confdir \/etc\/junkbuster/g' | \
+#    sed 's/^permissionsfile.*/permissionsfile \/etc\/junkbuster\/permissionsfile/g' | \
+#    sed 's/^re_filterfile.*/re_filterfile \/etc\/junkbuster\/re_filterfile/g' | \
+#    sed 's/^logfile.*/logfile \/var\/log\/junkbuster\/logfile/g' | \
+#    sed 's/^jarfile.*/jarfile \/var\/log\/junkbuster\/jarfile/g' | \
+#    sed 's/^forward.*/forward \/etc\/junkbuster\/forward/g' | \
+#    sed 's/^aclfile.*/aclfile \/etc\/junkbuster\/aclfile/g' > \
+    sed 's/^logdir.*/logdir \/var\/log\/junkbuster/g' > \
+    $RPM_BUILD_ROOT/etc/junkbuster/config
+
 cp -f forward $RPM_BUILD_ROOT/etc/junkbuster/forward
 cp -f trust $RPM_BUILD_ROOT/etc/junkbuster/trust
 # cp -f popup $RPM_BUILD_ROOT/etc/junkbuster/popup
 cp -f forward $RPM_BUILD_ROOT/etc/junkbuster/forward
 cp -f trust $RPM_BUILD_ROOT/etc/junkbuster/trust
 # cp -f popup $RPM_BUILD_ROOT/etc/junkbuster/popup
index f79d2f9..5062378 100644 (file)
@@ -3,7 +3,7 @@
 #
 # ********************************************************************
 # 
 #
 # ********************************************************************
 # 
-#  File        :  $Source: /cvsroot/ijbswa/current/junkbuster.monthly,v $
+#  File        :  $Source: /cvsroot/ijbswa/current/junkbuster.logrotate,v $
 # 
 #  Purpose     :  Rotates all potential Junkbuster logfiles
 #                 
 # 
 #  Purpose     :  Rotates all potential Junkbuster logfiles
 #                 
 #                 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # 
 #  Revisions   :
 #                 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # 
 #  Revisions   :
-#     $Log: junkbuster.monthly,v $
+#     $Log: junkbuster.logrotate,v $
+#     Revision 1.2  2001/05/24 07:52:24  swa
+#     added header. removed ^M.
+#
 #     Revision 1.3  2001/05/24 07:41:33  swa
 #     added header
 #
 #     Revision 1.3  2001/05/24 07:41:33  swa
 #     added header
 #
 # 
 # ********************************************************************/
 
 # 
 # ********************************************************************/
 
-/var/log/junkbuster/junkbuster {
+/var/log/junkbuster/logfile {
    compress
    weekly
 }
 
    compress
    weekly
 }
 
-
-#/var/log/junkbuster/jarfile {
-#  compress
-#        weekly
-#}
+/var/log/junkbuster/jarfile {
+  compress
+  weekly
+}
index e7dccc8..4bb99d1 100644 (file)
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 11:03:48 oes Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 19:11:54 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 11:03:48 oes Exp $"
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.10  2001/06/03 19:11:54  oes
+ *    introduced confdir option
+ *
  *    Revision 1.10  2001/06/03 11:03:48  oes
  *    Makefile/in
  *
  *    Revision 1.10  2001/06/03 11:03:48  oes
  *    Makefile/in
  *
@@ -293,6 +296,7 @@ static struct file_list *current_configfile = NULL;
 #define hash_actions_file              3825730796ul /* FIXME "permissionsfile" */
 #define hash_debug                          78263ul
 #define hash_confdir                      1978389lu
 #define hash_actions_file              3825730796ul /* FIXME "permissionsfile" */
 #define hash_debug                          78263ul
 #define hash_confdir                      1978389lu
+#define hash_logdir                        422889lu
 #define hash_forwardfile               1268669141ul
 #define hash_jarfile                      2046641ul
 #define hash_listen_address            1255650842ul
 #define hash_forwardfile               1268669141ul
 #define hash_jarfile                      2046641ul
 #define hash_listen_address            1255650842ul
@@ -450,6 +454,8 @@ struct configuration_spec * load_config(void)
       char arg[BUFSIZ];
       char tmp[BUFSIZ];
 
       char arg[BUFSIZ];
       char tmp[BUFSIZ];
 
+      char arg2[BUFSIZ];
+
       strcpy(tmp, buf);
 
       /* Copy command (i.e. up to space or tab) into cmd */
       strcpy(tmp, buf);
 
       /* Copy command (i.e. up to space or tab) into cmd */
@@ -494,7 +500,8 @@ struct configuration_spec * load_config(void)
 #ifdef TRUST_FILES
          case hash_trustfile :
             freez((char *)config->trustfile);
 #ifdef TRUST_FILES
          case hash_trustfile :
             freez((char *)config->trustfile);
-            config->trustfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->trustfile = strdup(arg2);
             continue;
 
          case hash_trust_info_url :
             continue;
 
          case hash_trust_info_url :
@@ -510,24 +517,31 @@ struct configuration_spec * load_config(void)
             config->confdir = strdup(arg);
             continue;            
 
             config->confdir = strdup(arg);
             continue;            
 
+         case hash_logdir :
+            config->logdir = strdup(arg);
+            continue;            
+
          case hash_single_threaded :
             config->multi_threaded = 0;
             continue;
 
          case hash_actions_file :
             freez((char *)config->actions_file);
          case hash_single_threaded :
             config->multi_threaded = 0;
             continue;
 
          case hash_actions_file :
             freez((char *)config->actions_file);
-            config->actions_file = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->actions_file = strdup(arg2);
             continue;
 
          case hash_logfile :
             freez((char *)config->logfile);
             continue;
 
          case hash_logfile :
             freez((char *)config->logfile);
-            config->logfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->logdir, arg);
+            config->logfile = strdup(arg2);
             continue;
 
 #ifdef JAR_FILES
          case hash_jarfile :
             freez((char *)config->jarfile);
             continue;
 
 #ifdef JAR_FILES
          case hash_jarfile :
             freez((char *)config->jarfile);
-            config->jarfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->logdir, arg);
+            config->jarfile = strdup(arg2);
             continue;
 #endif /* def JAR_FILES */
 
             continue;
 #endif /* def JAR_FILES */
 
@@ -538,13 +552,15 @@ struct configuration_spec * load_config(void)
 
          case hash_forwardfile :
             freez((char *)config->forwardfile);
 
          case hash_forwardfile :
             freez((char *)config->forwardfile);
-            config->forwardfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->forwardfile = strdup(arg2);
             continue;
 
 #ifdef ACL_FILES
          case hash_aclfile :
             freez((char *)config->aclfile);
             continue;
 
 #ifdef ACL_FILES
          case hash_aclfile :
             freez((char *)config->aclfile);
-            config->aclfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->aclfile = strdup(arg2);
             continue;
 #endif /* def ACL_FILES */
 
             continue;
 #endif /* def ACL_FILES */
 
index 9020d92..fc058ad 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,6 +1,6 @@
 #ifndef _PROJECT_H
 #define _PROJECT_H
 #ifndef _PROJECT_H
 #define _PROJECT_H
-#define PROJECT_H_VERSION "$Id: project.h,v 1.14 2001/06/03 11:03:48 oes Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.15 2001/06/04 11:28:53 swa Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
@@ -36,6 +36,9 @@
  *
  * Revisions   :
  *    $Log: project.h,v $
  *
  * Revisions   :
  *    $Log: project.h,v $
+ *    Revision 1.15  2001/06/04 11:28:53  swa
+ *    redirect did not work due to missing /
+ *
  *    Revision 1.14  2001/06/03 11:03:48  oes
  *    Makefile/in
  *
  *    Revision 1.14  2001/06/03 11:03:48  oes
  *    Makefile/in
  *
@@ -701,6 +704,7 @@ struct configuration_spec
    const char *logfile;
 
    const char *confdir;
    const char *logfile;
 
    const char *confdir;
+   const char *logdir;
    const char *actions_file;
    const char *forwardfile;
 
    const char *actions_file;
    const char *forwardfile;