| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The 'libguile-ssh' library would fail to build due to missing 'libssh_threads'
library that was removed libssh 0.8. This patch fixes that.
Reported by lantw44 in
<https://github.com/artyom-poptsov/guile-ssh/issues/9>
* configure.ac: Add check for libssh 0.8
* libguile-ssh/Makefile.am: Don't use 'libssh_threads' library when building
with libssh 0.8+.
* NEWS: Update.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'ptob_close' would always get a segfault when it tried to free a closed
channel. This patch fixes that by adding a check if a channel is already
closed.
Reported by Michael Bowcutt <mbowcutt@case.edu> in
<https://github.com/artyom-poptsov/guile-ssh/issues/8>
and Njagi Mwaniki in a personal email.
* libguile-ssh/channel-type.c (ptob_close): Check if a channel is already
closed before trying to close and free it. Improve logging.
* libguile-ssh/log.c (_gssh_log_debug, _gssh_log_debug1): New procedures
* libguile-ssh/log.h: Likewise.
|
| |
|
|
|
|
|
|
|
|
| |
See <https://bugs.gnu.org/26976>.
* libguile-ssh/channel-type.c (ptob_close): Move SCM_SETSTREAM(channel, NULL)
outside of "#if USING_GUILE_BEFORE_2_2".
* libguile-ssh/sftp-file-type.c (ptob_close): Likewise.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
| |
* libguile-ssh/session-func.c (guile_ssh_session_set): Throw an option along
with its value on an error.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
* libguile-ssh/channel-func.c (guile_ssh_channel_open_forward): Log a warning
if a forwarding channel could not be open.
* tests/tunnel.scm ("port forwarding, direct, disconnected session"): New test
case.
|
| |
|
|
|
|
| |
* libguile-ssh/channel-type.c (print_channel): Don't use 'SCM_PTAB_ENTRY'
macro if Guile 2.2 is used.
* libguile-ssh/channel-type.h (GSSH_VALIDATE_CHANNEL_DATA): Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile-ssh/channel-func.c (guile_ssh_channel_get_exit_status): Throw
'wrong-type-arg' if a freed channel is passed as an argument.
* libguile-ssh/channel-type.h (GSSH_VALIDATE_OPEN_CHANNEL): Check if a channel
is freed.
* tests/client-server.scm ("channel-get-exit-status, freed channel"): New test
case.
* tests/common.scm (test-error-with-log/=): Check error key and message
properly.
(test-error-with-log): Check an error key.
(test-error-with-log/handler): Remove extra rules.
* NEWS: Update.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Guile-SSH would always crash with SIGSEGV errors when tried to print a freed
channel object (e.g. after calling 'close' on a channel). This patch fixes
the bug.
* libguile-ssh/channel-type.c (print_channel): Bugfix: Handle freed channels
properly.
* tests/client-server.scm ("channel-request-exec, printing a freed channel"):
New test case.
* NEWS: Update.
|
| |
|
|
|
|
|
| |
* libguile-ssh/log.c (_gssh_log_warning): New procedure.
* libguile-ssh/log.h: Likewise.
* libguile-ssh/channel-func.c (guile_ssh_channel_get_exit_status): Issue a
warning if 'ssh_channel_get_exit_status' failed to get the exit status.
|
| |
|
|
|
|
| |
* libguile-ssh/log.c (_gssh_log_error): New procedure.
* libguile-ssh/log.h: Likewise.
* libguile-ssh/error.c (guile_ssh_error1): Use it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Among other things, this allows us to work around broken guile-snarf
handling of whitespace arguments in Guile 2.2.1:
<https://bugs.gnu.org/25803>.
* configure.ac: Use 'AC_CONFIG_HEADER'.
* libguile-ssh/auth.c,
libguile-ssh/channel-func.c,
libguile-ssh/channel-main.c,
libguile-ssh/channel-type.c,
libguile-ssh/common.c,
libguile-ssh/error.c,
libguile-ssh/key-func.c,
libguile-ssh/key-main.c,
libguile-ssh/key-type.c,
libguile-ssh/log.c,
libguile-ssh/message-func.c,
libguile-ssh/message-main.c,
libguile-ssh/message-type.c,
libguile-ssh/server-func.c,
libguile-ssh/server-main.c,
libguile-ssh/server-type.c,
libguile-ssh/session-func.c,
libguile-ssh/session-main.c,
libguile-ssh/session-type.c,
libguile-ssh/sftp-file-main.c,
libguile-ssh/sftp-file-type.c,
libguile-ssh/sftp-session-func.c,
libguile-ssh/sftp-session-main.c,
libguile-ssh/sftp-session-type.c,
libguile-ssh/threads.c,
libguile-ssh/version.c: Include <config.h>.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This ports Guile-SSH to the port API found in Guile 2.2.
* libguile-ssh/common.h (USING_GUILE_BEFORE_2_2): New macro.
* libguile-ssh/channel-type.c (channel_tag) [!USING_GUILE_BEFORE_2_2]:
New definition.
(read_from_channel_port, write_to_channel_port): New functions.
(ptob_close): Add #if USING_GUILE_BEFORE_2_2.
(guile_ssh_is_channel_p): Likewise.
(equalp_channel): Condition on USING_GUILE_BEFORE_2_2.
(_scm_from_channel_data): Add #if USING_GUILE_BEFORE_2_2.
(_scm_to_channel_data): Likewise.
(init_channel_type): Likewise.
* libguile-ssh/sftp-file-type.c (sftp_file_tag) [!USING_GUILE_BEFORE_2_2]:
New defintion.
(read_from_sftp_file_port, write_to_sftp_file_port): New functions.
(equalp_sftp_file): Condition on USING_GUILE_BEFORE_2_2.
(print_sftp_file): Use 'scm_port_filename' instead of 'SCM_FILENAME'.
(ptob_flush): Condition on USING_GUILE_BEFORE_2_2.
(ptob_close, ptob_seek): Add #if USING_GUILE_BEFORE_2_2.
(gssh_sftp_file_p): Likewise.
(_scm_to_sftp_file_data, _scm_from_sftp_file): Likewise.
(init_sftp_file_type): Likewise.
* configure.ac: Request "2.2" before "2.0" in 'GUILE_PKG'.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The mark function was unnecessary given that 'sftp_file_data' is
allocated with 'scm_gc_malloc' and thus scanned by the GC. The
free function was already a no-op.
* libguile-ssh/sftp-file-type.c (mark_sftp_file): Remove.
(free_sftp_file): Remove.
(init_sftp_file_type): Remove call to 'scm_set_port_mark' and to
'scm_set_port_free'.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
| |
* libguile-ssh/sftp-file-type.c (sftp_file_tag): Make 'static'.
* libguile-ssh/sftp-file-type.h (sftp_file_tag): Remove.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The mark function was unnecessary given that 'channel_data' is
allocated with 'scm_gc_malloc' and thus scanned by the GC. The
free function was already a no-op.
* libguile-ssh/channel-type.c (mark_channel, free_channel): Remove.
(init_channel_type): Remove call to 'scm_set_port_mark' and to
'scm_set_port_free'.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
| |
* libguile-ssh/channel-type.c (channel_tag): Make 'static'
* libguile-ssh/channel-type.h (channel_tag): Remove.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
| |
* libguile-ssh/error.c (guile_ssh_error1): Print errors to the libssh log.
|
| |
|
|
| |
* libguile-ssh/sftp-file-type.c (ptob_close): Add missing 'return' statement.
|
| |
|
|
|
| |
* libguile-ssh/sftp-session-type.c (print_sftp_session): Add missing 'return'
statement.
|
| |
|
|
|
| |
* libguile-ssh/session-func.c (guile_ssh_session_get): Fix warnings:
initialize variables with default values.
|
| |
|
|
|
|
| |
* libguile-ssh/channel-func.c (_ssh_result_to_symbol): Assert that the
argument is one of the libssh valid return codes. Fix warning related to
missed 'return' statement.
|
| |
|
|
|
| |
* libguile-ssh/channel-func.c (guile_ssh_channel_get_stream): Fix a warning
due to missed 'return' statement at the end of non-void procedure.
|
| |
|
|
|
|
|
| |
* configure.ac: Set and substitute 'WARN_CFLAGS'.
* libguile-ssh/Makefile.am (AM_CFLAGS): New variable.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* libguile-ssh/auth.c (guile_ssh_userauth_public_key_x): Remove
'public_key'.
* libguile-ssh/message-func.c (get_auth_req): Remove 'pkey_smob' and
'pkey_data'.
* libguile-ssh/session-type.c (print_session): Remove 'smob_addr'.
* libguile-ssh/sftp-file-type.c (print_sftp_file): Remove 'attr'.
(ptob_flush): Remove 'fd'.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
This is a followup to e490ba5226cedf22eb8f9166b5ac9fb5486c65f8.
* libguile-ssh/server-func.c (set_sym_opt)
(guile_ssh_server_set_x, guile_ssh_server_get): 'const'-qualify 'opt'
and 'sd'.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This procedure merely does I/O without mutating its argument, so it does
not deserve the trailing '!' (similar to Scheme's 'write',
'put-bytevector', etc. procedures).
* libguile-ssh/channel-func.c (gssh_channel_send_eof_x): Rename to...
(gssh_channel_send_eof): ... this. Change Scheme name to
'%channel-send-eof'. Adjust caller.
* modules/ssh/channel.scm (channel-send-eof!): Rename to...
(channel-send-eof): ... this.
* tests/client-server.scm ("channel-send-eof!"): Rename to...
("channel-send-eof"): ... this. Adjust accordingly.
* doc/api-channels.texi (Channel Management): Adjust accordingly.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
| |
* libguile-ssh/key-type.c (key_types): Mark as 'static const'.
(mark_key_smob, free_key_smob, equalp_key): Mark as 'static'.
* libguile-ssh/key-type.h (key_types): Remove declaration.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile-ssh/common.h (_ssh_const_to_scm): Const-qualify 'types'
parameter.
(_scm_to_ssh_const): Likewise, and const-qualify return type.
* libguile-ssh/common.c (_ssh_const_to_scm):
(_scm_to_ssh_const): Adjust accordingly.
* libguile-ssh/key-func.c (guile_ssh_string_to_public_key): Adjust
accordingly.
* libguile-ssh/key-type.c (_scm_to_ssh_key_type,
guile_ssh_make_keypair): Likewise.
* libguile-ssh/key-type.h (_scm_to_ssh_key_type): Likewise.
* libguile-ssh/log.c (guile_ssh_write_log)
(guile_ssh_set_log_verbosity_x): Likewise.
* libguile-ssh/session-func.c (set_sym_opt): Likewise.
(guile_ssh_session_set, guile_ssh_session_get): Likewise.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
| |
* libguile-ssh/key-type.c (key_types): Add entry for
'SSH_KEYTYPE_ED25519'.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
| |
|
|
|
|
|
|
| |
* modules/ssh/channel.scm (channel-send-eof!): New procedure.
* libguile-ssh/channel-func.c (gssh_channel_send_eof_x): New procedure.
* doc/api-channels.texi: Add description of 'channel-send-eof!'.
* tests/client-server.scm ("channel-send-eof!"): New TC.
* doc/version.texi, NEWS: Update.
|
| |
|
|
| |
* libguile-ssh/session-type.c (free_session): Use shorter argument names.
|
| |
|
|
|
| |
* libguile-ssh/key-type.c, libguile-ssh/message-type.c,
libguile-ssh/server-type.c: Update copyright dates.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SMOB freeing callbacks would always fail to free any resources due to
mistaken use of 'SCM_SMOB_PREDICATE' procedure -- the procedure doesn't work
in these GC callbacks according to the documentation (see '(guile) Smobs') and
always returns 'false' as the result when used in such context.
The solution is to remove the check 'SCM_SMOB_PREDICATE' and just get the
SMOB's data.
Reported by: David Kastrup <dak@gnu.org>
Reported by: Ludovic Courtès <ludo@gnu.org>
* libguile-ssh/key-type.c, libguile-ssh/message-type.c,
libguile-ssh/server-type.c, libguile-ssh/session-type.c,
libguile-ssh/sftp-session-type.c: Bugfix: Fix SMOB freeing callbacks.
* NEWS: Update.
|
| |
|
|
|
|
|
|
| |
* libguile-ssh/message-type.c (free_message): Bugfix: Check if the smob is
already freed, don't try to free it once more.
* libguile-ssh/server-type.c (free_server): Likewise.
* libguile-ssh/session-type.c (free_session): Likewise.
* libguile-ssh/sftp-session-type.c (free_sftp_session): Likewise.
|
| |
|
|
|
|
|
|
| |
* libguile-ssh/key-type.c (free_key_smob): Bugfix: Check if the smob is
already freed, don't try to free it once more.
* tests/common.scm (test-begin-with-log): Set log verbosity to the highest
level by default.
* tests/key.scm: Perform test with logging.
|
| |
|
|
|
|
| |
* configure.ac: Check for libssh 0.7.3+.
* libguile-ssh/channel-func.c: Replace deprecated functions with new ones if
libssh 0.7.3+ is used.
|
| |
|
|
|
| |
* libguile-ssh/log.c: Include 'libssh/callbacks.h' where
'ssh_set_log_callback' procedure is declared.
|
| |
|
|
|
| |
* libguile-ssh/key-func.c: Include 'error.h' header where 'guile_ssh_error1'
is declared.
|
| |
|
|
|
| |
* libguile-ssh/channel-func.c: Include 'libssh/server.h' because it is needed
for 'ssh_channel_request_send_exit_status' procedure.
|
| |
|
|
|
| |
* libguile-ssh/sftp-file-main.c, libguile-ssh/sftp-session-main.c: Add missed
"threads.h" include.
|
| |
|
|
|
|
| |
* libguile-ssh/key-type.c, libguile-ssh/sftp-file-type.c,
libguile-ssh/sftp-session-func.c, libguile-ssh/sftp-session-type.c: Add
missed "error.h" include.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
There are ill-defined non-static inlines that lead to linkage errors; it
appears that these inlines are the root cause for errors that can be seen on
Arch GNU/Linux. Replace them with regular procedures.
Reported by: SaffronSnail in <https://github.com/artyom-poptsov/guile-ssh/issues/1>
* libguile-ssh/common.c, libguile-ssh/common.h, libguile-ssh/error.c,
libguile-ssh/error.h, libguile-ssh/key-func.h, libguile-ssh/key-type.c,
libguile-ssh/key-type.h: Bugfix: Remove all non-static inlines; use regular
procedures instead.
|
| |
|
|
|
| |
* libguile-ssh/key-func.h (public_key_to_ssh_string): Remove the declaration
because there function is not defined (and not used anywhere.)
|
| |
|
|
| |
* libguile-ssh/server-type.c: Add missed "common.h" include.
|
| |
|
|
|
| |
* libguile-ssh/Makefile.am (libguile_ssh_la_SOURCES): Bugfix: Remove unused
'sftp-session-main.h'.
|
| |
|
|
|
| |
* libguile-ssh/channel-type.c (print_channel): Use 'scm_print_port_mode'
procedure from Guile API so the mode will be printed right.
|
| | |
|
| | |
|