This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] localedef: improve error message [BZ #16985]


On 09/11/2015 02:27 PM, Roland McGrath wrote:
I'm not following exactly what the case is.  It looks to me like the only
cases where construct_output_path can return NULL is when asprintf fails or
when mkdir fails.  The asprintf case really should just be an immediate
failure as xmalloc would do.  When mkdir fails, I'm not entirely clear on
why we don't just die immediately.  I guess the idea is that we can
diagnose input errors even if we will never succeed in writing the output.
I wonder how worthwhile that really is.

I haven't looked at the code but based on the description I can
reproduce the poor error message by passing the name of a non-
existent directory as an operand to the command. E.g., like so:

$ localedef -f localedata/charmaps/UTF-8 -i localedata/locales/en_US /foobar
cannot write output files to `(null)': Permission denied

Presumably, after applying the patch the message will reference
the name of the directory that the command cannot write to:

cannot write output files to `/foobar': Permission denied

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]