From a74fca11098eb2a1288472ae41a54b3b0e350ad9 Mon Sep 17 00:00:00 2001 From: bket Date: Sat, 11 Dec 2021 06:43:19 +0000 Subject: [PATCH] Update to libfilezilla-0.35.0 Overview on changes: https://lib.filezilla-project.org/ Bump major because of removed symbols. --- net/libfilezilla/Makefile | 6 +- net/libfilezilla/distinfo | 4 +- .../patches/patch-lib_glue_unix_cpp | 25 ----- .../patches/patch-lib_impersonation_cpp | 99 ++++--------------- 4 files changed, 26 insertions(+), 108 deletions(-) delete mode 100644 net/libfilezilla/patches/patch-lib_glue_unix_cpp diff --git a/net/libfilezilla/Makefile b/net/libfilezilla/Makefile index 2905fd7f93f..1319d409f65 100644 --- a/net/libfilezilla/Makefile +++ b/net/libfilezilla/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.23 2021/10/27 07:24:42 bket Exp $ +# $OpenBSD: Makefile,v 1.24 2021/12/11 06:43:19 bket Exp $ COMMENT = support library for FileZilla -DISTNAME = libfilezilla-0.34.2 +DISTNAME = libfilezilla-0.35.0 -SHARED_LIBS += filezilla 10.0 # 21.1.0 +SHARED_LIBS += filezilla 11.0 # 23.0.0 CATEGORIES = net diff --git a/net/libfilezilla/distinfo b/net/libfilezilla/distinfo index 4ec527aa0b8..e9d5709117c 100644 --- a/net/libfilezilla/distinfo +++ b/net/libfilezilla/distinfo @@ -1,2 +1,2 @@ -SHA256 (libfilezilla-0.34.2.tar.bz2) = IKKLd+whs4CtAgLbAWbtHHycItRQSN1oBtXsn+J/7Uo= -SIZE (libfilezilla-0.34.2.tar.bz2) = 595072 +SHA256 (libfilezilla-0.35.0.tar.bz2) = 7uJRDc49BpHqc9wdoQ+sfbEhWwup7vphbfMFNosJKug= +SIZE (libfilezilla-0.35.0.tar.bz2) = 597061 diff --git a/net/libfilezilla/patches/patch-lib_glue_unix_cpp b/net/libfilezilla/patches/patch-lib_glue_unix_cpp deleted file mode 100644 index 492a729460c..00000000000 --- a/net/libfilezilla/patches/patch-lib_glue_unix_cpp +++ /dev/null @@ -1,25 +0,0 @@ -$OpenBSD: patch-lib_glue_unix_cpp,v 1.1 2021/10/24 18:54:55 bket Exp $ - -EBADFD is not specified in POSIX, EBADF is. - -Index: lib/glue/unix.cpp ---- lib/glue/unix.cpp.orig -+++ lib/glue/unix.cpp -@@ -87,7 +87,7 @@ int send_fd(int socket, fz::buffer & buf, int fd, int - return -1; - } - if (socket < 0) { -- error = EBADFD; -+ error = EBADF; - return -1; - } - -@@ -144,7 +144,7 @@ int read_fd(int socket, fz::buffer & buf, int & fd, in - { - fd = -1; - if (socket < 0) { -- error = EBADFD; -+ error = EBADF; - return -1; - } - diff --git a/net/libfilezilla/patches/patch-lib_impersonation_cpp b/net/libfilezilla/patches/patch-lib_impersonation_cpp index 9c4c565ebce..f256cf0ce83 100644 --- a/net/libfilezilla/patches/patch-lib_impersonation_cpp +++ b/net/libfilezilla/patches/patch-lib_impersonation_cpp @@ -1,89 +1,32 @@ -$OpenBSD: patch-lib_impersonation_cpp,v 1.1 2021/10/24 18:54:55 bket Exp $ +$OpenBSD: patch-lib_impersonation_cpp,v 1.2 2021/12/11 06:43:19 bket Exp $ Index: lib/impersonation.cpp --- lib/impersonation.cpp.orig +++ lib/impersonation.cpp -@@ -7,10 +7,8 @@ +@@ -7,7 +7,7 @@ #include #include --#include - #include - #include --#include - #include - #include - #include -@@ -51,43 +49,7 @@ passwd_holder get_passwd(fz::native_string const& user - +-#if FZ_UNIX ++#if FZ_UNIX && !__OpenBSD__ + #include + #include + #endif +@@ -58,7 +58,7 @@ passwd_holder get_passwd(fz::native_string const& user return ret; } -- -- --struct shadow_holder { -- shadow_holder() = default; -- shadow_holder(shadow_holder const&) = delete; -- shadow_holder(shadow_holder &&) = default; -- -- shadow_holder& operator=(shadow_holder const&) = delete; -- shadow_holder& operator=(shadow_holder &&) = default; -- -- ~shadow_holder() noexcept = default; -- -- struct spwd* shadow_{}; -- -- struct spwd shadow_buffer_; -- fz::buffer buf_{}; --}; -- --shadow_holder get_shadow(fz::native_string const& username) --{ -- shadow_holder ret; -- -- size_t s = 1024; -- int res{}; -- do { -- s *= 2; -- ret.buf_.get(s); -- res = getspnam_r(username.c_str(), &ret.shadow_buffer_, reinterpret_cast(ret.buf_.get(s)), s, &ret.shadow_); -- } while (res == ERANGE); -- -- if (res) { -- ret.shadow_ = nullptr; -- } -- -- return ret; - } --} - class impersonation_token_impl final +-#if FZ_UNIX ++#if FZ_UNIX && !__OpenBSD__ + struct shadow_holder { + shadow_holder() = default; + shadow_holder(shadow_holder const&) = delete; +@@ -150,7 +150,7 @@ std::vector get_supplementary(std::string const + + bool check_auth(fz::native_string const& username, fz::native_string const& password) { -@@ -139,20 +101,15 @@ impersonation_token::impersonation_token(fz::native_st - { - auto pwd = get_passwd(username); - if (pwd.pwd_) { -- auto shadow = get_shadow(username); -- if (shadow.shadow_) { -- struct crypt_data data{}; -- char* encrypted = crypt_r(passwd.c_str(), shadow.shadow_->sp_pwdp, &data); -- if (encrypted && !strcmp(encrypted, shadow.shadow_->sp_pwdp)) { -- impl_ = std::make_unique(); -- impl_->name_ = username; -- if (pwd.pwd_->pw_dir) { -- impl_->home_ = pwd.pwd_->pw_dir; -- } -- impl_->uid_ = pwd.pwd_->pw_uid; -- impl_->gid_ = pwd.pwd_->pw_gid; -- impl_->sup_groups_ = get_supplementary(username, pwd.pwd_->pw_gid); -+ if (crypt_checkpass(passwd.c_str(), pwd.pwd_->pw_passwd) == 0) { -+ impl_ = std::make_unique(); -+ impl_->name_ = username; -+ if (pwd.pwd_->pw_dir) { -+ impl_->home_ = pwd.pwd_->pw_dir; - } -+ impl_->uid_ = pwd.pwd_->pw_uid; -+ impl_->gid_ = pwd.pwd_->pw_gid; -+ impl_->sup_groups_ = get_supplementary(username, pwd.pwd_->pw_gid); - } - } - } +-#if FZ_UNIX ++#if FZ_UNIX && !__OpenBSD__ + auto shadow = get_shadow(username); + if (shadow.shadow_) { + struct crypt_data data{};