libssh2: replace access() with stat()

Prefer `stat()` to verify the presence of key files.

This drops the last uses of `access()` in the codebase, which was
reported to cause issues in some cases.

Also add `access()` to the list of banned functions in checksrc.

Ref: https://github.com/curl/curl/pull/13412#issuecomment-2065505415
Ref: https://github.com/curl/curl/pull/13482#issuecomment-2078980522
Ref: #13497
Co-authored-by: Jay Satiro
Closes #13498
This commit is contained in:
Viktor Szakats 2024-04-29 13:49:03 +02:00
parent 7f7ad97bf1
commit 602fc213ae
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 7 additions and 5 deletions

View file

@ -720,7 +720,8 @@ sub scanfile {
strtok|
v?sprintf|
(str|_mbs|_tcs|_wcs)n?cat|
LoadLibrary(Ex)?(A|W)?)
LoadLibrary(Ex)?(A|W)?|
access)
\s*\(
/x) {
checkwarn("BANNEDFUNC",