Bug 658945 - No error reporting when config is a directory
Summary: No error reporting when config is a directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Config-General
Version: 14
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-01 17:02 UTC by Petr Pisar
Modified: 2010-12-12 00:03 UTC (History)
4 users (show)

Fixed In Version: perl-Config-General-2.50-1.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of: 467240
Environment:
Last Closed: 2010-12-12 00:03:12 UTC


Attachments (Terms of Use)

Description Petr Pisar 2010-12-01 17:02:57 UTC
+++ This bug was initially created as a clone of Bug #467240 +++

Description of problem:

When Config::General is supplied a directory instead of a config file
it silently accepts it and returns an empty config hash.

Version-Release number of selected component (if applicable):
perl-Config-General-2.40-1.el5.noarch

Steps to Reproduce:
use Data::Dumper;
use Config::General;

my $configurator = new Config::General("/etc/httpd/conf.d/");
%config = $configurator->getall;
print Dumper(\%config);
  
Actual results:
$VAR1 = {};

Expected results:
It should croak something like:
Config::General: Cannot open "/etc/httpd/conf.d/" par parsing, it's a directory.
[and return non-zero exit status]

Additional info:
Croaks well with non-existing files:
Config::General The file "/etc/httpd/conf.dd/" does not exist within ConfigPath: /etc/httpd/conf.dd! at test.pl line 6
--- 

[...]

--- Additional comment from ppisar@redhat.com on 2010-12-01 16:24:00 GMT ---

Fixed in upstream version 2.50 version. Changelog:

  2.50
        - fixed rt.cpan.org#63487 documentation error.

        - fixed rt.cpan.org#61302, now croak if the config file
          parameter is a directory and directory include is not
          turned on.

        - fixed rt.cpan.org#60429 META.yml typo

        - added new option -AllowSingleQuoteInterpolation, which
          turns on interpolation for variables inside single quotes.

        - added test case for the new option

Test:

$ perl -I /tmp/Config-General-2.50/blib/lib/ -MConfig::General -e 'Config::General->new(".")->getall'
Config::General: config file argument is a directory, expecting a file!
 at -e line 1
-----

Please upgrade in F15 to 2.50 version and consider back-port or rebase in older Fedoras.

Comment 1 Fedora Update System 2010-12-02 15:54:59 UTC
perl-Config-General-2.50-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/perl-Config-General-2.50-1.fc14

Comment 2 Fedora Update System 2010-12-02 19:16:38 UTC
perl-Config-General-2.50-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update perl-Config-General'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/perl-Config-General-2.50-1.fc14

Comment 3 Fedora Update System 2010-12-12 00:03:01 UTC
perl-Config-General-2.50-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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