|
Bugzilla – Full Text Bug Listing |
| Summary: | RPM macro %{_distconfdir} expands to incorrect path | ||
|---|---|---|---|
| Product: | [openSUSE] PUBLIC SUSE Linux Enterprise Server 15 SP4 | Reporter: | Ignaz Forster <iforster> |
| Component: | Other | Assignee: | package coldpool <coldpool> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | Normal | ||
| Priority: | P1 - Urgent | CC: | fbui, fcrozat, fvogt, gyribeiro, kukuk, lubos.kocman, rtsvetkov, sbrabec, stephan.barth, sweiberg, vmoutoussamy |
| Version: | PublicBeta-202202 | ||
| Target Milestone: | PublicBeta-202202 | ||
| Hardware: | Other | ||
| OS: | Other | ||
| See Also: | https://bugzilla.suse.com/show_bug.cgi?id=1196093 | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Bug Depends on: | 1195996, 1195997, 1195998, 1196228 | ||
| Bug Blocks: | |||
Just adding to this: Setting the expansion to /etc will cause other side effects.
Files in /etc would need to be flagged as %config files, however when using %{_distconfdir} one is *not* supposed to use the %config flag: https://en.opensuse.org/openSUSE:Packaging_UsrEtc#What_does_this_mean_for_the_developer.2Fpackager.3F
Or in other words: %{_distconfdir} and %config / %{_sysconfdir} seem to be mutually exclusive, so one can't just set the value to the same directory...
The solution is quite simple: _distconfdir does not exist on SLE15, so it should not be defined at all. While using _sysconfdir at the first glance looks like a good idea as fallback, this does in reality not work, as the code using _distconfdir expects that this is different than _sysconfdir. _distconfdir is defined in SLE due to a change for implementing https://jira.suse.com/browse/SLE-20017. It has been introduced with this submission by Frederic and set to /etc: https://build.suse.de/request/show/248159 I can see that a package like openssh would likely have a problem if we set it to /usr/etc, because it checks if the macro is defined and changes the location accordingly: %if %{defined _distconfdir} install -d -m 755 %{buildroot}%{_distconfdir}/pam.d install -m 644 %{SOURCE2} %{buildroot}%{_distconfdir}/pam.d/sshd %else install -d -m 755 %{buildroot}%{_sysconfdir}/pam.d install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/sshd %endif As far as I understand transactional-update doesn't necessarily require a defined _distconfdir, right? And I am not 100% sure, but I think we also don't need it defined to fulfil the request by Frederic, as we are mostly looking for other macros. In this case we can just remove the definition. Exactly, transactional-update spec file will define the variable for itself if not set.
The openSSL package is an excellent example to illustrate this bug by the way: If the package would be rebuilt for SLE15 SP4 now, the configuration files would suddenly end up in /etc, but without being declared as %config files. That's why %{_distconfdir} must never be the same directory as %{_sysconfdir}.
Sorry, openssl -> openssh Understood and fix submitted. Gonna remove the _distconfdir definition for SLE 15 SP4 from the rpm-config-SUSE. Hello, is there any progress on this issue? Last SR was revoked with no reference to superseeding commit, nor rpm-config-SUSE has any related changes. Thank you! Looks like a maintenance update of pam uses _distconfdir for defining _pam_vendordir: https://build.suse.de/package/view_file/SUSE:SLE-15:Update/pam.21584/macros.pam?expand=1 Only that _distconfdir hasn't been defined in 15 GA - 15 SP3. We were lucky so far, that this didn't cause any issues that we know of. Blocks autologin on Leap 15.4 (a lot of test fails) I saw that systemd and kbd fail to build in the staging project with the rpm-config-SUSE change, so I submitted fixes for them: kbd to devel prj: https://build.opensuse.org/request/show/956359 systemd to OBS devel prj: https://build.opensuse.org/request/show/956356 kbd to SP4:GA: https://build.suse.de/request/show/265636 Adding maintainers to CC. (In reply to Stefan Weiberg from comment #11) > Looks like a maintenance update of pam uses _distconfdir for defining > _pam_vendordir: > > https://build.suse.de/package/view_file/SUSE:SLE-15:Update/pam.21584/macros. > pam?expand=1 > > Only that _distconfdir hasn't been defined in 15 GA - 15 SP3. We were lucky > so far, that this didn't cause any issues that we know of. Yep. I suppose that it's not used by (m)any packages in SLE 15 yet. This is an autogenerated message for OBS integration: This bug (1195679) was mentioned in https://build.opensuse.org/request/show/956468 Factory / sddm https://build.opensuse.org/request/show/956469 Backports:SLE-15-SP4 / sddm This is an autogenerated message for OBS integration: This bug (1195679) was mentioned in https://build.opensuse.org/request/show/956820 Factory / systemd rpm-config-SUSE got accepted into 15 SP4 with systemd and kbd, the fix for PAM is on its way. |
The macro %{_distconfdir}, defined in https://build.suse.de/package/view_file/SUSE:SLE-15-SP4:GA/rpm-config-SUSE/macros.rpm415, expands to "/etc". This is not correct (that would be %{_sysconfdir}) and should be "/usr/etc" - also see the upstream definition at https://github.com/openSUSE/rpm-config-SUSE/blob/master/suse_macros.in#L13. Due to that the transactional-update build for SLE15 SP4 in https://build.suse.de/package/live_build_log/SUSE:SLE-15-SP4:GA:Staging:C/transactional-update/standard/x86_64 is currently failing.