rpms/vsftpd/devel vsftpd-1.2.1-nonrootconf.patch, 1.2, 1.3 vsftpd.spec, 1.81, 1.82 vsftpd-2.0.5-file_stat.patch, 1.1, NONE

Martin Nagy (mnagy) fedora-extras-commits at redhat.com
Tue Jul 1 13:47:30 UTC 2008


Author: mnagy

Update of /cvs/extras/rpms/vsftpd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27647

Modified Files:
	vsftpd-1.2.1-nonrootconf.patch vsftpd.spec 
Removed Files:
	vsftpd-2.0.5-file_stat.patch 
Log Message:
Fix memory leak in nonrootconf patch and merge it with file_stat patch.


vsftpd-1.2.1-nonrootconf.patch:

Index: vsftpd-1.2.1-nonrootconf.patch
===================================================================
RCS file: /cvs/extras/rpms/vsftpd/devel/vsftpd-1.2.1-nonrootconf.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vsftpd-1.2.1-nonrootconf.patch	30 Nov 2007 13:34:01 -0000	1.2
+++ vsftpd-1.2.1-nonrootconf.patch	1 Jul 2008 13:46:33 -0000	1.3
@@ -1,29 +1,6 @@
---- vsftpd-2.0.1/twoprocess.c.nonrootconf	2004-07-02 18:47:51.000000000 +0200
-+++ vsftpd-2.0.1/twoprocess.c	2005-02-08 09:37:26.641905544 +0100
-@@ -416,11 +416,17 @@
-   str_append_char(&filename_str, '/');
-   str_append_str(&filename_str, p_user_str);
-   retval = str_stat(&filename_str, &p_statbuf);
--  /* Security - ignore unless owned by root */
--  if (!vsf_sysutil_retval_is_error(retval) &&
--      vsf_sysutil_statbuf_get_uid(p_statbuf) == VSFTP_ROOT_UID)
-+  /* Security - die unless owned by root */
-+  if (!vsf_sysutil_retval_is_error(retval))
-   {
--    vsf_parseconf_load_file(str_getbuf(&filename_str), 1);
-+    if (vsf_sysutil_statbuf_get_uid(p_statbuf) == VSFTP_ROOT_UID)
-+    {
-+      vsf_parseconf_load_file(str_getbuf(&filename_str), 1);
-+    }
-+    else
-+    {
-+      die("reading non-root config file"); 
-+    }
-   }
-   str_free(&filename_str);
-   vsf_sysutil_free(p_statbuf);
---- vsftpd-2.0.1/parseconf.c.nonrootconf	2004-07-02 13:23:56.000000000 +0200
-+++ vsftpd-2.0.1/parseconf.c	2005-02-08 09:37:26.642905392 +0100
+diff -up vsftpd-2.0.6/parseconf.c.nonrootconf vsftpd-2.0.6/parseconf.c
+--- vsftpd-2.0.6/parseconf.c.nonrootconf	2008-02-12 05:53:32.000000000 +0100
++++ vsftpd-2.0.6/parseconf.c	2008-07-01 12:28:12.000000000 +0200
 @@ -15,6 +15,7 @@
  #include "defs.h"
  #include "sysutil.h"
@@ -32,7 +9,7 @@
  
  static const char* s_p_saved_filename;
  static int s_strings_copied;
