Bug 892744

Summary: [RFE] Detect file names with ~ in the path or name
Product: [Fedora] Fedora Reporter: Steve Grubb <sgrubb>
Component: rpmlintAssignee: Tom "spot" Callaway <spotrh>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: a.badger, fweimer, manuel.wolfshant, tmz, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steve Grubb 2013-01-07 17:58:07 UTC
Description of problem:
Sometimes there are packages that have ~ in the filename because it was edited by an editor that saves a backup copy and both upstream missed it and the install script is too trusting. The problem is that if "rpm -ql" is used to get a list of files and a shell script processes it, then it will follow a set of rules to resolve the path and it causes havoc.

One example package that can be used for testing purposes is ClanLib1-devel-1.0.0-11.fc18.

Comment 1 Ville Skyttä 2013-01-08 09:22:06 UTC
For reference, ClanLib1-devel-1.0.0-11.fc18 can be grabbed here:
http://koji.fedoraproject.org/koji/buildinfo?buildID=331174

I think "~ in the filename" can be a too general thing to whine about, but if the filenames containing ~ in this ClanLib1-devel package are backup files, they seem to be following a naming pattern we could try to detect. What editor creates backup files with this pattern?

The regex used to flag files as backup files is in /usr/share/rpmlint/FilesCheck.py, backup_regex.

Comment 2 Steve Grubb 2013-01-10 15:02:17 UTC
I don't know what editor they were using. But if you look at the file names in the package, some have **) which, while legal names, are clearly not advisable names as they will cause scripting problems. For example,

/usr/share/doc/ClanLib1-devel-1.0.0/html/Reference/html/CL_GLFunctions__**pointer).html

I'd say, *,~,(,) are not advisable to belong in file names.

Comment 3 Florian Weimer 2013-09-16 14:33:20 UTC
(In reply to Steve Grubb from comment #0)
> One example package that can be used for testing purposes is
> ClanLib1-devel-1.0.0-11.fc18.

Which path? This:

/usr/share/doc/ClanLib1-devel-1.0.0/html/Reference/html/CL_Button_Silver__~CL_Button_Silver.html

is generated documentation for a C++ destructor, from this program:

#  PCE2 - Perl C++ Extractor version 2
#  Copyright 2000-1999, Karl Nelson  <kenelson.net>
#  Copyright 1997, Mark Peskin <mpeskin.edu>

This is probably a generator bug/missing feature because the "~" character is not really that portable in file names.  But it's definitely not a backup file.

Emacs creates backup files ending in "~", or "~" with a version number (which is extremely rare, though).

Inner or anonymous Java classes use "$" in file names, and we really can't change that, so there's no way around fixing shell scripts to deal with metacharacters properly, I'm afraid.

Comment 4 Florian Weimer 2013-09-16 14:50:38 UTC
Here's a Java example: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.0.x86_64/demo/applets/Blink/Blink$1.class in java-1.8.0-openjdk-demo-1:1.8.0.0-0.9.b89.fc19.x86_64.

Even files with ` exist, in ucblogo-6.0-11.fc19.x86_64 and synopsis-doc-0.12-9.fc19.x86_64.

Comment 5 Steve Grubb 2013-09-16 14:53:50 UTC
The point is that since we are in control of our very own packages, we can choose to make life easy or hard on ourselves.

Comment 6 Florian Weimer 2013-09-16 15:01:45 UTC
(In reply to Steve Grubb from comment #5)
> The point is that since we are in control of our very own packages, we can
> choose to make life easy or hard on ourselves.

True, but as I explained, we really can't outlaw $.  With that in mind, banning ~. ' or ` will not actually simplify things that much, will it?

Comment 7 Fedora Admin user for bugzilla script actions 2020-06-03 02:57:05 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.