From 2aae7a5778495d4345cbdee5b2f142ee1e844d81 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Mon, 22 Apr 2024 13:48:25 +0200 Subject: [PATCH 1/9] CI: skip 'multihost' and 'system' tests Those depends on 'systemd' integration. --- .github/workflows/ci.yml | 182 +-------------------------------------- 1 file changed, 1 insertion(+), 181 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa27cb00d94..181b63a2c89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,194 +136,14 @@ jobs: path: | ./sssd/ci-build-debug/*.valgrind.log - system: - needs: [prepare, build] - strategy: - fail-fast: false - matrix: - tag: ${{ fromJson(needs.prepare.outputs.matrix).multihost }} - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: Checkout sssd repository - uses: actions/checkout@v4 - with: - path: sssd - - - name: Setup containers - uses: SSSD/sssd-ci-containers/actions/setup@master - with: - path: sssd-ci-containers - tag: ${{ matrix.tag }} - override: | - services: - client: - image: ${REGISTRY}/ci-client-devel:${TAG} - shm_size: 4G - tmpfs: - - /dev/shm - volumes: - - ../sssd:/sssd:rw - ipa: - image: ${REGISTRY}/ci-ipa-devel:${TAG} - shm_size: 4G - tmpfs: - - /dev/shm - volumes: - - ../sssd:/sssd:rw - - - name: Build SSSD on the client and IPA - uses: SSSD/sssd-ci-containers/actions/exec@master - with: - log-file: build.log - working-directory: /sssd - where: | - client - ipa - script: | - #!/bin/bash - set -ex - - ./contrib/ci/run --deps-only - autoreconf -if - - mkdir -p /dev/shm/sssd - pushd /dev/shm/sssd - /sssd/configure --enable-silent-rules - make rpms - - - name: Install SSSD on the client and IPA - uses: SSSD/sssd-ci-containers/actions/exec@master - with: - log-file: install.log - user: root - where: | - client - ipa - script: | - #!/bin/bash - set -ex - - dnf install -y /dev/shm/sssd/rpmbuild/RPMS/*/*.rpm - rm -fr /dev/shm/sssd - - # We need to reenable sssd-kcm since it was disabled by removing sssd not not enabled again - systemctl enable --now sssd-kcm.socket - - - name: Restart SSSD on IPA server - uses: SSSD/sssd-ci-containers/actions/exec@master - with: - user: root - where: ipa - script: | - #!/bin/bash - set -ex - - systemctl restart sssd || systemctl status sssd - - - name: Patch the SSH configuration - uses: SSSD/sssd-ci-containers/actions/exec@master - with: - user: root - script: | - #!/bin/bash - test -x /usr/bin/sss_ssh_knownhosts && \ - sed -e 's/GlobalKnownHostsFile/#GlobalKnownHostsFile/' \ - -e 's/ProxyCommand \/usr\/bin\/sss_ssh_knownhostsproxy -p %p %h/KnownHostsCommand \/usr\/bin\/sss_ssh_knownhosts %H/' \ - -i /etc/ssh/ssh_config.d/04-ipa.conf - - - name: Install system tests dependencies - shell: bash - working-directory: ./sssd/src/tests/system - run: | - set -ex - - sudo apt-get update - - # Install dependencies for python-ldap - sudo apt-get install -y libsasl2-dev python3-dev libldap2-dev libssl-dev - - # Virtualenv - pip3 install virtualenv - python3 -m venv .venv - source .venv/bin/activate - - # Install system tests requirements - pip3 install -r ./requirements.txt - - # Install yq to parse yaml files - sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 - sudo chmod a+x /usr/local/bin/yq - - - name: Remove ad from mhc.yaml - shell: bash - working-directory: ./sssd/src/tests/system - run: | - yq -i 'del(.domains[0].hosts.[] | select(.role == "ad"))' mhc.yaml - - - name: Check polarion metadata - shell: bash - working-directory: ./sssd/src/tests/system - run: | - # Run pytest in collect only mode to quickly catch issues in Polarion metadata. - set -ex -o pipefail - - mkdir -p $GITHUB_WORKSPACE/artifacts - source .venv/bin/activate - pytest \ - --color=yes \ - --mh-config=./mhc.yaml \ - --mh-artifacts-dir=$GITHUB_WORKSPACE/artifacts \ - --polarion-config=../polarion.yaml \ - --output-polarion-testcase=$GITHUB_WORKSPACE/artifacts/testcase.xml \ - --collect-only . |& tee $GITHUB_WORKSPACE/pytest-collect.log - - - name: Run tests - shell: bash - working-directory: ./sssd/src/tests/system - run: | - set -ex -o pipefail - - mkdir -p $GITHUB_WORKSPACE/artifacts - source .venv/bin/activate - pytest \ - --color=yes \ - --show-capture=no \ - --mh-config=./mhc.yaml \ - --mh-artifacts-dir=$GITHUB_WORKSPACE/artifacts \ - --polarion-config=../polarion.yaml \ - --output-polarion-testcase=$GITHUB_WORKSPACE/artifacts/testcase.xml \ - --output-polarion-testrun=$GITHUB_WORKSPACE/artifacts/testrun.xml \ - -vvv . |& tee $GITHUB_WORKSPACE/pytest.log - - - name: Upload artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - if-no-files-found: ignore - name: ${{ matrix.tag }}-system - path: | - sssd/ci-install-deps.log - artifacts - build.log - install.log - pytest.log - pytest-collect.log - result: name: All tests are successful if: ${{ always() }} runs-on: ubuntu-latest - needs: [build, intgcheck, system] + needs: [build, intgcheck] steps: - name: Fail on failure if: | needs.build.result != 'success' || needs.intgcheck.result != 'success' - || needs.system.result != 'success' run: exit 1 From 057085468818065741d0ca5fa35b1eba16c425cd Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Thu, 28 Mar 2024 22:15:02 +0100 Subject: [PATCH 2/9] SPEC: don't build 'systemtap' support --- contrib/sssd.spec.in | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 71d3285ffa2..9266e279d21 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -171,10 +171,6 @@ BuildRequires: selinux-policy-targeted BuildRequires: softhsm >= 2.1.0 BuildRequires: bc BuildRequires: systemd-devel -BuildRequires: systemtap-sdt-devel -%if 0%{?fedora} >= 41 || 0%{?rhel} >= 10 -BuildRequires: systemtap-sdt-dtrace -%endif BuildRequires: uid_wrapper BuildRequires: po4a BuildRequires: valgrind-devel @@ -596,7 +592,7 @@ autoreconf -ivf --enable-nsslibdir=%{_libdir} \ --enable-pammoddir=%{_libdir}/security \ --enable-sss-default-nss-plugin \ - --enable-systemtap \ + --disable-systemtap \ --with-db-path=%{dbpath} \ --with-gpo-cache-path=%{gpocachepath} \ --with-init-dir=%{_initrddir} \ @@ -883,16 +879,6 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf %{_mandir}/man5/sssd-session-recording.5* %{_mandir}/man8/sssd.8* %{_mandir}/man8/sss_cache.8* -%dir %{_datadir}/sssd/systemtap -%{_datadir}/sssd/systemtap/id_perf.stp -%{_datadir}/sssd/systemtap/nested_group_perf.stp -%{_datadir}/sssd/systemtap/dp_request.stp -%{_datadir}/sssd/systemtap/ldap_perf.stp -%dir %{_datadir}/systemtap -%dir %{_datadir}/systemtap/tapset -%{_datadir}/systemtap/tapset/sssd.stp -%{_datadir}/systemtap/tapset/sssd_functions.stp -%{_mandir}/man5/sssd-systemtap.5* %if %{use_sysusers} %{_sysusersdir}/sssd.conf %endif From 29f5e0c775225e49ebdeaade77dc9ede1ca5445b Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 2 Apr 2024 16:51:53 +0200 Subject: [PATCH 3/9] SPEC: don't build 'selinux_child' support --- contrib/sssd.spec.in | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 9266e279d21..1f70f5a016d 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -135,8 +135,6 @@ BuildRequires: libini_config-devel >= 1.3 BuildRequires: libldb-devel >= %{ldb_version} BuildRequires: libnfsidmap-devel BuildRequires: libnl3-devel -BuildRequires: libselinux-devel -BuildRequires: libsemanage-devel BuildRequires: libsmbclient-devel BuildRequires: libtalloc-devel BuildRequires: libtdb-devel @@ -166,7 +164,6 @@ BuildRequires: python3-setuptools BuildRequires: samba-devel # required for idmap_sss.so BuildRequires: samba-winbind -BuildRequires: selinux-policy-targeted # required for p11_child smartcard tests BuildRequires: softhsm >= 2.1.0 BuildRequires: bc @@ -623,6 +620,7 @@ autoreconf -ivf %if %{build_ssh_known_hosts_proxy} --with-ssh-known-hosts-proxy \ %endif + --without-selinux \ %{nil} %make_build all docs runstatedir=%{_rundir} @@ -918,7 +916,6 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf %license COPYING %attr(770,%{sssd_user},%{sssd_user}) %dir %{keytabdir} %{_libdir}/%{name}/libsss_ipa.so -%attr(0750,root,%{sssd_user}) %caps(cap_chown,cap_dac_override,cap_setuid,cap_setgid=ep) %{_libexecdir}/%{servicename}/selinux_child %{_mandir}/man5/sssd-ipa.5* %files ad -f sssd_ad.lang From c3734dae33505647dd11c08b677a86cc5b96fcf6 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 2 Apr 2024 20:19:55 +0200 Subject: [PATCH 4/9] SPEC: don't build subid ranges support --- contrib/sssd.spec.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 1f70f5a016d..6ccc5468006 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -23,11 +23,7 @@ %global use_sysusers 0 %endif -%if 0%{?fedora} >= 35 || 0%{?rhel} >= 9 -%global build_subid 1 -%else %global build_subid 0 -%endif %if 0%{?fedora} >= 34 %global build_kcm_renewals 1 From ce34aae99fb00afb50b1d7fea702af6111cd1600 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 2 Apr 2024 20:20:21 +0200 Subject: [PATCH 5/9] SPEC: don't build 'passkey' auth support --- contrib/sssd.spec.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 6ccc5468006..32ddb916ebb 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -35,11 +35,7 @@ %global build_kcm_renewals 0 %endif -%if 0%{?fedora} >= 39 || 0%{?rhel} >= 9 -%global build_passkey 1 -%else %global build_passkey 0 -%endif %if 0%{?fedora} >= 41 || 0%{?rhel} >= 10 %global build_ssh_known_hosts_proxy 0 From f9bbfec3e76b014fcdd9b882a0ea94cc729d8879 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Thu, 28 Mar 2024 22:19:39 +0100 Subject: [PATCH 6/9] SPEC: build with 'syslog' instead of 'journald' --- contrib/sssd.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 32ddb916ebb..7eeb56e7c96 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -591,7 +591,7 @@ autoreconf -ivf --with-pipe-path=%{pipepath} \ --with-pubconf-path=%{pubconfpath} \ --with-sssd-user=%{sssd_user} \ - --with-syslog=journald \ + --with-syslog=syslog \ --with-test-dir=/dev/shm \ %if 0%{?rhel} == 9 --with-libsifp \ From e5d371e906e0802adb6f3e3a53f0eab84c1b2a41 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 2 Apr 2024 18:16:07 +0200 Subject: [PATCH 7/9] SPEC: don't build 'systemd' integration --- Makefile.am | 9 ----- contrib/sssd.spec.in | 82 +------------------------------------------- 2 files changed, 1 insertion(+), 90 deletions(-) diff --git a/Makefile.am b/Makefile.am index cfc7f69c896..ceec0b9fdf9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5268,15 +5268,6 @@ if BUILD_KCM src/sysv/systemd/sssd-kcm.service \ $(NULL) endif -else -if HAVE_GENTOO - init_SCRIPTS += \ - src/sysv/gentoo/sssd \ - src/sysv/gentoo/sssd-kcm -else - init_SCRIPTS += \ - src/sysv/sssd -endif endif diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 7eeb56e7c96..a5741dba968 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -16,12 +16,7 @@ %global sssd_user root %endif -# sysusers depends on presence of sssd user -%if 0%{?fedora} >= 41 || 0%{?rhel} >= 10 -%global use_sysusers 1 -%else %global use_sysusers 0 -%endif %global build_subid 0 @@ -159,7 +154,6 @@ BuildRequires: samba-winbind # required for p11_child smartcard tests BuildRequires: softhsm >= 2.1.0 BuildRequires: bc -BuildRequires: systemd-devel BuildRequires: uid_wrapper BuildRequires: po4a BuildRequires: valgrind-devel @@ -211,7 +205,6 @@ Requires(postun): coreutils %if %{use_sssd_user} Requires(pre): shadow-utils %endif -%{?systemd_requires} ### Provides ### Provides: libsss_sudo-devel = %{version}-%{release} @@ -258,8 +251,6 @@ Requires: sssd-common = %{version}-%{release} Requires: python3-sss = %{version}-%{release} Requires: python3-sssdconfig = %{version}-%{release} Requires: libsss_certmap = %{version}-%{release} -# for logger=journald support with sss_analyze -Requires: python3-systemd Requires: sssd-dbus %description tools @@ -451,7 +442,6 @@ be used by Python applications. Summary: The D-Bus responder of the SSSD License: GPL-3.0-or-later Requires: sssd-common = %{version}-%{release} -%{?systemd_requires} %description dbus Provides the D-Bus responder of the SSSD, called the InfoPipe, that allows @@ -534,7 +524,6 @@ Requires: sssd-common = %{version}-%{release} Requires: krb5-libs >= %{krb5_version} Requires: sssd-krb5-common = %{version}-%{release} %endif -%{?systemd_requires} %description kcm An implementation of a Kerberos KCM server. Use this package if you want to @@ -585,7 +574,7 @@ autoreconf -ivf --with-db-path=%{dbpath} \ --with-gpo-cache-path=%{gpocachepath} \ --with-init-dir=%{_initrddir} \ - --with-initscript=systemd \ + --with-initscript=sysv \ --with-krb5-rcache-dir=%{_localstatedir}/cache/krb5rcache \ --with-mcache-path=%{mcpath} \ --with-pipe-path=%{pipepath} \ @@ -774,19 +763,6 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf %license COPYING %doc src/examples/sssd-example.conf %{_sbindir}/sssd -%{_unitdir}/sssd.service -%{_unitdir}/sssd-autofs.socket -%{_unitdir}/sssd-autofs.service -%{_unitdir}/sssd-nss.socket -%{_unitdir}/sssd-nss.service -%{_unitdir}/sssd-pac.socket -%{_unitdir}/sssd-pac.service -%{_unitdir}/sssd-pam.socket -%{_unitdir}/sssd-pam.service -%{_unitdir}/sssd-ssh.socket -%{_unitdir}/sssd-ssh.service -%{_unitdir}/sssd-sudo.socket -%{_unitdir}/sssd-sudo.service %{_tmpfilesdir}/%{name}.conf @@ -798,7 +774,6 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf %{_libexecdir}/%{servicename}/sssd_ssh %{_libexecdir}/%{servicename}/sssd_sudo %{_libexecdir}/%{servicename}/p11_child -%{_libexecdir}/%{servicename}/sssd_check_socket_activated_responders %dir %{_libdir}/%{name} %if 0%{?rhel} == 9 @@ -925,7 +900,6 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf %license COPYING %{_libexecdir}/%{servicename}/sssd_ifp %{_mandir}/man5/sssd-ifp.5* -%{_unitdir}/sssd-ifp.service # InfoPipe DBus plumbing %{_datadir}/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf %{_datadir}/dbus-1/system-services/org.freedesktop.sssd.infopipe.service @@ -1064,8 +1038,6 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf %config(noreplace) %{_sysconfdir}/krb5.conf.d/kcm_default_ccache %dir %{_datadir}/sssd-kcm %{_datadir}/sssd-kcm/kcm_default_ccache -%{_unitdir}/sssd-kcm.socket -%{_unitdir}/sssd-kcm.service %{_mandir}/man8/sssd-kcm.8* %files idp @@ -1097,13 +1069,6 @@ getent passwd sssd >/dev/null || useradd -r -g sssd -d /run/sssd -s /sbin/nologi %endif %post common -%systemd_post sssd.service -%systemd_post sssd-autofs.socket -%systemd_post sssd-nss.socket -%systemd_post sssd-pac.socket -%systemd_post sssd-pam.socket -%systemd_post sssd-ssh.socket -%systemd_post sssd-sudo.socket %__rm -f %{mcpath}/passwd %__rm -f %{mcpath}/group %__rm -f %{mcpath}/initgroups @@ -1115,53 +1080,11 @@ getent passwd sssd >/dev/null || useradd -r -g sssd -d /run/sssd -s /sbin/nologi %__chown -f %{sssd_user}:%{sssd_user} %{secdbpath}/*.ldb || true %__chown -f -R %{sssd_user}:%{sssd_user} %{gpocachepath} || true -%preun common -%systemd_preun sssd.service -%systemd_preun sssd-autofs.socket -%systemd_preun sssd-nss.socket -%systemd_preun sssd-pac.socket -%systemd_preun sssd-pam.socket -%systemd_preun sssd-ssh.socket -%systemd_preun sssd-sudo.socket - %postun common %__rm -f %{mcpath}/passwd %__rm -f %{mcpath}/group %__rm -f %{mcpath}/initgroups %__rm -f %{mcpath}/sid -%systemd_postun_with_restart sssd-autofs.socket -%systemd_postun_with_restart sssd-nss.socket -%systemd_postun_with_restart sssd-pac.socket -%systemd_postun_with_restart sssd-pam.socket -%systemd_postun_with_restart sssd-ssh.socket -%systemd_postun_with_restart sssd-sudo.socket - -# Services have RefuseManualStart=true, therefore we can't request restart. -%systemd_postun sssd-autofs.service -%systemd_postun sssd-nss.service -%systemd_postun sssd-pac.service -%systemd_postun sssd-pam.service -%systemd_postun sssd-ssh.service -%systemd_postun sssd-sudo.service - -%post dbus -%systemd_post sssd-ifp.service - -%preun dbus -%systemd_preun sssd-ifp.service - -%postun dbus -%systemd_postun_with_restart sssd-ifp.service - -%post kcm -%systemd_post sssd-kcm.socket - -%preun kcm -%systemd_preun sssd-kcm.socket - -%postun kcm -%systemd_postun_with_restart sssd-kcm.socket -%systemd_postun_with_restart sssd-kcm.service %post client /usr/sbin/alternatives --install /etc/cifs-utils/idmap-plugin cifs-idmap-plugin %{_libdir}/cifs-utils/cifs_idmap_sss.so 20 @@ -1171,9 +1094,6 @@ if [ $1 -eq 0 ] ; then /usr/sbin/alternatives --remove cifs-idmap-plugin %{_libdir}/cifs-utils/cifs_idmap_sss.so || true fi -%posttrans common -%systemd_postun_with_restart sssd.service - %changelog * Thu Jan 21 2021 Pavel Březina - @PACKAGE_NAME@-@PACKAGE_VERSION@-0@PRERELEASE_VERSION@ - Built from upstream sources. From 57c67f61e7141bcf164e43be907ed9d881f75fcb Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Wed, 29 May 2024 19:06:33 +0200 Subject: [PATCH 8/9] BUILD: introduce "--with-syslog=stderr" option to be used in containers-like environments where no system wide logger is available. --- Makefile.am | 4 ++++ src/conf_macros.m4 | 11 ++++++++--- src/util/sss_log.c | 21 +++++++++++++++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index ceec0b9fdf9..52b72ad1bb2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,10 @@ if WITH_JOURNALD extra_distcheck_flags += --with-syslog=journald endif +if WITH_STDERR_SYSLOG + extra_distcheck_flags += --with-syslog=stderr +endif + DISTCHECK_CONFIGURE_FLAGS = --with-ldb-lib-dir="$$dc_install_base"/lib/ldb \ $(extra_distcheck_flags) \ $(AUX_DISTCHECK_CONFIGURE_FLAGS) diff --git a/src/conf_macros.m4 b/src/conf_macros.m4 index 6ece1c79be9..9f701aed780 100644 --- a/src/conf_macros.m4 +++ b/src/conf_macros.m4 @@ -144,7 +144,7 @@ AC_DEFUN([WITH_INITSCRIPT], AC_DEFUN([WITH_SYSLOG], [ AC_ARG_WITH([syslog], [AC_HELP_STRING([--with-syslog=SYSLOG_TYPE], - [Type of your system logger (syslog|journald). [syslog]] + [Type of your system logger (syslog|journald|stderr). [syslog]] ) ], [], @@ -152,13 +152,18 @@ AC_DEFUN([WITH_SYSLOG], ) if test x"$with_syslog" = xsyslog || \ - test x"$with_syslog" = xjournald; then + test x"$with_syslog" = xjournald || \ + test x"$with_syslog" = xstderr; then syslog=$with_syslog else - AC_MSG_ERROR([Unknown syslog type, supported types are syslog and journald]) + AC_MSG_ERROR([Unknown syslog type, supported types are syslog, journald and stderr]) fi AM_CONDITIONAL([WITH_JOURNALD], [test x"$syslog" = xjournald]) + AM_CONDITIONAL([WITH_STDERR_SYSLOG], [test x"$syslog" = xstderr]) + if test x"$with_syslog" = xstderr; then + AC_DEFINE_UNQUOTED([WITH_STDERR_SYSLOG], 1, [Send syslog to stderr]) + fi ]) AC_DEFUN([WITH_ENVIRONMENT_FILE], diff --git a/src/util/sss_log.c b/src/util/sss_log.c index 3c415d4ff94..983455e8fdc 100644 --- a/src/util/sss_log.c +++ b/src/util/sss_log.c @@ -26,10 +26,15 @@ #ifdef WITH_JOURNALD #include -#else /* WITH_JOURNALD */ +#else +#ifdef WITH_STDERR_SYSLOG +#include +#else #include -#endif /* WITH_JOURNALD */ +#endif +#endif +#if !defined(WITH_STDERR_SYSLOG) static int sss_to_syslog(int priority) { switch(priority) { @@ -59,13 +64,19 @@ static int sss_to_syslog(int priority) static void sss_log_internal(int priority, int facility, const char *format, va_list ap); +#endif + void sss_log(int priority, const char *format, ...) { va_list ap; va_start(ap, format); +#if !defined(WITH_STDERR_SYSLOG) sss_log_internal(priority, LOG_DAEMON, format, ap); +#else + vfprintf(stderr, format, ap); +#endif va_end(ap); } @@ -74,7 +85,11 @@ void sss_log_ext(int priority, int facility, const char *format, ...) va_list ap; va_start(ap, format); +#if !defined(WITH_STDERR_SYSLOG) sss_log_internal(priority, facility, format, ap); +#else + vfprintf(stderr, format, ap); +#endif va_end(ap); } @@ -114,6 +129,7 @@ static void sss_log_internal(int priority, int facility, const char *format, } #else /* WITH_JOURNALD */ +#if !defined(WITH_STDERR_SYSLOG) static void sss_log_internal(int priority, int facility, const char *format, va_list ap) @@ -123,4 +139,5 @@ static void sss_log_internal(int priority, int facility, const char *format, vsyslog(facility|syslog_priority, format, ap); } +#endif /* !WITH_STDERR_SYSLOG */ #endif /* WITH_JOURNALD */ From d6dc9ebc81ced7c311d885c65bfe09e9ae8af6f8 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Wed, 29 May 2024 19:13:39 +0200 Subject: [PATCH 9/9] SPEC: build '--with-syslog=stderr' --- contrib/ci/configure.sh | 2 +- contrib/fedora/bashrc_sssd | 2 +- contrib/sssd.spec.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/ci/configure.sh b/contrib/ci/configure.sh index e7cc3af23ab..ebc82f4701c 100644 --- a/contrib/ci/configure.sh +++ b/contrib/ci/configure.sh @@ -28,7 +28,7 @@ declare -a CONFIGURE_ARG_LIST=( "--disable-static" "--enable-ldb-version-check" "--with-initscript=sysv" - "--with-syslog=syslog" + "--with-syslog=stderr" "--enable-systemtap" ) diff --git a/contrib/fedora/bashrc_sssd b/contrib/fedora/bashrc_sssd index 06d585c2495..1ff35ca2bd4 100644 --- a/contrib/fedora/bashrc_sssd +++ b/contrib/fedora/bashrc_sssd @@ -47,7 +47,7 @@ fedconfig() --enable-systemtap \ --with-krb5-rcache-dir=/var/cache/krb5rcache \ --with-initscript=systemd \ - --with-syslog=journald \ + --with-syslog=stderr \ --with-test-dir=/dev/shm \ --cache-file=/tmp/fedconfig.cache \ --with-passkey \ diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index a5741dba968..7ff4fcda2f2 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -580,7 +580,7 @@ autoreconf -ivf --with-pipe-path=%{pipepath} \ --with-pubconf-path=%{pubconfpath} \ --with-sssd-user=%{sssd_user} \ - --with-syslog=syslog \ + --with-syslog=stderr \ --with-test-dir=/dev/shm \ %if 0%{?rhel} == 9 --with-libsifp \