RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1813334 - [RFE] add library for handling profiles in keyfile format
Summary: [RFE] add library for handling profiles in keyfile format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: NetworkManager
Version: 8.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.0
Assignee: Thomas Haller
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1361145
TreeView+ depends on / blocked
 
Reported: 2020-03-13 14:33 UTC by Thomas Haller
Modified: 2021-05-18 13:31 UTC (History)
10 users (show)

Fixed In Version: NetworkManager-1.30.0-0.1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 13:29:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Thomas Haller 2020-03-13 14:33:40 UTC
Traditionally, the code for handling keyfile (and ifcfg-rh) is part of the daemon (and thus GPL licensed).

Already as an ongoing effort, the code for keyfile handling was extracted so that it can be used independently. Currently it is here ([1]):

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/tree/1a76141e66c9f7b8dc265955d3f3d149bc6c95ba/shared/nm-keyfile


Note that this code is GPL-2.0+, so it cannot be part of libnm (which is LGPL-2.1+). Maybe, with the relicensing effort ([2]), we could even change the license of the code. But that isn't simple, because of the long history of the file :( On the other hand, it's merely 5k of code, maybe we could just re-implement it from scratch under LGPL-2.1+... 

[2] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1a76141e66c9f7b8dc265955d3f3d149bc6c95ba/RELICENSE.md


Anyway, we should provide an API for handling keyfile. If we can relicense (or reimplement it), this code could be part of libnm. Otherwise, we can just add a new GPL-2.0+ licensed libnm-keyfile.so.


This opens countless opportunities for nice features, e.g. bug 1361145 or connection import/export from nm-connection-editor.



One problem is, that the API needs to all special handling. For example,

  - it needs a hook for possibly removing passwords (or replacing them by ***)

  - it needs a hook for notifying about warnings and info messages

  - we may need to handle file names. For example, if the property is a relative path name, nmcli may want to complete that path based on the current working directory. Likewise, when loading a keyfile, relative paths probably should be based on the location of the file we are about to load.

  - certificates can also be blobs. The settings plugins converts blobs to files (persisting the files to disk) ([3]). But then a `nmcli connection show --keyfile "$PROFILE"` may just want to print the blob as binary array, etc.

[3] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1a76141e66c9f7b8dc265955d3f3d149bc6c95ba/src/settings/plugins/keyfile/nms-keyfile-writer.c#L29

The point is, especially export is not as simple but it needs a flexible, extensible API. This API already exists with the NMKeyfileWriteHandler and NMKeyfileReadHandler structs. The problem is whether this is suitable public API, also w.r.t. how to use this API form python via GObject introspection.

Comment 2 Thomas Haller 2020-05-26 12:34:32 UTC
first we need to relicense the code:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/390

then exposing the functionality as public API is here:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/517

Comment 10 errata-xmlrpc 2021-05-18 13:29:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: NetworkManager and libnma security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1574


Note You need to log in before you can comment on or make changes to this bug.