Bug 831069 - --config does not accept relative paths
Summary: --config does not accept relative paths
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CSProcessor
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-12 06:47 UTC by Joshua Wulf
Modified: 2014-10-19 23:00 UTC (History)
3 users (show)

Fixed In Version: 0.24.8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-07 01:29:27 UTC
Embargoed:


Attachments (Terms of Use)

Description Joshua Wulf 2012-06-12 06:47:04 UTC
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 07:10:01 UTC
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-19 02:15:00 UTC
Released in version 0.24.8.

Comment 3 Lee Newson 2013-06-07 01:29:27 UTC
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.