bugFreeciv - Bugs: bug #22283, Poor error reporting on failure to...

 
 
Show feedback again

bug #22283: Poor error reporting on failure to open file

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sun 06 Jul 2014 11:47:19 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open
Release: Operating System: None
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 15 Jul 2014 08:30:22 PM UTC, comment #1:

See bug #21702 for a specific example where this has caused confusion.

Jacob Nevins <jtn>
Project Administrator
Sun 06 Jul 2014 11:47:19 AM UTC, original submission:

If a data file isn't present, has no permissions, etc, secfile_error() doesn't return anything useful (a blank string when I tried).

Fixing this will be quite tedious:

secfile_load()/secfile_load_section() call inf_from_file() in inputfile, which doesn't have a defined ferror/errno/strerror-type interface.

inf_from_file() calls fz_from_file(), which kind of has such an interface (fz_strerror()), although it relies on the regular errno which won't be set for compression-related errors. Also, it's not set for all OS errors.

For instance, support.c:is_reg_file_for_access() can return FALSE for a non-errno condition, so fz_from_file() can't simply call strerror(), hence we don't trivially get "file not found" vs "permission denied" in fz_strerror().

Fixing this will require a usable error reporting interface at every layer in this stack, so that we can get "file not found" from the OS all the way to secfile_error().

Jacob Nevins <jtn>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup