cceb2ea
--- vsftpd-2.0.1/twoprocess.c.nonrootconf	2004-07-02 18:47:51.000000000 +0200
cceb2ea
+++ vsftpd-2.0.1/twoprocess.c	2005-02-08 09:37:26.641905544 +0100
cceb2ea
@@ -416,12 +416,16 @@
cceb2ea
   str_append_char(&filename_str, '/');
cceb2ea
   str_append_str(&filename_str, p_user_str);
cceb2ea
   retval = str_stat(&filename_str, &p_statbuf);
cceb2ea
-  /* Security - ignore unless owned by root */
cceb2ea
+  /* Security - die unless owned by root */
cceb2ea
   if (!vsf_sysutil_retval_is_error(retval) &&
cceb2ea
       vsf_sysutil_statbuf_get_uid(p_statbuf) == VSFTP_ROOT_UID)
cceb2ea
   {
cceb2ea
     vsf_parseconf_load_file(str_getbuf(&filename_str), 1);
cceb2ea
   }
cceb2ea
+  else
cceb2ea
+  {
cceb2ea
+    die("reading non-root config file"); 
cceb2ea
+  }
cceb2ea
   str_free(&filename_str);
cceb2ea
   vsf_sysutil_free(p_statbuf);
cceb2ea
 }
cceb2ea
--- vsftpd-2.0.1/parseconf.c.nonrootconf	2004-07-02 13:23:56.000000000 +0200
cceb2ea
+++ vsftpd-2.0.1/parseconf.c	2005-02-08 09:37:26.642905392 +0100
cceb2ea
@@ -15,6 +15,7 @@
cceb2ea
 #include "defs.h"
cceb2ea
 #include "sysutil.h"
cceb2ea
 #include "utility.h"
cceb2ea
+#include "sysstr.h"
cceb2ea
 
cceb2ea
 static const char* s_p_saved_filename;
cceb2ea
 static int s_strings_copied;
cceb2ea
@@ -167,6 +168,8 @@
cceb2ea
   struct mystr config_file_str = INIT_MYSTR;
cceb2ea
   struct mystr config_setting_str = INIT_MYSTR;
cceb2ea
   struct mystr config_value_str = INIT_MYSTR;
cceb2ea
+  struct vsf_sysutil_statbuf* p_statbuf = 0;
cceb2ea
+  
cceb2ea
   unsigned int str_pos = 0;
cceb2ea
   int retval;
cceb2ea
   if (!p_filename)
cceb2ea
@@ -195,7 +198,9 @@
cceb2ea
     copy_string_settings();
cceb2ea
   }
cceb2ea
   retval = str_fileread(&config_file_str, p_filename, VSFTP_CONF_FILE_MAX);
cceb2ea
-  if (vsf_sysutil_retval_is_error(retval))
cceb2ea
+  (int)str_stat(&config_file_str, &p_statbuf);
cceb2ea
+  /* Security - die unless the conf file is owned by root */ 
cceb2ea
+  if (vsf_sysutil_retval_is_error(retval) || vsf_sysutil_statbuf_get_uid(p_statbuf) != VSFTP_ROOT_UID)
cceb2ea
   {
cceb2ea
     if (errs_fatal)
cceb2ea
     {
cceb2ea
--- vsftpd-2.0.1/vsftpd.8.nonrootconf	2005-02-08 09:37:26.000000000 +0100
cceb2ea
+++ vsftpd-2.0.1/vsftpd.8	2005-02-08 09:44:21.173887104 +0100
cceb2ea
@@ -28,7 +28,8 @@
cceb2ea
 .Sh OPTIONS
cceb2ea
 An optional
cceb2ea
 .Op configuration file
cceb2ea
-may be given on the command line.  The default configuration file is
cceb2ea
+may be given on the command line. This configuration files has to be owned by
cceb2ea
+root. The default configuration file is
cceb2ea
 .Pa /etc/vsftpd/vsftpd.conf .
cceb2ea
 .Sh SEE ALSO
cceb2ea
 .Xr vsftpd.conf 5