version 1.16, 2001/02/04 15:23:08 |
version 1.17, 2001/02/04 15:32:25 |
|
|
int |
int |
handle_to_fd(int handle) |
handle_to_fd(int handle) |
{ |
{ |
if (handle_is_ok(handle, HANDLE_FILE)) |
if (handle_is_ok(handle, HANDLE_FILE)) |
return handles[handle].fd; |
return handles[handle].fd; |
return -1; |
return -1; |
} |
} |
|
|
id = get_int(); |
id = get_int(); |
path = get_string(NULL); |
path = get_string(NULL); |
TRACE("opendir id %d path %s", id, path); |
TRACE("opendir id %d path %s", id, path); |
dirp = opendir(path); |
dirp = opendir(path); |
if (dirp == NULL) { |
if (dirp == NULL) { |
status = errno_to_portable(errno); |
status = errno_to_portable(errno); |
} else { |
} else { |
|
|
send_handle(id, handle); |
send_handle(id, handle); |
status = SSH2_FX_OK; |
status = SSH2_FX_OK; |
} |
} |
|
|
} |
} |
if (status != SSH2_FX_OK) |
if (status != SSH2_FX_OK) |
send_status(id, status); |
send_status(id, status); |
|
|
handle_init(); |
handle_init(); |
|
|
#ifdef DEBUG_SFTP_SERVER |
#ifdef DEBUG_SFTP_SERVER |
log_init("sftp-server", SYSLOG_LEVEL_DEBUG1, SYSLOG_FACILITY_AUTH, 0); |
log_init("sftp-server", SYSLOG_LEVEL_DEBUG1, SYSLOG_FACILITY_AUTH, 0); |
#endif |
#endif |
|
|
in = dup(STDIN_FILENO); |
in = dup(STDIN_FILENO); |