SOURCES: pure-ftpd-auth-can-delete-pure.patch (NEW) - authorized u...
arekm
arekm at pld-linux.org
Wed Oct 12 14:10:59 CEST 2005
Author: arekm Date: Wed Oct 12 12:10:59 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- authorized users can now delete files like .pureftpd-upload.43425ad9.15.48d1.b571dd47
---- Files affected:
SOURCES:
pure-ftpd-auth-can-delete-pure.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/pure-ftpd-auth-can-delete-pure.patch
diff -u /dev/null SOURCES/pure-ftpd-auth-can-delete-pure.patch:1.1
--- /dev/null Wed Oct 12 14:10:59 2005
+++ SOURCES/pure-ftpd-auth-can-delete-pure.patch Wed Oct 12 14:10:54 2005
@@ -0,0 +1,102 @@
+diff -urN pure-ftpd-1.0.20.org/src/ftpd.c pure-ftpd-1.0.20/src/ftpd.c
+--- pure-ftpd-1.0.20.org/src/ftpd.c 2004-07-17 15:28:22.000000000 +0200
++++ pure-ftpd-1.0.20/src/ftpd.c 2005-10-12 14:06:11.200877672 +0200
+@@ -637,7 +637,7 @@
+ * with a dot are only allowed to root and to users
+ * chroot()ed in their home directories -Jedi. */
+
+-static int checknamesanity(const char *name, int dot_ok)
++static int checknamesanity(const char *name, int dot_ok, int is_dele)
+ {
+ register const char *namepnt;
+
+@@ -667,7 +667,7 @@
+ return -1; /* .ftpquota => *NO* */
+ }
+ #endif
+- if (strstr(namepnt, PUREFTPD_TMPFILE_PREFIX) != NULL) {
++ if ((!(is_dele && guest == 0)) && strstr(namepnt, PUREFTPD_TMPFILE_PREFIX) != NULL) {
+ return -1;
+ }
+ while (*namepnt != 0) {
+@@ -1839,7 +1839,7 @@
+ }
+ }
+ }
+- if (checknamesanity(where, dot_read_ok) != 0) {
++ if (checknamesanity(where, dot_read_ok, 0) != 0) {
+ addreply(550, MSG_SANITY_FILE_FAILURE, where);
+ return;
+ }
+@@ -2397,7 +2397,7 @@
+ addreply_noformat(501, MSG_NO_FILE_NAME);
+ return;
+ }
+- if (checknamesanity(name, dot_write_ok) != 0) {
++ if (checknamesanity(name, dot_write_ok, 0) != 0) {
+ addreply(550, MSG_SANITY_FILE_FAILURE, name);
+ return;
+ }
+@@ -2453,7 +2453,7 @@
+ addreply_noformat(501, MSG_NO_FILE_NAME);
+ return;
+ }
+- if (checknamesanity(name, dot_write_ok) != 0) {
++ if (checknamesanity(name, dot_write_ok, 1) != 0) {
+ addreply(550, MSG_SANITY_FILE_FAILURE, name);
+ return;
+ }
+@@ -2740,7 +2740,7 @@
+ goto end;
+ }
+ # endif
+- if (checknamesanity(name, dot_read_ok) != 0) {
++ if (checknamesanity(name, dot_read_ok, 0) != 0) {
+ addreply(550, MSG_SANITY_FILE_FAILURE, name);
+ goto end;
+ }
+@@ -3227,7 +3227,7 @@
+ addreply_noformat(550, MSG_ANON_CANT_MKD);
+ return;
+ }
+- if (checknamesanity(name, dot_write_ok) != 0) {
++ if (checknamesanity(name, dot_write_ok, 0) != 0) {
+ addreply_noformat(550, MSG_SANITY_DIRECTORY_FAILURE);
+ return;
+ }
+@@ -3265,7 +3265,7 @@
+ return;
+ }
+ #endif
+- if (checknamesanity(name, dot_write_ok) != 0) {
++ if (checknamesanity(name, dot_write_ok, 0) != 0) {
+ addreply_noformat(550, MSG_SANITY_DIRECTORY_FAILURE);
+ return;
+ }
+@@ -3561,7 +3561,7 @@
+ }
+ }
+ cantcheckspace:
+- if (checknamesanity(name, dot_write_ok) != 0 ||
++ if (checknamesanity(name, dot_write_ok, 0) != 0 ||
+ (atomic_file = get_atomic_file(name)) == NULL) {
+ addreply(553, MSG_SANITY_FILE_FAILURE, name);
+ /* implicit : atomic_file = NULL */
+@@ -3968,7 +3968,7 @@
+ addreply_noformat(550, MSG_RENAME_FAILURE);
+ return;
+ }
+- if (checknamesanity(name, dot_write_ok) != 0) {
++ if (checknamesanity(name, dot_write_ok, 0) != 0) {
+ addreply(550, MSG_SANITY_FILE_FAILURE, name);
+ return;
+ }
+@@ -3998,7 +3998,7 @@
+ addreply_noformat(503, MSG_RENAME_NORNFR);
+ goto bye;
+ }
+- if (checknamesanity(name, dot_write_ok) != 0) {
++ if (checknamesanity(name, dot_write_ok, 0) != 0) {
+ addreply(550, MSG_SANITY_FILE_FAILURE, name);
+ return; /* don't clear rnfrom buffer */
+ }
================================================================
More information about the pld-cvs-commit
mailing list