Commit graph

375 commits

Author SHA1 Message Date
Beniamino Galvani
a45163b131 rpm: disable wireless extensions on Fedora
The Fedora kernel is built without WEXT since many years:

https://fedoraproject.org/wiki/Changes/RemoveWirelessExtensions
2025-12-18 16:06:44 +01:00
Beniamino Galvani
1a52bbe7c9 libnm: add function to copy a certificate or key as user
Add a new public function nm_utils_copy_cert_as_user() to libnm. It
reads a certificate or key file on behalf of the given user and writes
it to a directory in /run/NetworkManager. It is useful for VPN plugins
that run as root and need to verify that the user owning the
connection (the one listed in the connection.permissions property) can
access the file.
2025-12-12 12:43:15 +01:00
Íñigo Huguet
d8f143f601 spec: enable polkit_noauth_group for Fedora <= 43 and RHEL <= 10
In Fedora 44 and RHEL 11, admin users will need to type their password
even on local consoles.
2025-12-12 12:38:48 +01:00
Íñigo Huguet
0b75d905e5 polkit: remove the modify_system build option
This build option allowed non-admin users to create system-wide
connections. Generally, this is not a good idea as system-wide changes
should be done by administrators.

However, the main reason for the change is that this can be used to
bypass filesystem permissions, among possibly other attacks. As the
daemon runs as root, a user can create a system-wide connection that
uses a certificate from a different user to authenticate in a WiFi
network protected with 802.1X or a VPN, because as root user the daemon
can access to the file.

This patch does not completely fix the issue, as users can still create
private connections specifying a path to another user's connection. This
will be addressed in other patch. However, this patch is needed too,
because in system-wide connections we don't store which user created the
connection, so there woudn't be any way to check his/her permissions.

This is part of the fix for CVE-2025-9615

See: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1809
2025-12-12 12:38:48 +01:00
Antonio Alvarez Feijoo
636fb5ef24 systemd: install initrd services using a generator
Since both `NetworkManager.service` and `NetworkManager-initrd.service` are
allocated for the same bus name (`org.freedesktop.NetworkManager`) and this is
not allowed, the best option is to use a systemd generator to install them only
in the initrd, instead of setting fixed Install sections.

Fixes #1814
2025-11-20 13:26:15 +00:00
Jan Vaclav
8d33aaa5b6 build: drop "ebpf" configuration for n-acd compilation
Since we now check whether the user's machine supports
eBPF at runtime, we can drop all of this build machinery.
2025-10-22 21:48:39 +02:00
Beniamino Galvani
fcf9b60cc2 build: remove autotools leftovers 2025-09-08 10:46:44 +00:00
Beniamino Galvani
94d7dd9b11 rpm: change system_ca_path
/etc/pki/tls/cert.pem was a symlink to
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem since Fedora 19 and
it is being removed in Fedora 43.

See https://fedoraproject.org/wiki/Changes/droppingOfCertPemFile

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2257
https://bugzilla.redhat.com/show_bug.cgi?id=2380436
2025-08-25 15:19:47 +02:00
Íñigo Huguet
3cba4f2627 spec: add git_tag_version
The URL to the tarball needs the git tag, that might be 1.54-rc1 instead
of 1.53.90. Allow to define it as a separate variable in the spec file.
It can be set as `git_tag_version %{real_version}` when they are
identical.

