This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 892744 - [RFE] Detect file names with ~ in the path or name
[RFE] Detect file names with ~ in the path or name
Status: NEW
Product: Fedora
Classification: Fedora
Component: rpmlint (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tom "spot" Callaway
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-07 12:58 EST by Steve Grubb
Modified: 2013-09-16 11:01 EDT (History)
7 users (show)

See Also:
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:


Attachments (Terms of Use)

  None (edit)
Description Steve Grubb 2013-01-07 12:58:07 EST
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 04:22:06 EST
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 10:02:17 EST
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 10:33:20 EDT
(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@users.sourceforge.net>
#  Copyright 1997, Mark Peskin <mpeskin@mail.utexas.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 10:50:38 EDT
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 10:53:50 EDT
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 11:01:45 EDT
(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?

Note You need to log in before you can comment on or make changes to this bug.