From 4cd7f85410ae9590fa4dd274a9c77604b3b8d4fc Mon Sep 17 00:00:00 2001 From: James Housley Date: Wed, 27 Jun 2007 20:15:48 +0000 Subject: 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 --- lib/url.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/url.c') 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 */ -- cgit v1.2.3