SHA256
1
0
forked from pool/vsftpd

- Add service calls for other unit files too

- WIP udate filter patch to work as expected:
  * vsftpd-2.1.0-filter.patch

OBS-URL: https://build.opensuse.org/package/show/network/vsftpd?expand=0&rev=71
This commit is contained in:
Tomáš Chvátal 2015-02-20 12:14:28 +00:00 committed by Git OBS Bridge
parent 67c49824e6
commit e1041567b4
3 changed files with 67 additions and 25 deletions

View File

@ -1,7 +1,42 @@
diff -up vsftpd-2.1.0/ls.c.filter vsftpd-2.1.0/ls.c Index: vsftpd-3.0.2/ls.c
--- vsftpd-2.1.0/ls.c.filter 2008-02-02 02:30:41.000000000 +0100 ===================================================================
+++ vsftpd-2.1.0/ls.c 2009-01-08 19:31:15.000000000 +0100 --- vsftpd-3.0.2.orig/ls.c
@@ -239,9 +239,31 @@ vsf_filename_passes_filter(const struct +++ vsftpd-3.0.2/ls.c
@@ -117,16 +117,6 @@ vsf_ls_populate_dir_list(struct mystr_li
{
continue;
}
- /* If we have an ls option which is a filter, apply it */
- if (!str_isempty(p_filter_str))
- {
- unsigned int iters = 0;
- if (!vsf_filename_passes_filter(&s_next_filename_str, p_filter_str,
- &iters))
- {
- continue;
- }
- }
/* Calculate the full path (relative to CWD) for lstat() and
* output purposes
*/
@@ -144,6 +134,16 @@ vsf_ls_populate_dir_list(struct mystr_li
continue;
}
}
+ /* If we have an ls option which is a filter, apply it */
+ if (!str_isempty(p_filter_str))
+ {
+ unsigned int iters = 0;
+ if (!vsf_filename_passes_filter(&s_next_path_and_filename_str, p_filter_str,
+ &iters))
+ {
+ continue;
+ }
+ }
if (is_verbose)
{
static struct mystr s_final_file_str;
@@ -246,8 +246,30 @@ vsf_filename_passes_filter(const struct
int ret = 0; int ret = 0;
char last_token = 0; char last_token = 0;
int must_match_at_current_pos = 1; int must_match_at_current_pos = 1;
@ -9,7 +44,6 @@ diff -up vsftpd-2.1.0/ls.c.filter vsftpd-2.1.0/ls.c
+ +
str_copy(&filter_remain_str, p_filter_str); str_copy(&filter_remain_str, p_filter_str);
- str_copy(&name_remain_str, p_filename_str); - str_copy(&name_remain_str, p_filename_str);
-
+ +
+ if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) { + if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) {
+ if (str_get_char_at(p_filter_str, 0) == '/') { + if (str_get_char_at(p_filter_str, 0) == '/') {
@ -31,14 +65,14 @@ diff -up vsftpd-2.1.0/ls.c.filter vsftpd-2.1.0/ls.c
+ } + }
+ } else + } else
+ str_copy(&name_remain_str, p_filename_str); + str_copy(&name_remain_str, p_filename_str);
+
while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX) while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX)
{ {
static struct mystr s_match_needed_str; Index: vsftpd-3.0.2/str.c
diff -up vsftpd-2.1.0/str.c.filter vsftpd-2.1.0/str.c ===================================================================
--- vsftpd-2.1.0/str.c.filter 2008-12-17 06:54:16.000000000 +0100 --- vsftpd-3.0.2.orig/str.c
+++ vsftpd-2.1.0/str.c 2009-01-08 19:31:15.000000000 +0100 +++ vsftpd-3.0.2/str.c
@@ -680,3 +680,14 @@ str_replace_unprintable(struct mystr* p_ @@ -770,3 +770,14 @@ str_replace_unprintable(struct mystr* p_
} }
} }
@ -53,10 +87,11 @@ diff -up vsftpd-2.1.0/str.c.filter vsftpd-2.1.0/str.c
+ if (str_isempty(d_str)) + if (str_isempty(d_str))
+ str_copy (d_str, path); + str_copy (d_str, path);
+} +}
diff -up vsftpd-2.1.0/str.h.filter vsftpd-2.1.0/str.h Index: vsftpd-3.0.2/str.h
--- vsftpd-2.1.0/str.h.filter 2008-12-17 06:53:23.000000000 +0100 ===================================================================
+++ vsftpd-2.1.0/str.h 2009-01-08 19:32:14.000000000 +0100 --- vsftpd-3.0.2.orig/str.h
@@ -100,6 +100,7 @@ void str_replace_unprintable(struct myst +++ vsftpd-3.0.2/str.h
@@ -101,6 +101,7 @@ void str_replace_unprintable(struct myst
int str_atoi(const struct mystr* p_str); int str_atoi(const struct mystr* p_str);
filesize_t str_a_to_filesize_t(const struct mystr* p_str); filesize_t str_a_to_filesize_t(const struct mystr* p_str);
unsigned int str_octal_to_uint(const struct mystr* p_str); unsigned int str_octal_to_uint(const struct mystr* p_str);

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Feb 20 12:13:42 UTC 2015 - tchvatal@suse.com
- Add service calls for other unit files too
- WIP udate filter patch to work as expected:
* vsftpd-2.1.0-filter.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jan 2 10:32:53 UTC 2015 - tchvatal@suse.com Fri Jan 2 10:32:53 UTC 2015 - tchvatal@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package vsftpd # spec file for package vsftpd
# #
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -129,16 +129,16 @@ install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/s
%pre %pre
%{_sbindir}/useradd -r -g nogroup -s /bin/false -c "Secure FTP User" -d %{_localstatedir}/lib/empty ftpsecure 2> /dev/null || : %{_sbindir}/useradd -r -g nogroup -s /bin/false -c "Secure FTP User" -d %{_localstatedir}/lib/empty ftpsecure 2> /dev/null || :
%service_add_pre %{name}.service %service_add_pre %{name}.service %{name}@.service %{name}.socket
%preun %preun
%service_del_preun %{name}.service %service_del_preun %{name}.service %{name}@.service %{name}.socket
%post %post
%service_add_post %{name}.service %service_add_post %{name}.service %{name}@.service %{name}.socket
%postun %postun
%service_del_postun %{name}.service %service_del_postun %{name}.service %{name}@.service %{name}.socket
%files %files
%defattr(-,root,root) %defattr(-,root,root)