[Bug 1166449] New: RPMlint can not handle %ghost created in %trigger scripts
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449 Bug ID: 1166449 Summary: RPMlint can not handle %ghost created in %trigger scripts Classification: openSUSE Product: openSUSE.org Version: unspecified Hardware: All OS: SUSE Other Status: NEW Severity: Critical Priority: P5 - None Component: BuildService Assignee: bnc-team-screening@forge.provo.novell.com Reporter: werner@suse.com QA Contact: adrian.schroeter@suse.com CC: fabian@ritter-vogt.de, fbui@suse.com, fvogt@suse.com, meissner@suse.com, sndirsch@suse.com Depends on: 1165987 Found By: --- Blocker: --- +++ This bug was initially created as a clone of Bug #1165987 +++ I've verified that the resulting package nvidia-gfxG05-kmp-default does create the %ghost file noether:/ # ll /usr/lib/tmpfiles.d/nvidia-logind-acl-trick.conf -rw-r--r-- 1 root root 222 Mar 12 07:44 /usr/lib/tmpfiles.d/nvidia-logind-acl-trick.conf together with the path noether:/ # rpm -q --qf '[%{FILEFLAGS:fflags} %{FILEVERIFYFLAGS:vflags} %{FILENAMES}\n]' nvidia-gfxG05-kmp-default-440.64_k5.5.7_1-0.x86_64 | grep tmpf g M?D?UGP /usr/lib/tmpfiles.d/nvidia-logind-acl-trick.conf but RPMlinit does not ddetect this: [ 230s] RPMLINT report: [ 230s] =============== [ 232s] 0 packages and 0 specfiles checked; 0 errors, 29 warnings. [ 232s] Traceback (most recent call last): [ 232s] File "rpmlint.py", line 378, in <module> [ 232s] File "rpmlint.py", line 166, in main [ 232s] File "rpmlint.py", line 224, in runChecks [ 232s] File "TmpFilesCheck.py", line 50, in check [ 232s] FileNotFoundError: [Errno 2] No such file or directory: '/tmp/rpmlint.nvidia-gfxG05-kmp-default-440.64_k5.5.7_1-0.x86_64.rpm.npncim6_/usr/lib/tmpfiles.d/nvidia-logind-acl-trick.conf' which is not very productive -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c1
--- Comment #1 from Dr. Werner Fink
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c2
Dr. Werner Fink
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c3
--- Comment #3 from Dr. Werner Fink
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c4
--- Comment #4 from Fabian Vogt
taht is it tries to open the file and then check if it is a %ghost file ... but per definition a %ghost files does not exist at this point
No, the issue is actually the
with open(pkgfile.path) as inputf:
which doesn't check for pkgfile.is_ghost. The loop below is iterating through the tmpfile's file content. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c5
--- Comment #5 from Dr. Werner Fink
(In reply to Dr. Werner Fink from comment #1)
taht is it tries to open the file and then check if it is a %ghost file ... but per definition a %ghost files does not exist at this point
No, the issue is actually the
with open(pkgfile.path) as inputf:
which doesn't check for pkgfile.is_ghost. The loop below is iterating through the tmpfile's file content.
This is exactly what I said ... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c6
--- Comment #6 from Dr. Werner Fink
Not tested yet
--- TmpFilesCheck.py +++ TmpFilesCheck.py 2020-03-12 08:09:38.292286701 +0000 @@ -34,16 +34,19 @@ class TmpFilesCheck(AbstractCheck.Abstra
for fn, pkgfile in pkg.files().items(): if not fn.startswith('/usr/lib/tmpfiles.d/'): continue if not stat.S_ISREG(pkgfile.mode): printWarning(pkg, "tmpfile-not-regular-file", fn) continue
+ if pkgfile.is_ghost: + continue + basename = os.path.basename(fn) pattern = re.compile( r'systemd-tmpfiles --create .*%s' % re.escape(basename)) if (not postin or not pattern.search(postin)) and \ (not prein or not pattern.search(prein)): printWarning(pkg, 'postin-without-tmpfile-creation', fn)
I've local build the rpmlint with this patch and copied the resulting /usr/share/rpmlint/__pycache__/TmpFilesCheck.cpython-38.opt-1.pyc into the build environment for the nvidia package as /opt/testing/share/rpmlint/TmpFilesCheck.pyc to override the rpmlinit-mini and now the pacakge build [ 245s] nvidia-gfxG05-kmp-default.x86_64: W: unstripped-binary-or-object /usr/src/kernel-modules/nvidia-440.64-default/nvidia-modeset/nv-modeset-kernel.o_binary [ 245s] nvidia-gfxG05-kmp-default.x86_64: W: unstripped-binary-or-object /usr/src/kernel-modules/nvidia-440.64-default/nvidia/nv-kernel.o_binary [ 245s] stripping debug info from binaries happens automatically according to global [ 245s] project settings. So there's normally no need to manually strip binaries. Left [ 245s] over unstripped binaries could therefore indicate a bug in the automatic [ 245s] stripping process. [ 245s] [ 245s] nvidia-gfxG05-kmp-default.x86_64: W: useless-provides nvidia-gfxG05-kmp [ 245s] nvidia-gfxG05-kmp-default.x86_64: W: useless-provides nvidia-gfxG05-kmp-default [ 245s] This package provides 2 times the same capacity. It should only provide it [ 245s] once. [ 245s] [ 245s] 2 packages and 0 specfiles checked; 0 errors, 40 warnings. [ 245s] -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c7
--- Comment #7 from Fabian Vogt
(In reply to Fabian Vogt from comment #4)
(In reply to Dr. Werner Fink from comment #1)
taht is it tries to open the file and then check if it is a %ghost file ... but per definition a %ghost files does not exist at this point
No, the issue is actually the
with open(pkgfile.path) as inputf:
which doesn't check for pkgfile.is_ghost. The loop below is iterating through the tmpfile's file content.
This is exactly what I said ...
Not really:
taht is it tries to open the file and then check if it is a %ghost file
It never checks whether pkgfile was a %ghost file after opening. It checks whether the paths mentioned in the tmpfile are %ghost, but it never opens those. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c8
--- Comment #8 from Dr. Werner Fink
(In reply to Dr. Werner Fink from comment #5)
(In reply to Fabian Vogt from comment #4)
(In reply to Dr. Werner Fink from comment #1)
taht is it tries to open the file and then check if it is a %ghost file ... but per definition a %ghost files does not exist at this point
No, the issue is actually the
with open(pkgfile.path) as inputf:
which doesn't check for pkgfile.is_ghost. The loop below is iterating through the tmpfile's file content.
This is exactly what I said ...
Not really:
taht is it tries to open the file and then check if it is a %ghost file
It never checks whether pkgfile was a %ghost file after opening. It checks whether the paths mentioned in the tmpfile are %ghost, but it never opens those.
Read my diff with more context and you will see that I do if pkgfile.is_ghost: continue *before* open the file ... nevertheless the chenck if it is a %ghost file and write out a warning is also there with "tmpfile-not-ghost" -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c9
--- Comment #9 from Ludwig Nussel
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449#c10
--- Comment #10 from Dr. Werner Fink
certainly I never anticipated a tmpfile created by some nasty trigger script.
Than you might find the pull request https://github.com/openSUSE/rpmlint-checks/pull/57 useful -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1166449 Bug 1166449 depends on bug 1165987, which changed state. Bug 1165987 Summary: AUDIT-0: The sddm user has no permissions on Nvidia based X servers http://bugzilla.opensuse.org/show_bug.cgi?id=1165987 What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com