components/webalizer/patches/webalizer-2.01_10-confuser.patch
branchs11-update
changeset 2723 138732f62341
equal deleted inserted replaced
2722:dc566ca73390 2723:138732f62341
       
     1 
       
     2 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=158174
       
     3 
       
     4 --- webalizer-2.01-10/webalizer.c.confuser	2005-09-21 13:32:40.000000000 +0100
       
     5 +++ webalizer-2.01-10/webalizer.c	2005-09-21 13:33:43.000000000 +0100
       
     6 @@ -50,6 +50,8 @@
       
     7  #include <sys/types.h>
       
     8  #endif
       
     9  
       
    10 +#include <sys/stat.h>
       
    11 +
       
    12  /* some systems need this */
       
    13  #ifdef HAVE_MATH_H
       
    14  #include <math.h>
       
    15 @@ -252,6 +254,8 @@
       
    16  
       
    17     int    max_ctry;                      /* max countries defined       */
       
    18  
       
    19 +   struct stat st;
       
    20 +
       
    21     /* month names used for parsing logfile (shouldn't be lang specific) */
       
    22     char *log_month[12]={ "jan", "feb", "mar",
       
    23                           "apr", "may", "jun",
       
    24 @@ -266,8 +270,8 @@
       
    25  
       
    26     sprintf(tmp_buf,"%s/webalizer.conf",ETCDIR);
       
    27     /* check for default config file */
       
    28 -   if (!access("webalizer.conf",F_OK))
       
    29 -      get_config("webalizer.conf");
       
    30 +   if (stat("webalizer.conf", &st) == 0 && st.st_uid == getuid())
       
    31 +     get_config("webalizer.conf");
       
    32     else if (!access(tmp_buf,F_OK))
       
    33        get_config(tmp_buf);
       
    34  
       
    35 --- webalizer-2.01-10/webalizer.1.confuser	2001-10-23 07:05:50.000000000 +0100
       
    36 +++ webalizer-2.01-10/webalizer.1	2005-09-21 13:32:40.000000000 +0100
       
    37 @@ -44,7 +44,8 @@
       
    38  .B o
       
    39  A default configuration file is scanned for.  A file named
       
    40  \fIwebalizer.conf\fP is searched for in the current directory, and if
       
    41 -found, it's configuration data is parsed.  If the file is not
       
    42 +found, and is owned by the invoking user, then its configuration data is parsed.  
       
    43 +If the file is not
       
    44  present in the current directory,  the file \fI/etc/webalizer.conf\fP
       
    45  is searched for and, if found, is used instead.
       
    46  .TP 8