1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Commit Graph

21 Commits

Author SHA1 Message Date
Viktor Szakats
2e7c9a0975 src: add SSH2_SAFEFREE() macro and use it
Like `SSH2_FREE()` but also assign `NULL` to the freed pointer variable.

Also add checksrc rule to verify.

Ref: #2208

Closes #2209
2026-07-05 12:41:55 +02:00
Viktor Szakats
dcd0dbab6b build: stop redefining system symbol snprintf
Introduce and use the local name `ssh2_snprintf()` instead, and map it
to system `snprintf()` when safe, otherwise directly  call the local
implementation already using this name.

Also: adjust checksrc rules.

Closes #2103
2026-06-21 17:50:20 +02:00
Viktor Szakats
41d86d3bad src: introduce SSH2_ERRNO() and use it
To avoid conditional code scattered around the source code.

Also: ban direct use of `errno` via checksrc.

Closes #2050
2026-06-12 13:04:56 +02:00
Viktor Szakats
c2bae82155 docker-bridge.ps1: update AppVeyor CI external IP detection endpoint
To fix detecting true external IP after AppVeyor servers moved behind
Cloudflare on 2026-06-01.

Thanks-to: Feodor Fitsner

Refs:
4ceb9edec1
https://github.com/libssh2/libssh2/pull/1947#issuecomment-4663567348
https://github.com/libssh2/libssh2/pull/1947#issuecomment-4663596228

Bug:
https://github.com/libssh2/libssh2/pull/1947#issuecomment-4662191546
https://github.com/libssh2/libssh2/pull/1947#issuecomment-4663379375

Closes #2010
2026-06-10 11:53:15 +02:00
Viktor Szakats
509eac8b96 checksrc: extend to ossfuzz, reduce scope of exceptions
Replace a few calls in tests to reduce exceptions.

Closes #1998
2026-06-08 17:14:59 +02:00
Viktor Szakats
124c68bbed src: fix stray fprintf() calls, make checksrc verify
Replace with `ssh2_deb()`.

Also:
- adjust checksrc options to verify.
- checksrc-all.pl: fix an issue preventing picking up `tests/.checksrc`.

Follow-up to c090b696c6 #1556
Follow-up to af1e591eee #796

Closes #1997
2026-06-08 16:17:00 +02:00
Viktor Szakats
b90a38c1c9 tidy-up: miscellaneous
- configure: use `dnl`-style comments consistently (where possible).
- configure: drop stray spaces.
- wincng: replace Windows-specific type in `memcpy()` casts.
- drop FIXME added incorrectly in a recent commit.
  Follow-up to ecf39b3634 #1984
  Follow-up to ff50682c23 #1679
- replace more synonyms with 'null-terminated'.
- unfold strings, comments and code lines.
- reflow lines, fix indent.

Closes #1995
2026-06-07 17:55:08 +02:00
Viktor Szakats
528b0d6d90 docker-bridge.sh: use long-form option, show failure, fail on error
Cherry-picked from #1947
2026-06-07 11:57:16 +02:00
Viktor Szakats
99803822cb tidy-up: miscellaneous
- fix typos in comments and documentation.
- fix references to non-existing functions in comments.
- libssh2_session_free: fix see-also reference on man page.
- libssh2_scp_recv2: fix typo in prototype on man page.
- man2help: use increment operator.
- badwords: extend with new words and an exclusion.
- userauth: unfold string.
- clang-format and manual formatting.

Closes #1988
2026-06-05 18:12:37 +02:00
Viktor Szakats
9538c99fc4 badwords: add checker script, fix issues found
Checker script and wordlist comes from curl.

Also:
- checksrc.pl: sync up with curl.
- unfold an IETF URL.
- update all IETF URLs where missing.

Closes #1959
2026-06-01 13:22:40 +02:00
Viktor Szakats
e4c2b18f54 cd2nroff: move to scripts directory, sync with curl
Also adapt curl-specific logic/text for libssh2.

Closes #1958
2026-06-01 00:21:23 +02:00
Viktor Szakats
9f4a270857 configure: drop old, vendored, ld detection code, merge and rename rest
Keep `lib-link.m4`, rename to `libssh2-link.m4`, namespace its content
to `LIBSSH2_`. Also copy 3 lower-level functions from another `.m4`.
Drop using vendored `AC_LIB_PROG_LD`, which served the purpose of
detecting `LD` and `with_gnu_ld`.

To reduce amount of old, complex vendored code and also to avoid
autoreconf auto-updating these in-repo files locally.

Follow-up to 0443145a75 #1920
Follow-up to bcc9292aab #1921

Closes #1916
2026-05-11 14:27:13 +02:00
Viktor Szakats
07ffced7c2 scripts: move maketgz, git2news.pl from root to scripts directory
To match curl and to avoid clutter in root.

Closes #1918
2026-05-01 17:03:55 +02:00
Viktor Szakats
a73aa23c9f checksrc: stop disabling TYPEDEFSTRUCT globally
Silence locally in public headers. They are part of the documented
public interface, removing them would be a breaking change.

Follow-up to 35aa0b2cd7 #1910
Follow-up to 7dd7e62629 #1909
Follow-up to c07e953a2f #1908
Follow-up to 967647c4da #1907

Closes #1912
2026-05-01 14:19:03 +02:00
Viktor Szakats
3da7e62767 checksrc-all.pl: limit checks to repo files only
- harden external command execution.
- drop no longer necessary global option.
- fix indent.

Closes #1900
2026-04-30 12:40:21 +02:00
Viktor Szakats
1f0d0626a3 appveyor: test tidy-ups
- wait for sshd before the build, to ease testing.
- restore the RSA 2048 hostkey generator line, commented, to ease tests.
- keep per-job `SKIP_CTEST` settings, commented, to ease tests.
- drop automatism to disable tests for ARM64, for simplicity.

Note: This has been tested with tests enabled, but they remain
a hit-or-miss (mostly a miss) due to failed sshd connection, and this
patch does not re-enable them.

FTR:
- a CI run when tests worked without issues (2023-12-04):
  https://ci.appveyor.com/project/libssh2org/libssh2/builds/48673013/job/79lywpm3pfvq7hn5
- a fresh CI run when the first job successfully waited for sshd:
  https://ci.appveyor.com/project/libssh2org/libssh2/builds/53941135/job/yu9jf5hvp3grse0g

Ref: #1856 #1857
Follow-up to c71ff14f3b #1894
Follow-up to c321b324d6 #1768
Follow-up to b5e68bdc37 #1461
Follow-up to f36edf94e7 #997

Closes #1892
2026-04-26 12:08:36 +02:00
Viktor Szakats
001571c1ff checksrc: add missing semicolon, fix IFDEFSINGLE capture group
Pointed out by GitHub Code Quality

Closes #21435
2026-04-24 11:17:21 +02:00
Viktor Szakats
96df6f2f8f checksrc: add missing items to warnings hash, alpha-sort 2026-04-24 10:03:48 +02:00
Viktor Szakats
d9631cfc86 checksrc: fix code quality findings
- fix counting errors.
- fix an error message.
- tidy up regexp syntax.

Pointed out by GitHub Code Quality
2026-04-24 09:48:31 +02:00
Viktor Szakats
bda85e2034 checksrc.pl: delete stray commas
Closes #1879
2026-04-23 22:08:45 +02:00
Viktor Szakats
317907545b tidy-up: rename ci directory to scripts
To reduce differences with curl.

Also:
- add most scripts to the source distro tarball. Some were referenced
  by build scripts (e.g. `checksrc`).

Closes #1870
2026-04-23 09:09:59 +02:00