This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] localedef: improve error message [BZ #16985]
- From: Martin Sebor <msebor at gmail dot com>
- To: Roland McGrath <roland at hack dot frob dot com>, Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 11 Sep 2015 15:11:34 -0600
- Subject: Re: [PATCH] localedef: improve error message [BZ #16985]
- Authentication-results: sourceware.org; auth=none
- References: <1440880793-32082-1-git-send-email-vapier at gentoo dot org> <20150911182429 dot GE640 at vapier> <20150911202733 dot 3A7342C3A73 at topped-with-meat dot com>
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