35 Commits

Author SHA1 Message Date
Alejandro Colomar
6c62103ba6 lib/getdate.*: Reimplement in pure C
This removes all yacc(1) code from this project.  Add copyright and
license, since there remains nothing of the original code.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-06-02 09:59:51 +02:00
Iker Pedrosa
7db725b2e0 ci: add gawk as a fedora dependency
Recently fedora 42 was released and `gawk` was missing as a dependency.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2025-04-25 10:12:36 +02:00
Michael Vetter
c8e8557803 ci: add openSUSE Tumbleweed
Add an ansible task for openSUSE which will use the
configure options used by the official openSUSE package.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2025-01-21 13:09:24 +01:00
Serge Hallyn
65723c3c47 add and use a login.defs.test with CREATE_HOME set
I suspect this is not a big deal, and most distributions just ship their own
version verbatim like debian/login.defs. But if there is a distro - or even a
person - using this as is from upstream, then we dont' want to break them. So
let's undo this and use an etc/login.defs.test for the testing if needed.

Changelog: 01/13: move etc/login.defs.test to tests/system/etc/login.defs per
                  suggestion.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2025-01-14 12:09:22 +01:00
Iker Pedrosa
1807360fce CI: run system tests
Run the newly created system tests in CI and collect artifacts.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2025-01-10 20:21:07 -06:00
Alejandro Colomar
365279ea95 share/container-build.sh: Fix path
The instructions are written so that this script should be run from the
root of the repository.  Specify the path from the root of the repo.
Before this fix, the command needed to be run from within <share/>.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-25 16:23:43 +01:00
Iker Pedrosa
c8c3731e05 CI: fix fedora build problems
The new fedora 41 has been released and some things have changed. Make
sure to install python and python3-dnf and specify the dnf version in
the roles.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-10-31 09:52:54 -05:00
Iker Pedrosa
fffa4d3e27 share/containers: remove unused dockerfiles
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
f56e79a2b7 share/container-build.sh: update to use Ansible build
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
d8fb10f7b7 share/ansible: implement distribution selection
Distribution to run can be selected when running `ansible-playbook` by
appending `-e 'distribution=fedora'` to the command.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
80c4e70da0 share/ansible: convert alpine dockerfile to ansible
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
1d6f578f3e share/ansible: convert debian dockerfile to ansible
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
9a53a8aebd share/ansible: move fedora ci_run to its own file
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
36e8015e2b share/.gitignore: add build-out folder
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
df50348a28 share/ansible: create roles
Create `build_container` and `ci_run` roles and move the fedora target
to them.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
9a0cd7a231 share/ansible: convert fedora dockerfile to ansible
Using a dockerfile to build, install and test the code can be
problematic as we can't capture the log files to check what failed in
case of failure. This PR converts the fedora dockerfile to Ansible, an
open source IT automation tool. The tool can be used on the developers
and the CI system to check whether a piece of code can be built,
installed and tested.

This is the first patch in a series, where I will convert the existing
PR workflows to use Ansible instead of dockerfiles.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-07-18 10:17:29 -05:00
Iker Pedrosa
dbd3527c03 share/containers: update build flags for fedora 40
libpam is enabled to provide `passwd` binary from this package, as there
are several password quality checks that are enabled through a PAM
module. Same reason to disable account-tools-setuid.

sssd is disabled because `files provider` has been removed in sssd, and
the underlying functionality in shadow isn't needed anymore.

libcrack dependency was disabled some time ago, but the upstream repo
wasn't updated. Doing it now.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2024-05-02 10:45:03 +02:00
Iker Pedrosa
dbf3b1ad51 share/containers: sort configuration options
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2024-05-02 10:45:03 +02:00
Iker Pedrosa
b8f17f9c29 share/containers: fix indentation in fedora
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2024-05-02 10:45:03 +02:00
Alejandro Colomar
a3cae72faa share/containers/, .github/workflows/: Don't make(1) twice
It was being done so that the second one prints errors without races.
However, the same thing can be achieved by passing -Orecurse to make(1).