-@@ -167,6 +168,8 @@
+@@ -182,6 +183,8 @@ vsf_parseconf_load_file(const char* p_fi
    struct mystr config_file_str = INIT_MYSTR;
    struct mystr config_setting_str = INIT_MYSTR;
    struct mystr config_value_str = INIT_MYSTR;
@@ -41,20 +18,54 @@
    unsigned int str_pos = 0;
    int retval;
    if (!p_filename)
-@@ -195,7 +198,9 @@
+@@ -210,7 +213,9 @@ vsf_parseconf_load_file(const char* p_fi
      copy_string_settings();
    }
    retval = str_fileread(&config_file_str, p_filename, VSFTP_CONF_FILE_MAX);
 -  if (vsf_sysutil_retval_is_error(retval))
-+  (int)str_stat(&config_file_str, &p_statbuf);
++  (int)vsf_sysutil_stat(p_filename, &p_statbuf);
 +  /* Security - die unless the conf file is owned by root */ 
 +  if (vsf_sysutil_retval_is_error(retval) || vsf_sysutil_statbuf_get_uid(p_statbuf) != VSFTP_ROOT_UID)
    {
      if (errs_fatal)
      {
---- vsftpd-2.0.1/vsftpd.8.nonrootconf	2005-02-08 09:37:26.000000000 +0100
-+++ vsftpd-2.0.1/vsftpd.8	2005-02-08 09:44:21.173887104 +0100
-@@ -28,7 +28,8 @@
+@@ -221,6 +226,7 @@ vsf_parseconf_load_file(const char* p_fi
+       return;
+     }
+   }
++  vsf_sysutil_free(p_statbuf);
+   while (str_getline(&config_file_str, &config_setting_str, &str_pos))
+   {
+     if (str_isempty(&config_setting_str) ||
+diff -up vsftpd-2.0.6/twoprocess.c.nonrootconf vsftpd-2.0.6/twoprocess.c
+--- vsftpd-2.0.6/twoprocess.c.nonrootconf	2008-02-12 04:18:34.000000000 +0100
++++ vsftpd-2.0.6/twoprocess.c	2008-07-01 12:21:28.000000000 +0200
+@@ -423,11 +423,17 @@ handle_per_user_config(const struct myst
+   str_append_char(&filename_str, '/');
+   str_append_str(&filename_str, p_user_str);
+   retval = str_stat(&filename_str, &p_statbuf);
+-  /* Security - ignore unless owned by root */
+-  if (!vsf_sysutil_retval_is_error(retval) &&
+-      vsf_sysutil_statbuf_get_uid(p_statbuf) == VSFTP_ROOT_UID)
++  /* Security - die unless owned by root */
++  if (!vsf_sysutil_retval_is_error(retval))
+   {
+-    vsf_parseconf_load_file(str_getbuf(&filename_str), 1);
++    if (vsf_sysutil_statbuf_get_uid(p_statbuf) == VSFTP_ROOT_UID)
++    {
++      vsf_parseconf_load_file(str_getbuf(&filename_str), 1);
++    }
++    else
++    {
++      die("reading non-root config file"); 
++    }
+   }
+   str_free(&filename_str);
+   vsf_sysutil_free(p_statbuf);
+diff -up vsftpd-2.0.6/vsftpd.8.nonrootconf vsftpd-2.0.6/vsftpd.8
+--- vsftpd-2.0.6/vsftpd.8.nonrootconf	2008-07-01 12:21:28.000000000 +0200
++++ vsftpd-2.0.6/vsftpd.8	2008-07-01 12:21:28.000000000 +0200
+@@ -28,7 +28,8 @@ binary will then launch the FTP service 
  .Sh OPTIONS
  An optional
  .Op configuration file


Index: vsftpd.spec
===================================================================
RCS file: /cvs/extras/rpms/vsftpd/devel/vsftpd.spec,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- vsftpd.spec	20 Jun 2008 21:03:03 -0000	1.81
+++ vsftpd.spec	1 Jul 2008 13:46:33 -0000	1.82
@@ -33,7 +33,6 @@
 Patch21: vsftpd-2.0.5-correct_comments.patch
 Patch22: vsftpd-2.0.5-man.patch
 Patch23: vsftpd-2.0.4-filter.patch
-Patch24: vsftpd-2.0.5-file_stat.patch
 Patch26: vsftpd-2.0.5-bind_denied.patch
 Patch29: vsftpd-2.0.5-pasv_dot.patch
 Patch30: vsftpd-2.0.5-pam_end.patch
@@ -91,7 +90,6 @@
 %patch21 -p1 -b .comments
 %patch22 -p1 -b .manp
 %patch23 -p1 -b .filter
-%patch24 -p1 -b .file_stat
 %patch26 -p1 -b .bind_denied
 %patch29 -p1 -b .pasv_dot
 %patch30 -p1 -b .pam_end


--- vsftpd-2.0.5-file_stat.patch DELETED ---




More information about the fedora-extras-commits mailing list