Bug 209876
Summary: | backtrace on socket | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Patrice Dumas <pertusus> | ||||
Component: | rpmlint | Assignee: | Ville Skyttä <scop> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | rawhide | CC: | extras-qa | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | 0.78-2 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2006-10-15 14:04:20 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Patrice Dumas
2006-10-07 10:24:41 UTC
Created attachment 138067 [details]
Handle/mask errors in istextfile()
Hm, rpmlint trusts the rpm header when determining which type of file it is
examining, and apparently in this case the socket is listed as a normal file in
the package header.
That combined with the fact that there's no error checking in intextfile()
makes this a rpmlint bug indeed (to which the attached patch could be an
adequate bandaid for now - let me know if it changes anything), but I wonder if
the socket could be somehow listed as a socket in the fcron package header? Is
there a way to create dummy sockets for %ghosting purposes during eg. %install?
The patch fixes the backtrace. The socket is indeed listed as a normal file, since there is: # rpmbuild insist that %ghost files exist? %{__install} -d %{buildroot}%{_localstatedir}/run/ touch %{buildroot}%{_localstatedir}/run/fcron.pid touch %{buildroot}%{_localstatedir}/run/fcron.fifo and %ghost %{_localstatedir}/run/fcron.pid %ghost %{_localstatedir}/run/fcron.fifo Maybe rpm insists that the file exists to record the correct type and perms and so on... But I don't know how to do a socket from a shell script... Attempting to package sockets (and fifos and named pipes) is rather unnecessary: every daemon that uses socket/fifo/pipe that I've ever seen creates the file system object, removing the old. mknod(1) claims the ability to create a fifo. The %dev() attribute marker in rpm could be extended to handle socket/fifo/pipe creation if absolutely necessary. I personally think that packaging socket/fifo/pipe is a silly and futile exercise, all those file system objects are meaningful/useful only within the scope of a running daemon, and hence there is little need to package the objects. No matter what, using touch and %ghost is really feeble hackery. (In reply to comment #3) > Attempting to package sockets (and fifos and named pipes) is rather unnecessary: every daemon > that uses socket/fifo/pipe that I've ever seen creates the file system object, removing the old. > > mknod(1) claims the ability to create a fifo. There is also mkfifo. > if absolutely necessary. I personally think that packaging socket/fifo/pipe is a silly and > futile exercise, all those file system objects are meaningful/useful only within the scope of a > running daemon, and hence there is little need to package the objects. Yes, I agree with that. It seems that I added the socket, I don't remember why, and indeed this seems a bit silly. After some thinking packaging sockets seems really unfortunate. Maybe I thought, based on the name, it was a fifo and not a socket and that it could remain after the daemon stopped. For fifo it may theoretically make sense, these may be long lived objects and one may want to ensure that they are removed, and also that they have correct permissions using rpm. In real life, this situation is likely to be a packaging mistake however. In the case of fcron it is clearly a packaging mistake I did. > No matter what, using touch and %ghost is really feeble hackery. It seems relevant to me to do that for pid file. It may make sense to have rpm remove stale pid files when removing package, especially if a directory containing the pidfile remains otherwise. And I don't know how to do that except by doing a touch and %ghost. A slightly improved version of the patch is applied upstream: http://rpmlint.zarb.org/cgi-bin/trac.cgi/changeset/1285 (Whether or how to package some files is IMO better discussed on relevant mailing lists than here.) Better than %ghost is a file with %verify(not md5 size mtime) because that identifies the path as a file which %ghost does not. Fixed in 0.78-2.fc* |