And this makes the logs even more readable, since there's no racy output
at all.

Fixes: 97f79e3b2715 ("CI: Make build logs more readable")
Link: <https://github.com/shadow-maint/shadow/pull/702>
Link: <https://github.com/nginx/unit/pull/1123>
Acked-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Andrew Clayton <a.clayton@nginx.com>
Cc: Konstantin Pavlov <thresh@nginx.com>
Cc: Dylan Arbour <https://github.com/arbourd>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-13 11:05:36 -05:00
Alejandro Colomar
d13844408c share/containers/: trap(1) to see the cmocka logs
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-04 01:43:25 +01:00
Alejandro Colomar
e59a39663d share/containers/: Specify one argument per line
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-04 01:43:25 +01:00
Sam James
0f4e59fd00 Link correctly with libdl
This fixes build with glibc-2.33 (newer glibc merged libdl and libpthread
into libc):
```
libtool: link: x86_64-pc-linux-gnu-gcc -isystem /usr/include/bsd -DLIBBSD_OVERLAY -O2 -pipe -Wl,-O1 -o login login.o login_nopam.o  -Wl,--as-needed ../lib/.libs/libshadow.a -lcrypt -lsystemd -lpam -lpam_misc -lbsd
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: ../lib/.libs/libshadow.a(libshadow_la-nss.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```

In Debian, the needed macro from libtool seems to be in libltdl-dev.

Signed-off-by: Sam James <sam@gentoo.org>
2024-01-26 10:05:40 +01:00
Alejandro Colomar
45f34ee8c1 Remove libcrack support
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-25 21:24:38 -06:00
Iker Pedrosa
a9e642d444 CI: fix Fedora 39 build
libbsd is unwanted in Fedora and RHEL, and the recently released Fedora
39 doesn't contain this dependency in the base image.

shadow removed libbsd from its dependencies for Fedora 39, so let's
build without it to avoid compilation errors.

Resolves: https://github.com/shadow-maint/shadow/issues/839

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2023-11-13 12:39:13 +01:00
Iker Pedrosa
0fc697a4b1 CI: build and run unit tests
Run `make check` after the project is built in every runner.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-09-29 09:24:01 +02:00
Iker Pedrosa
02e3e04205 CI: compile old utmp interface in Fedora
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-08-02 10:13:28 -05:00
Iker Pedrosa
c69fd917e3 CI: build lastlog in Fedora
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-07-15 07:39:53 -05:00
Iker Pedrosa
a0eeb9fbf2 CI: update debian repos
Latest debian version changed the location and format for the repos
file.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-07-14 11:49:40 +02:00
Alejandro Colomar
97f79e3b27 CI: Make build logs more readable
If make fails in a multi-process invocation, the log is pretty much
unreadable.  To make it readable, build as much as can be built without
failing.  Then run a single-process make again.  If we succeeded
previously, this should be a no-op.  If not, this run will stop at the
first error, which should be more readable, and will only print the few
lines we're interested in.

This has some side effects:  Now we build as much as we can, instead of
failing as early as possible; this may make CI a bit slower.  However,
it also has the benefit that you see _all_ the error messages that could
be given, instead of needing to fix the first error to see the next and
so on.

Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-18 09:21:09 +02:00
Iker Pedrosa
075ed522be ci: remove explicit fedora dependencies
libbsd-devel libeconf-devel have already been added to the spec file and
they should be installed by the `dnf builddep` command.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-04-13 13:05:32 +02:00
Iker Pedrosa
300d6ef45c CI: script for local container build
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-03-26 12:45:34 -05:00
Iker Pedrosa
411a66476d container: add fedora
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-03-26 12:45:34 -05:00
Iker Pedrosa
3efab2039f container: add debian
Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-03-26 12:45:34 -05:00
Iker Pedrosa
baff19767d container: add alpine
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-03-26 12:45:34 -05:00