Commit graph

242 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
cab8b065bd Fix uidgidlint invocation in %check
The test failed:
  + cd etc
  + bash /builddir/build/SOURCES/uidgidlint ./uidgid
  grep: ./uidgid: No such file or directory
  grep: ./uidgid: No such file or directory
but because pipefail wasn't set, the script iterated over empty input
and didn't actually test anything.

Set -o eu,pipefail to catch similar errors in the future and fix the
invocation so that the test passes.

[skip changelog]
2025-03-15 16:00:46 +01:00
Zbigniew Jędrzejewski-Szmek
8b6d293ac9 Restore uidgidlint that was dropped by mistake
This is a partial revert of 7ced36d60b
and a follow-up. I was in the middle of reworking the commit and
pushed the not-ready version to the upstream repo by mistake.

The passwd and group files that are now generated are dropped.

[skip changelog]
2025-03-15 16:00:38 +01:00
Zbigniew Jędrzejewski-Szmek
7ced36d60b Create passwd,group files from sysusers
This inverts the order of operations: previously, the passwd and group
files were the original source of information, and shadow and gpasswd
were created using sed, and sysusers fragments were generated using a
shell script.

There are a few problems with the previous approach:
- We had two sysusers files, one for groups and one for users. This
  split makes things more complicated. By default sysusers will create
  a group with the same name and number, if a user is defined without
  an explicit group override. This is what we want to do, to make the
  config shorter and easier to read.
- The rpm sysusers generator created two sets of 'Provides:group(…)'
  attributes.

In the new approach, we use the sysusers file as the "source of truth",
and run systemd-sysusers to generate passwd, group, shadow, and gshadow
files.

This has the following advantages:
- No code to maintain here.
- The config is easier to read.
- Toes a lint of the data. If a uid conflict was present, we'd
  get a warning.
- With the support for sysusers in rpm, when we install this package on
  a system, because of the Provides, rpm will create the users and groups
  using systemd-sysusers anyway. So by doing the same during the build,
  we match what rpm would do anyway, so we get a file that is closer to
  what will actually appear in the system.
- Since we now have a file generated by systemd-sysusers in the payload,
  we can see how things will actually look on the installed system.
  This allowed me to notice a bug in systemd packaging.
2025-03-14 17:57:55 +01:00
Björn Esser
3ee2a7088b
Drop pre-allocation of users and groups, during %%post
This is handled by rpm during %%pre now.

See: https://pagure.io/fesco/issue/3318

Signed-off-by: Björn Esser <besser82@fedoraproject.org>
2025-02-10 11:37:33 +01:00
Björn Esser
690241b0e3
Ensure pre-allocated users, groups, and tmpfiles are created in %%post
Some packages within the same transaction (e.g. during system-upgrades) may
rely on having the pre-allocated system users and/or system groups provided
by the setup package already to be present when the dependee package gets
installed;  waiting for the %%transfiletriggerin to run `systemd-sysusers`
will be too late in such cases.

The above statement also applies for the temporary files from this package
to be created by running `systemd-tmpfiles`.

Signed-off-by: Björn Esser <besser82@fedoraproject.org>
2024-12-27 22:01:48 +01:00
Björn Esser
8f8f05bf0a Cleanup spec file and drop old sources
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
2024-12-27 20:54:21 +00:00
Panu Matilainen
ec9da3703f Fix deprecation warnings on install/update
Use rpm.spawn() if available (in rpm >= 4.20) but fall back to
posix.fork() and friends if not to preserve upgrade path from
older versions.
2024-12-27 20:52:51 +00:00
Zbigniew Jędrzejewski-Szmek
d96f3846c1 Move yum/dnf protection removal config file under /usr
https://github.com/uapi-group/specifications/issues/76

Actually, add a new file under /usr, but keep the old file in /etc
because it's still needed for dnf. The new file in the new location
is useful because it means that we get the correct behaviour even when
/etc is emptied (on systems with new dnf version).

