diff options
author | James Housley <jim@thehousleys.net> | 2007-06-27 20:15:48 +0000 |
---|---|---|
committer | James Housley <jim@thehousleys.net> | 2007-06-27 20:15:48 +0000 |
commit | 4cd7f85410ae9590fa4dd274a9c77604b3b8d4fc (patch) | |
tree | fd45dc75b67be9ca91e816485e959eb1fceb8621 /lib/url.c | |
parent | edd35cab5cbe0872b19b98936b58e4941c93de12 (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.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 */ |