Blame SOURCES/0073-curl-7.29.0-post-cdev.patch

a8283e
From f4ae40a0e8a35d18a7b8560980b9408d7b06ba8c Mon Sep 17 00:00:00 2001
a8283e
From: Daniel Stenberg <daniel@haxx.se>
a8283e
Date: Mon, 4 Mar 2013 15:20:22 +0100
a8283e
Subject: [PATCH] AddFormData: prevent only directories from being posted
a8283e
MIME-Version: 1.0
a8283e
Content-Type: text/plain; charset=UTF-8
a8283e
Content-Transfer-Encoding: 8bit
a8283e
a8283e
Commit f4cc54cb4746ae5a6d (shipped as part of the 7.29.0 release) was a
a8283e
bug fix that introduced a regression in that while trying to avoid
a8283e
allowing directory names, it also forbade "special" files like character
a8283e
devices and more. like "/dev/null" as was used by Oliver who reported
a8283e
this regression.
a8283e
a8283e
Reported by: Oliver Gondža
a8283e
Bug: http://curl.haxx.se/mail/archive-2013-02/0040.html
a8283e
a8283e
Upstream-commit: 26eaa8383001219e7cd14a153dff95ea9274be6e
a8283e
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
a8283e
---
a8283e
 lib/formdata.c | 2 +-
a8283e
 1 file changed, 1 insertion(+), 1 deletion(-)
a8283e
a8283e
diff --git a/lib/formdata.c b/lib/formdata.c
a8283e
index 0da6de3..28f9a32 100644
a8283e
--- a/lib/formdata.c
a8283e
+++ b/lib/formdata.c
a8283e
@@ -796,7 +796,7 @@ static CURLcode AddFormData(struct FormData **formp,
a8283e
          file */
a8283e
       if(!strequal("-", newform->line)) {
a8283e
         struct_stat file;
a8283e
-        if(!stat(newform->line, &file) && S_ISREG(file.st_mode))
a8283e
+        if(!stat(newform->line, &file) && !S_ISDIR(file.st_mode))
a8283e
           *size += file.st_size;
a8283e
         else
a8283e
           return CURLE_BAD_FUNCTION_ARGUMENT;
a8283e
-- 
a8283e
2.20.1
a8283e