Bug 831069 - --config does not accept relative paths
--config does not accept relative paths
Status: CLOSED CURRENTRELEASE
Product: PressGang CCMS
Classification: Community
Component: CSProcessor (Show other bugs)
1.x
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lee Newson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-12 02:47 EDT by Joshua Wulf
Modified: 2014-10-19 19:00 EDT (History)
3 users (show)

See Also:
Fixed In Version: 0.24.8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-06 21:29:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua Wulf 2012-06-12 02:47:04 EDT
cspclient-0.23.5-1.noarch



[jwulf@radhe books]$ java -jar /home/jwulf/docshack/bin/csprocessor.jar list --config ./../bin/csprocessor.ini
CSProcessor client version: 0.23.5
ERROR: The configuration file does not exist in the specified location!

Yes it does:

[jwulf@radhe books]$ stat ./../bin/csprocessor.ini
  File: `./../bin/csprocessor.ini'
  Size: 235       	Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 150009      Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  500/   jwulf)   Gid: (  500/   jwulf)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2012-06-12 16:37:19.545875825 +1000
Modify: 2012-06-12 16:37:18.522906374 +1000
Change: 2012-06-12 16:37:18.522906374 +1000
 Birth: -
Comment 1 Lee Newson 2012-06-15 03:10:01 EDT
Fixed. I'll update the bug with a version once it's released.

Cause:

The Apache HierarchicalINIConfiguration doesn't accept relative file paths. As such any paths should be converted to their absolute path. This was manually being done for anything that started with "." or "..", however if it was a multiple level relative path then it wasn't fully resolved. eg. Joshs example was resolved as: "/home/jwulf/docshack/books/../bin/csprocessor.ini"

Consequence:

Files that were specified using relative paths were unable to be found because it was looking for directories actually named "..".

Fix:

Use the Java File.getCanonicalPath() method which will resolve the relative paths into an absolute path that the INIConfiguration parser can read.
Comment 2 Lee Newson 2012-06-18 22:15:00 EDT
Released in version 0.24.8.
Comment 3 Lee Newson 2013-06-06 21:29:27 EDT
Closing and setting as current release as no QA was performed by the original reporter. If there is still an issue with this bug still than please re-open it.

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