Change scp API to use integers for perms

This commit is contained in:
Aris Adamantiadis
2009-09-02 16:34:32 +03:00
parent 86e6444656
commit 07a9e6b7c6
3 changed files with 53 additions and 28 deletions

View File

@@ -208,7 +208,7 @@ typedef int socket_t;
#define SSH_AGAIN -2 /* The nonblocking call must be repeated */
#define SSH_EOF -127 /* We have already a eof */
LIBSSH_API const char *ssh_get_error(void *error);
LIBSSH_API const char *ssh_get_error(void *error);
LIBSSH_API int ssh_get_error_code(void *error);
/* version checks */
@@ -217,7 +217,7 @@ LIBSSH_API const char *ssh_version(int req_version);
/** \addtogroup ssh_log
* @{
*/
/** \brief Verbosity level for logging and help to debugging
/** \brief Verbosity level for logging and help to debugging
*/
enum {
@@ -227,15 +227,15 @@ enum {
/** Only rare and noteworthy events
*/
SSH_LOG_RARE,
/** High level protocol informations
/** High level protocol informations
*/
SSH_LOG_PROTOCOL,
/** Lower level protocol infomations, packet level
*/
SSH_LOG_PACKET,
SSH_LOG_PACKET,
/** Every function path
*/
SSH_LOG_FUNCTIONS
SSH_LOG_FUNCTIONS
};
/** @}
*/
@@ -405,7 +405,7 @@ LIBSSH_API int ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback
/* buffer.c */
/** creates a new buffer
/** creates a new buffer
*/
LIBSSH_API ssh_buffer buffer_new(void);
LIBSSH_API void buffer_free(ssh_buffer buffer);
@@ -481,16 +481,16 @@ LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *locati
LIBSSH_API int ssh_scp_init(ssh_scp scp);
LIBSSH_API int ssh_scp_close(ssh_scp scp);
LIBSSH_API void ssh_scp_free(ssh_scp scp);
LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, const char *perms);
LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode);
LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp);
LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, const char *perms);
LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms);
LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len);
LIBSSH_API int ssh_scp_pull_request(ssh_scp scp);
LIBSSH_API int ssh_scp_deny_request(ssh_scp scp, const char *reason);
LIBSSH_API int ssh_scp_accept_request(ssh_scp scp);
LIBSSH_API int ssh_scp_read(ssh_scp scp, void *buffer, size_t size);
LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp);
LIBSSH_API const char *ssh_scp_request_get_permissions(ssh_scp scp);
LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp);
LIBSSH_API size_t ssh_scp_request_get_size(ssh_scp scp);

View File

@@ -371,7 +371,7 @@ struct ssh_scp_struct {
size_t processed;
enum ssh_scp_request_types request_type;
char *request_name;
char *request_mode;
int request_mode;
};
struct ssh_message_struct;
@@ -864,6 +864,8 @@ int ssh_execute_message_callbacks(SSH_SESSION *session);
/* scp.c */
int ssh_scp_read_string(ssh_scp scp, char *buffer, size_t len);
int ssh_scp_integer_mode(const char *mode);
char *ssh_scp_string_mode(int mode);
/* log.c */
@@ -872,7 +874,7 @@ int ssh_scp_read_string(ssh_scp scp, char *buffer, size_t len);
#define __FUNCTION__ __func__
#endif
#endif
#define _enter_function(sess) \
do {\
if((sess)->log_verbosity >= SSH_LOG_FUNCTIONS){ \