]> git.pld-linux.org Git - packages/pure-ftpd.git/blame - pure-ftpd-auth-can-delete-pure.patch
- fix pureftpd.passwd and pureftpd.pdb location in manuals
[packages/pure-ftpd.git] / pure-ftpd-auth-can-delete-pure.patch
CommitLineData
eac22afb
AM
1diff -urN pure-ftpd-1.0.21.org/src/ftpd.c pure-ftpd-1.0.21/src/ftpd.c
2--- pure-ftpd-1.0.21.org/src/ftpd.c 2006-02-16 10:28:16.000000000 +0100
3+++ pure-ftpd-1.0.21/src/ftpd.c 2006-02-21 12:58:34.192710136 +0100
4@@ -705,7 +705,7 @@
1e216f85
AM
5 * with a dot are only allowed to root and to users
6 * chroot()ed in their home directories -Jedi. */
7
8-static int checknamesanity(const char *name, int dot_ok)
9+static int checknamesanity(const char *name, int dot_ok, int is_dele)
10 {
11 register const char *namepnt;
12
eac22afb 13@@ -735,7 +735,7 @@
1e216f85
AM
14 return -1; /* .ftpquota => *NO* */
15 }
16 #endif
17- if (strstr(namepnt, PUREFTPD_TMPFILE_PREFIX) != NULL) {
18+ if ((!(is_dele && guest == 0)) && strstr(namepnt, PUREFTPD_TMPFILE_PREFIX) != NULL) {
19 return -1;
20 }
21 while (*namepnt != 0) {
eac22afb 22@@ -1916,7 +1916,7 @@
1e216f85
AM
23 }
24 }
25 }
26- if (checknamesanity(where, dot_read_ok) != 0) {
27+ if (checknamesanity(where, dot_read_ok, 0) != 0) {
28 addreply(550, MSG_SANITY_FILE_FAILURE, where);
29 return;
30 }
eac22afb 31@@ -2473,7 +2473,7 @@
1e216f85
AM
32 addreply_noformat(501, MSG_NO_FILE_NAME);
33 return;
34 }
35- if (checknamesanity(name, dot_write_ok) != 0) {
36+ if (checknamesanity(name, dot_write_ok, 0) != 0) {
37 addreply(550, MSG_SANITY_FILE_FAILURE, name);
38 return;
39 }
eac22afb
AM
40@@ -2531,7 +2531,7 @@
41 addreply_noformat(501, MSG_NO_FILE_NAME);
42 return;
43 }
44- if (checknamesanity(name, dot_write_ok) != 0) {
45+ if (checknamesanity(name, dot_write_ok, 0) != 0) {
46 addreply(550, MSG_SANITY_FILE_FAILURE, name);
47 return;
48 }
49@@ -2566,7 +2566,7 @@
1e216f85
AM
50 addreply_noformat(501, MSG_NO_FILE_NAME);
51 return;
52 }
53- if (checknamesanity(name, dot_write_ok) != 0) {
54+ if (checknamesanity(name, dot_write_ok, 1) != 0) {
55 addreply(550, MSG_SANITY_FILE_FAILURE, name);
56 return;
57 }
eac22afb 58@@ -2854,7 +2854,7 @@
1e216f85
AM
59 goto end;
60 }
61 # endif
62- if (checknamesanity(name, dot_read_ok) != 0) {
63+ if (checknamesanity(name, dot_read_ok, 0) != 0) {
64 addreply(550, MSG_SANITY_FILE_FAILURE, name);
65 goto end;
66 }
eac22afb 67@@ -3346,7 +3346,7 @@
1e216f85
AM
68 addreply_noformat(550, MSG_ANON_CANT_MKD);
69 return;
70 }
71- if (checknamesanity(name, dot_write_ok) != 0) {
72+ if (checknamesanity(name, dot_write_ok, 0) != 0) {
73 addreply_noformat(550, MSG_SANITY_DIRECTORY_FAILURE);
74 return;
75 }
eac22afb 76@@ -3384,7 +3384,7 @@
1e216f85
AM
77 return;
78 }
79 #endif
80- if (checknamesanity(name, dot_write_ok) != 0) {
81+ if (checknamesanity(name, dot_write_ok, 0) != 0) {
82 addreply_noformat(550, MSG_SANITY_DIRECTORY_FAILURE);
83 return;
84 }
eac22afb 85@@ -3686,7 +3686,7 @@
1e216f85
AM
86 }
87 }
88 cantcheckspace:
89- if (checknamesanity(name, dot_write_ok) != 0 ||
90+ if (checknamesanity(name, dot_write_ok, 0) != 0 ||
91 (atomic_file = get_atomic_file(name)) == NULL) {
92 addreply(553, MSG_SANITY_FILE_FAILURE, name);
93 /* implicit : atomic_file = NULL */
eac22afb 94@@ -4093,7 +4093,7 @@
1e216f85
AM
95 addreply_noformat(550, MSG_RENAME_FAILURE);
96 return;
97 }
98- if (checknamesanity(name, dot_write_ok) != 0) {
99+ if (checknamesanity(name, dot_write_ok, 0) != 0) {
100 addreply(550, MSG_SANITY_FILE_FAILURE, name);
101 return;
102 }
eac22afb 103@@ -4123,7 +4123,7 @@
1e216f85
AM
104 addreply_noformat(503, MSG_RENAME_NORNFR);
105 goto bye;
106 }
107- if (checknamesanity(name, dot_write_ok) != 0) {
108+ if (checknamesanity(name, dot_write_ok, 0) != 0) {
109 addreply(550, MSG_SANITY_FILE_FAILURE, name);
110 return; /* don't clear rnfrom buffer */
111 }
eac22afb 112
This page took 0.080339 seconds and 4 git commands to generate.