dnf5 reads the new location:
https://github.com/rpm-software-management/dnf5/issues/1107
https://github.com/rpm-software-management/dnf5/pull/1110
2024-09-24 16:39:03 +02:00
David Bold
4eaba20dd7 Fix "upstream" URL 2024-06-07 08:55:45 +00:00
Zbigniew Jędrzejewski-Szmek
8e709df8cd Whitespace and typo fix
I kept it out of the conversion commit to allow the converted results to
be trivially identical.
2024-05-27 14:32:47 +02:00
Zbigniew Jędrzejewski-Szmek
36eef7070f Merge upstream into downstream
This implements https://pagure.io/setup/issue/51.

The "upstream" is only used to build the package in our dist-git, so we can reduce the
total amount of work by moving files downstream and maintaining them there.

The package after the rebuild is identical, except for intentional changes
(removal of Group, updating of Url, bumping of the Version):

$ rpmdiff -iT noarch/setup-2.14.5-2.fc41.noarch.rpm noarch/setup-2.15.0-1.fc41.noarch.rpm
S.5.....    GROUP
S.5.....    URL
removed     REQUIRES config(setup) = 2.14.5-2.fc41
added       REQUIRES config(setup) = 2.15.0-1.fc41
removed     PROVIDES config(setup) = 2.14.5-2.fc41
removed     PROVIDES setup = 2.14.5-2.fc41
added       PROVIDES config(setup) = 2.15.0-1.fc41
added       PROVIDES setup = 2.15.0-1.fc41
2024-05-27 14:32:47 +02:00
Martin Osvald
052f9a49b3 New version 2.14.6
- Remove uidgid pair 77:77 for arpwatch
- Define all hardware groups that systemd needs via sysusers
- Switch to rpmautospec
2024-05-27 11:06:00 +02:00
Martin Osvald
fd0e99a00d Convert to %autorelease and %autochangelog
[skip changelog]
2024-05-27 10:24:33 +02:00
Fedora Release Engineering
c6f58b338b Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-27 02:42:55 +00:00
Martin Osvald
a1176da687 New version 2.14.5
bashrc: switch PROMPT_COMMAND to be an array (rhbz#2097525)
profile: don't overwrite the HISTSIZE environment variable
hosts: use "example.org" as example domain (rhbz#2246220)
csh.login: source csh.local (RHEL-17226)
2023-11-29 12:11:33 +01:00
Martin Osvald
65bee927e9 New version 2.14.4
protocols: add mptcp (262)
setup.spec: make setup protected package (rhbz#2155547)
setup.spec: don't report rpm -Va error on /run/motd (rhbz#2160954)
services: replace hostmon with llmnr for port 5355 (rhbz#2216914)
2023-07-26 13:02:01 +02:00
Fedora Release Engineering
0a04718db1 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 01:28:52 +00:00
Than Ngo
ae588bafde migrated to SPDX license 2023-02-21 17:55:40 +01:00
Fedora Release Engineering
3f933a14ef Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-21 03:04:02 +00:00
Martin Osvald
9174b59bde New version 2.14.3
sysusers.d: add script and generate configuration fragment for users
Add fallback to hostname determination for csh.login (rhbz#2079768)
Remove ancient Conflicts
files: mark /run/motd as an ephemeral ghost entry
2022-11-28 09:53:19 +01:00
Martin Osvald
ff8169d809 New version 2.14.2
sysusers.d: add script and configuration fragments for groups
passwd: align 'nologin' shell path with systemd defaults
uidgid: assign GID 101 for 'ssh_keys' group
uidgid: assign UID/GID 114 for 'polkitd'
passwd: update GECOS field for 'root' user
services: remove commas from aliases for ircu-3
setup.spec: throw away newaliases output again
2022-09-08 17:02:27 +02:00
Fedora Release Engineering
f900e00843 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 08:26:22 +00:00
Martin Osvald
f7c903eb2f New version 2.14.1
bashrc sets hardcoded umask (#1902166)
bashrc: clean up unused references to VTE
uidgid: simplify table format and other format enhancements
uidgid: fix news and lock entries, move basic groups to systemd
2022-07-20 10:04:44 +02:00
Zbigniew Jędrzejewski-Szmek
e72e5cf604 Fix %post scriptlet to not require the shell
os.execute uses /bin/sh, which to a large extent defeats the purpose of having
the scriptlet in lua ;)

$ strace -qq -ff -eexecve rpm -E "%{lua:os.execute('true')}"
execve("/usr/bin/rpm", ["rpm", "-E", "%{lua:os.execute('true')}"], 0x7ffd180ce638 /* 60 vars */) = 0
[pid 849466] execve("/bin/sh", ["sh", "-c", "true"], 0x7fff73cfc9d8 /* 60 vars */) = 0

Let's use posix.exec(). rpm.execute() would be nice, but it does not
support suppressing of stderr.
2022-05-27 16:38:25 +02:00
Martin Osvald
2490b95b86 New version 2.13.10
Move /var/log/lastlog ownership to systemd (#1798685)
tcsh sets variable p to /usr/sbin from /etc/csh.login (#2019874)
'history -a' doesn't belong in /etc/bashrc (#1871744)
localhost.localdomain in wrong order /etc/hosts (#1724539)
2022-05-08 10:18:18 +02:00
Fedora Release Engineering
6b17808bf0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-22 00:44:21 +00:00
Fedora Release Engineering
1c776817bc - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 17:25:27 +00:00
Pavel Zhukov
42331c85b1 Bugfix release 2.13.9.1 2021-07-16 11:28:14 +02:00
Pavel Zhukov
fe5ddc3789 New version 2.13.9 2021-07-15 10:17:40 +02:00
Pavel Zhukov
bdb73fd816 New version v2.13.8 2021-03-11 09:39:39 +01:00
Fedora Release Engineering
4a9828b9ca - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-27 20:15:46 +00:00
Robert Scheck
dbcb31be60 Update source URL to HTTPS 2021-01-18 01:55:49 +00:00
Tom Stellard
302fcaa071 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-08 21:24:20 +00:00
Fedora Release Engineering
5a7ff0dc1f - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-29 10:35:37 +00:00
Pavel Zhukov
aeb72c0895 New version 2.13.7 2020-06-23 08:38:04 +02:00
Fedora Release Engineering
6d01e91f16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-30 23:17:47 +00:00
Martin Osvald
72c2ec1f7e csh.login: set PATH again (if empty) to prevent interpreter error (#1744106)
aliases: add pcp user (#1744091)
lang.csh: fix several variable substitution bugs and typos (#1746749)
don't set LANG as a per-shell variable
fix lang.csh script so it doesn't break tcsh -e scripts II (#1620004)
use full path for non-builtins in csh.cshrc, csh.login, lang.csh, lang.sh and profile (#1747493)
2019-10-09 11:40:07 +02:00
Fedora Release Engineering
4a4e8a37a0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-26 23:07:56 +00:00
Ondřej Vašík
49893a0d43 fix typo in lang.sh (#1697311) 2019-04-09 10:00:36 +02:00
Ondřej Vašík
6f29690086 reset inherited locale settings to C.UTF-8 if invalid (PR#18) 2019-03-11 09:00:23 +01:00
Ondřej Vašík
8ac3c74c8c adjust date of change 2019-02-20 13:57:53 +01:00
Ondřej Vašík
f89419ce7a add setup.conf tmpfile to create /run/{motd,motd.d} on boot, do not ship /etc/hosts.allow and /etc/hosts.deny, require systemd-rpm-macros instead of systemd 2019-02-20 13:56:14 +01:00
Fedora Release Engineering
36a4527257 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-02 15:15:00 +00:00
Igor Gnatenko
7706bdafb8 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:49 +01:00
Ondřej Vašík
8a02009d2f add ownership of /run/{motd,motd.d} and /usr/lib/{motd,motd.d} 2018-12-14 15:57:48 +01:00
Ondřej Vašík
1807a3ca2a use full path for non-builtins in profile and lang.sh (#1648589), own /etc/motd.d 2018-12-12 10:00:18 +01:00
Ondřej Vašík
93a3f528c4 inputrc - replace quoted-insert with overwrite-mode for the Insert key 2018-10-26 16:00:45 +02:00
Ondřej Vašík
7454e6e477 fix lang.csh script so it doesn't break tcsh -e scripts (#1620004) 2018-09-10 13:53:14 +02:00
Ondřej Vašík
0002b35c86 Merge branch 'master' of ssh://pkgs.fedoraproject.org/rpms/setup 2018-07-13 14:24:29 +02:00
Ondřej Vašík
e32ba914a8 fix cut&paste error in lang.csh script (#1598268) 2018-07-13 14:24:17 +02:00