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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt writes ("Re: [PATCH v2] ident: check /etc/mailname if email is unknown"):
> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]