It is not really needed here in the upstream spec file, as the "Source"
line is commented out, but add it as a reference for donwstream spec
files.
2025-07-07 09:27:05 +02:00
Tomas Bzatek
ec917dc670 ci: add libnvme dependency
Required for the nm-initrd-generator NBFT support.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Jan Vaclav
0f469b30ad build: add path definition for ip6tables 2025-04-01 08:08:52 +00:00
Íñigo Huguet
a60ca31fd9 spec: specify paths to *-initrd.service files from the buildroot
Fixes: 91e36ea214 ('spec: don't install *-initrd.services')
2025-03-04 07:19:56 +01:00
Íñigo Huguet
91e36ea214 spec: don't install *-initrd.services
They cannot be used yet as Dracut need changes. They are not really
tested, neither, so better not to install them as they might cause
confusion about their purpose.
2025-03-03 15:42:36 +01:00
Antonio Alvarez Feijoo
8640ea822f systemd: add initrd-specific services
Decouple from a specific initrd generator (dracut) the systemd services that
provide networking in the initrd using NM, thus allowing other systemd-based
initrd generators to take advantage of it.

These new services are:
- `NetworkManager-config-initrd.service`: it starts very early at boot, parses
the kernel command line using `nm-initrd-generator` and sets the
`/run/NetworkManager/initrd/neednet` flag to activate the other initrd services,
and also sets the hostname if needed.
- `NetworkManager-initrd.service`: it basically does the same job as the
`NetworkManager.service`, but in the initrd.
- `NetworkManager-wait-online-initrd.service`: ordered before
`network-online.target`, it will allow other services that require networking to
delay their start until NM has finished.
2025-02-26 09:31:05 +00:00
Beniamino Galvani
98b124a661 dhcp: drop dhcpcanon support
Drop support for the "dhcpcanon" DHCP client. It's unmantained, as the
last code change was in 2018:

  https://github.com/juga0/dhcpcanon/commits

There is no need to first deprecate it because it was still marked as
"experimental" in NM. Also, it's not packaged by any recent distro, so
we can assume that nobody will miss it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2112
2025-01-20 18:56:41 +01:00
Wen Liang
7ab3362940 spec: add iputils as recommended dependency for ping command
NetworkManager relies on the ping command provided by `/usr/bin/ping`
from the iputils package to proceed the gateway or ip addresses
connectivity check.  This change ensures that iputils is recommended as a
dependency, making the ping command available for use during runtime but
not enforcing its installation as mandatory since NM can still proceed
to activate the connection even if the ping operation failed.
2024-11-04 14:25:54 +00:00
Íñigo Huguet
5792038572 contrib/rpm: Add ipcalc dependency to dispatcher-routing-roules
The dispatcher script uses it.
2024-10-11 12:14:50 +02:00
Jan Vaclav
593580feae build: remove make/autotools from required packages 2024-09-11 12:18:15 +00:00
Jan Vaclav
28ada2f0b6 build/specfile: remove autotools configuration 2024-09-11 12:18:15 +00:00
Beniamino Galvani
a367f8770b rpm: add "Obsoletes" for removed ifcfg packages in F41
Add the "Obsoletes" to the removed ifcfg packages, so that they are
properly removed on upgrade. Otherwise, the upgrade to the new NM
fails due to failed dependencies.

Fixes: 777418dfd7 ('rpm: disable ifcfg support in Fedora 41')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2001
2024-07-26 11:32:19 +02:00
Beniamino Galvani
777418dfd7 rpm: disable ifcfg support in Fedora 41
https://fedoraproject.org/wiki/Changes/RemoveIfcfgSupportInNM
https://bugzilla.redhat.com/show_bug.cgi?id=2296272
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1985
2024-07-16 14:35:31 +02:00
Lubomir Rintel
3d82b9b318 merge: branch 'lr/deprecate-dhclient'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1988
2024-07-11 15:46:31 +02:00
Lubomir Rintel
d246d9df88 merge branch 'lr/simpler-rpm'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1990
2024-07-11 12:29:26 +02:00
Lubomir Rintel
037450df45 contrib/rpm: remove conditionals for RHEL 7 and older
There's just too much clutter in the SPEC file. Drop some totally
obsolete stuff.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
1ccc1e0041 contrib/rpm: install firewall zone unconditionally
It's the same on all systems we care about.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
954e8c8d64 contrib/rpm: stop conditionalizing default DHCP client
It's the same on all systems we care about.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
811ef6952d contrib/rpm: remove extra 0%{?rhel} from some conditionals
"0%{?rhel} && 0%{?rhel} >= 8" just says 0%{?rhel} twice, redundantly.
Let's not do that.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
c639387071 contrib/rpm: remove ldconfig scriptlets
The file triggers replaced this aeons ago. RHEL 8 definitely has them:

  [root@el8 ~]# rpm -q --filetriggers glibc-common
  transfiletriggerin scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64
  /sbin/ldconfig
  transfiletriggerpostun scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64
  /sbin/ldconfig
  [root@el8 ~]#
2024-07-11 12:13:33 +02:00
Lubomir Rintel
a2914f1d0a rpm: disable dhclient on Fedora 41 and RHEL 10
They're off by default, but SPEC file turns them on. Don't do that in
future distros.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:32 +02:00
Lubomir Rintel
51a43fb301 contrib/rpm: pull in formatting fixes from Fedora 2024-07-10 14:21:19 +02:00
Lubomir Rintel
3d0ddfd6be contrib/rpm: turn %ifcfg_migrate into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
151decd333 contrib/rpm: turn %ifcfg_warning into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
cfc6cd7a74 contrib/rpm: turn %split_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
2066e1743e contrib/rpm: turn %with_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
e4660336e7 contrib/rpm: turn %config_plugins_default_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Stanislas FAYE
10d4557720 Make team obsoletes in rhel-10 only if NM-team is not enabled in the rpm 2024-05-31 11:33:58 +00:00
Stanislas FAYE
3f3472c971 Use the versions number from which packages are obsoleted directly instead of using global variables 2024-05-31 11:33:58 +00:00
Stanislas FAYE
613f16de51 rpm: Disable team and ifcfg-rh only in rhel distros and rhel-10+
Resolves: https://issues.redhat.com/browse/RHEL-32948
2024-05-31 11:33:58 +00:00
Jan Vaclav
d115dcec50 build: break autotools configuration to warn about deprecation
We are planning on completely dropping Autotools in the future.
This breaks the build process with an argument to ignore the deprecation,
so that anyone building NM is warned of this change.
2024-05-06 15:25:50 +02:00
Jan Vaclav
5fae0403b8 contrib/rpm: use meson by default for builds on RHEL10
As part of our plan to deprecate autotools, we will now be using meson
by default to build NM releases on RHEL 10.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1929
2024-05-06 08:13:44 +00:00
Beniamino Galvani
e79e1d637e rpm: disable ifcfg-rh in future versions of RHEL 2024-04-24 09:52:55 +02:00
Beniamino Galvani
bc73478a49 rpm: disable team support in future versions of RHEL 2024-04-24 09:52:55 +02:00
Jan Vaclav
38c799d883 contrib/rpm: use meson by default for builds on rawhide
As part of our plan to deprecate autotools, we will now be using meson
by default to build NM releases on Rawhide.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1905
2024-04-18 13:31:50 +00:00
Fernando Fernandez Mancera
084beb0818 contrib/rpm: fix reference to "22-wifi-mac-addr.conf" 2023-11-21 13:03:24 +01:00
Thomas Haller
ea8dbd7a6d
contrib/rpm: add "22-wifi-mac-addr.conf" to F40+
Install a configuration snippet on Fedora 40+, that sets the default for
"wifi.cloned-mac-address" to "stable-ssid" (otherwise, the built-in default
is "preserve").

This will mean, that on Wi-Fi profiles that don't explicitly override
the property "wifi.cloned-mac-address", a stable address is generated.
The benefit is, that Fedora will randomize the MAC address by default.

Note that this also affects all pre-existing Wi-Fi profiles, that don't
explicitly configure the property in the profile. Depending on how you
see it, this is desirable. Randomization should be done, unless the user
opts-out (not the other way around).

Note that setting "wifi.cloned-mac-address=stable-ssid" is similar to
setting a stable ID "${NETWORK_SSID}" and "wifi.cloned-mac-address=stable".
The difference is that the latter also affects other properties, like

  - "ipv6.addr-gen-mode=stable-privacy"
  - "{ethernet,wifi}.cloned-mac-address=stable"
  - "ipv4.dhcp-client-id=stable"
  - "ipv6.dhcp-duid=stable-{llt,ll,uuid}"
  - "{ipv4,ipv6}.iaid=stable"

Especially with "ipv6.addr-gen-mode=stable", changing the stable ID
would mean that also all IPv6 addresses change. We want to avoid that by
only changing the cloned-mac-address to "stable-ssid".

This means, after upgrade to F40, different MAC addresses will be used
on most users' Wi-Fi. This means, DHCP might hand out different IP
addresses, sessions might expire, and configuration that depended on the
previous MAC address will be affected.

https://pagure.io/fedora-workstation/issue/350
2023-11-17 12:48:37 +01:00
Thomas Haller
eb5b78c4bf
all: drop support for building with Python2
Now that we no longer test on CentOS7, we also have no more tests that
build using Python2.

Note that build with Python2 is currently broken already (which would be
fixable).

Drop Python2 too.

Existing Python scripts still use a common subset of Python2 and
Python3. They can be improved to use Python3 features in the future.
2023-11-14 10:29:48 +01:00
Íñigo Huguet
1560052dcc contrib/rpm: libnm: migrate to SPDX license
The license identifier was updated for the main package, but not for
libnm which overrides it to LGPL 2.1 or later. Update it too.

Fixes: 8c5aec7a1b ('contrib/rpm: migrate to SPDX license')
2023-11-07 07:20:04 +00:00
Íñigo Huguet
72b2485042 spec: Add missing epoch to some obsoleted versions
An rpm linter has complained with:
Missing epoch prefix on the version-release in 'Obsoletes: NetworkManager < 1.0.0' for NetworkManager-team
2023-10-25 10:20:03 +00:00
Beniamino Galvani
c3ca0b90cd contrib/rpm: ship a different readme when ifcfg migration is enabled
Ship a different file in /etc/sysconfig/network-scripts to warn that
migration is enabled.
2023-10-03 14:09:21 +02:00
Beniamino Galvani
995539cd30 contrib/rpm: enable ifcfg migration on Fedora 39+
https://fedoraproject.org/wiki/Changes/MigrateIfcfgToKeyfile
2023-08-10 13:21:49 +02:00