#1856 Issue closed
: Fedora rear.spec: Remove needless use of %defattr¶
Labels: cleanup
, not ReaR / invalid
gdha opened issue at 2018-07-11 08:57:¶
-
ReaR version ("/usr/sbin/rear -V"): 2.4 and higher
-
OS version ("cat /etc/rear/os.conf" or "lsb_release -a" or "cat /etc/os-release"): fedora
-
Brief description of the issue: the
rear.spec
requires a minor cleanup according Fedora packager tibbs -
Work-around, if any: https://src.fedoraproject.org/rpms/rear/c/d6fb8b91aa508e044a22eaeae787f5e7364e5118?branch=master
diff --git a/rear.spec b/rear.spec
index 5d9bdcb..1a67f3d 100644
--- a/rear.spec
+++ b/rear.spec
@@ -145,7 +145,6 @@ echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >re
%{__rm} -rf %{buildroot}
%files
-%defattr(-, root, root, 0755)
%doc MAINTAINERS COPYING README.adoc doc/*.txt
%doc %{_mandir}/man8/rear.8*
%config(noreplace) %{_sysconfdir}/cron.d/rear
Action: check the Fedora Packaging Guide what they have to say about it: https://fedoraproject.org/wiki/Packaging:Guidelines#File_Permissions
gdha commented at 2018-07-11 09:02:¶
From the File Permissions section
https://fedoraproject.org/wiki/Packaging:Guidelines#File_Permissions
The default file mode is 0644 or 0755. Directories should be mode 0755. Most well behaved build scripts and rpm will use these defaults. If the directory needs to be group writable, it SHOULD also have the setgid bit set so that files written there are owned by that group. These directories SHOULD have mode 2775. The %defattr directive in the %files list SHOULD ONLY be used when setting a non-default value, or to reset to the default value after having set a non-default value.
gdha commented at 2018-07-11 09:03:¶
@jsmeix The above statement is probably for RHEL based systems. The question is now does this also applies to SLES based systems?
jsmeix commented at 2018-07-11 09:34:¶
See my https://github.com/rear/rear/issues/1855#issuecomment-404100990
I think our ReaR upstream rear.spec
is o.k. as long as our ReaR
upstream RPMs
get built o.k. by the openSUSE build service for the various Linux
distributions.
FYI:
My own rear.spec
at
https://build.opensuse.org/package/view_file/Archiving/rear/rear.spec?expand=1
has
%defattr(-,root,root,-)
jsmeix commented at 2018-07-11 10:20:¶
As far as I see the "openSUSE:Specfile guidelines"
https://en.opensuse.org/openSUSE:Specfile_guidelines
require that
Every %files section must include a %defattr(...) line.
see
https://en.opensuse.org/openSUSE:Specfile_guidelines#Permissions
Permissions on files must be set properly. Executables should be set with executable permissions, for example. Every %files section must include a %defattr(...) line. Here is a good default: %files %defattr(-,root,root) Unless you have a very good reason to deviate from that, you should use %defattr(-,root,root) for all %files sections in your package. You can use %defattr(-,root,root,0755) to fix permission issues with directories. E.g. when an umask was too tight while unpacking.
jsmeix commented at 2018-07-11 10:29:¶
I think this issue is not a ReaR upstream issue, cf.
https://github.com/rear/rear/issues/1855#issuecomment-404100990
jsmeix commented at 2018-07-16 11:48:¶
@gdha
provided you agree that this issue is not a ReaR upstream issue,
can we close it or do you need it to be open for some time?
gdha commented at 2018-07-17 08:37:¶
@jsmeix As OBS requires it I agree that we must keep it. We can close this task.
[Export of Github issue for rear/rear.]