git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] ident: check /etc/mailname if email is unknown

From
IJIan Jackson <ijackson@chiark.greenend.org.uk>
Date
Oct 3, 2011, 11:32 UTC
Message-ID
<20105.40257.351258.425389@chiark.greenend.org.uk>
In-Reply-To
<4E895FBD.8020904@viscovery.net>
Johannes Sixt writes ("Re: [PATCH v2] ident: check /etc/mailname if email is unknown"):
Show 12 quoted lines
> Am 10/3/2011 8:16, schrieb Jonathan Nieder:
> > +static int add_mailname_host(char *buf, size_t len)
> > +{
> > +	FILE *mailname;
> > +
> > +	mailname = fopen("/etc/mailname", "r");
> > +	if (!mailname) {
> > +		if (errno != ENOENT)
> > +			warning("cannot open /etc/mailname: %s",
> > +				strerror(errno));
> 
> This warns on EACCES. Is that OK? (Just asking, I have no opinion.)

I think that's correct. Personally I'm a bit of an error handling fascist and I would have it crash on EACCES but that's probably a bit harsh.

Certainly this file ought to be generally readable, if it exists.
Ian.
Previous: Jonathan NiederNext: Junio C Hamano
Message 10 of 11 in “ident: check /etc/mailname if email is unknown”
  1. ident: check /etc/mailname if email is unknownJonathan Nieder, Oct 3, 2011
  2. Junio C HamanoOct 3, 2011
  3. ident: check /etc/mailname if email is unknownJonathan Nieder, Oct 3, 2011
  4. Johannes SixtOct 3, 2011
  5. Jonathan NiederOct 3, 2011
  6. Junio C HamanoOct 3, 2011
  7. ident: do not retrieve default ident when unnecessaryJonathan Nieder, Oct 6, 2011
  8. Junio C HamanoOct 6, 2011
  9. Jonathan NiederOct 6, 2011
  10. Ian JacksonOct 3, 2011
  11. Junio C HamanoOct 3, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.