Skip to content

Commit

Permalink
Support colon in username, use LRO_USERNAME and LRO_PASSWORD
Browse files Browse the repository at this point in the history
Requires librepo version >= 1.18.0
  • Loading branch information
jrohel committed Jun 24, 2024
1 parent 89ccf36 commit 0a99696
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dnf5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Provides: dnf5-command(versionlock)
# ========== versions of dependencies ==========

%global libmodulemd_version 2.5.0
%global librepo_version 1.15.0
%global librepo_version 1.18.0
%global libsolv_version 0.7.25
%global sqlite_version 3.35.0
%global swig_version 4
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pkg_check_modules (GLIB2 glib-2.0>=2.46.0)
include_directories(${GLIB2_INCLUDE_DIRS})
target_link_libraries(libdnf5 PRIVATE ${GLIB2_LIBRARIES})

pkg_check_modules(LIBREPO REQUIRED librepo>=1.15.0)
pkg_check_modules(LIBREPO REQUIRED librepo>=1.18.0)
list(APPEND LIBDNF5_PC_REQUIRES "${LIBREPO_MODULE_NAME}")
target_include_directories(libdnf5 PUBLIC PRIVATE ${LIBREPO_INCLUDE_DIRS})
target_link_libraries(libdnf5 PRIVATE ${LIBREPO_LDFLAGS})
Expand Down
9 changes: 4 additions & 5 deletions libdnf5/repo/librepo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,10 @@ static void init_remote(LibrepoHandle & handle, const C & config) {
handle.set_opt(LRO_IPRESOLVE, LR_IPRESOLVE_V6);
}

auto userpwd = config.get_username_option().get_value();
if (!userpwd.empty()) {
// TODO Use URL encoded form, needs support in librepo
userpwd = format_user_pass_string(userpwd, config.get_password_option().get_value(), false);
handle.set_opt(LRO_USERPWD, userpwd.c_str());
auto username = config.get_username_option().get_value();
if (!username.empty()) {
handle.set_opt(LRO_USERNAME, username.c_str());
handle.set_opt(LRO_PASSWORD, config.get_password_option().get_value().c_str());
}

if (!config.get_sslcacert_option().get_value().empty()) {
Expand Down

0 comments on commit 0a99696

Please sign in to comment.