On 01/18/2015 03:23 PM, Sebastian Herbszt wrote:> > --- tftp-hpa-5.2/tftpd/tftpd.c.orig 2015-01-16 21:45:30.790798281 +0100 > +++ tftp-hpa-5.2/tftpd/tftpd.c 2015-01-18 23:44:28.031177383 +0100 > @@ -1504,6 +1504,8 @@ static int validate_access(char *filenam > return ENOSPACE; > case EEXIST: > return EEXISTS; > + case EACCES: > + return EACCESS; > default: > return errno + 100; > }I can't remember, but I have a vague recollection that someone specifically requested that EACCES be treated the same as ENOENT... -hpa
On 01/20/2015 09:13 PM, H. Peter Anvin wrote:> I can't remember, but I have a vague recollection that someone > specifically requested that EACCES be treated the same as ENOENT...If that is really necessary then please don't report that condition as "file not found"; it's really misleading. Thanks, Andreas
On 01/20/2015 12:17 PM, Andreas Gruenbacher wrote:> On 01/20/2015 09:13 PM, H. Peter Anvin wrote: >> I can't remember, but I have a vague recollection that someone >> specifically requested that EACCES be treated the same as ENOENT... > > If that is really necessary then please don't report that condition as > "file not found"; it's really misleading.That is, however, the whole point -- the existence of a inaccessible file should not be visible to the client. This is apparently a security requirement in some environments. -hpa
H. Peter Anvin wrote:> On 01/18/2015 03:23 PM, Sebastian Herbszt wrote: > > > > --- tftp-hpa-5.2/tftpd/tftpd.c.orig 2015-01-16 21:45:30.790798281 +0100 > > +++ tftp-hpa-5.2/tftpd/tftpd.c 2015-01-18 23:44:28.031177383 +0100 > > @@ -1504,6 +1504,8 @@ static int validate_access(char *filenam > > return ENOSPACE; > > case EEXIST: > > return EEXISTS; > > + case EACCES: > > + return EACCESS; > > default: > > return errno + 100; > > } > > I can't remember, but I have a vague recollection that someone > specifically requested that EACCES be treated the same as ENOENT...Are you talking about syslinux or tftp-hpa? The above patch is for the latter and it (just) changes tftp> get bar Error code 0: Permission denied to tftp> get bar Error code 2: Access denied Sebastian