aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorJames Housley <jim@thehousleys.net>2007-06-27 20:15:48 +0000
committerJames Housley <jim@thehousleys.net>2007-06-27 20:15:48 +0000
commit4cd7f85410ae9590fa4dd274a9c77604b3b8d4fc (patch)
treefd45dc75b67be9ca91e816485e959eb1fceb8621 /lib/url.c
parentedd35cab5cbe0872b19b98936b58e4941c93de12 (diff)
Add two new options for the SFTP/SCP/FILE protocols: CURLOPT_NEW_FILE_PERMS
and CURLOPT_NEW_DIRECTORY_PERMS. These control the premissions for files and directories created on the remote server. CURLOPT_NEW_FILE_PERMS defaults to 0644 and CURLOPT_NEW_DIRECTORY_PERMS defaults to 0755
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 789959762..b5b83effb 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -595,6 +595,8 @@ CURLcode Curl_open(struct SessionHandle **curl)
data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
type */
+ data->set.new_file_perms = 0644; /* Default permissions */
+ data->set.new_directory_perms = 0755; /* Default permissions */
/* most recent connection is not yet defined */
data->state.lastconnect = -1;
@@ -1759,6 +1761,21 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
*/
data->set.http_ce_skip = (bool)(0 == va_arg(param, long));
break;
+
+ case CURLOPT_NEW_FILE_PERMS:
+ /*
+ * Uses these permissions instead of 0644
+ */
+ data->set.new_file_perms = va_arg(param, long);
+ break;
+
+ case CURLOPT_NEW_DIRECTORY_PERMS:
+ /*
+ * Uses these permissions instead of 0755
+ */
+ data->set.new_directory_perms = va_arg(param, long);
+ break;
+
default:
/* unknown tag and its companion, just ignore: */
result = CURLE_FAILED_INIT; /* correct this */