Subject: Re: tftpd: writing files with relative pathnames?
To: None <current-users@netbsd.org>
From: Guenther Grau <Guenther.Grau@bk.bosch.de>
List: current-users
Date: 10/26/1998 23:04:59
"Michael K. Sanders" wrote:
>         /*
>          * Relative file name: search the approved locations for it.
>          * Don't allow write requests or ones that avoid directory
>          * restrictions.
>          */
> 
>         if (mode != RRQ || !strncmp(filename, "../", 3))
>             return (EACCESS);
> 
> After changing the file name to use an absolute path, the transfer
> went fine, but I'm wondering why writes of relative files are
> disallowed...

It was probably done to fix security holes. It should prevent that
an evil process can escape from the tftp-directory and write
to other directories.

Looking at the man page (thanx to whoever set them up at flame.org
and put the link to it on www.netbsd.org!!!) it says that

Files containing the string ``/../'' are not allowed.

which should be corrected to the string "../" :-)

Other than that, the access violation should be sent to the syslog,
probably with the reason why it was an access violation.

  Guenther

P.S.: I just tried the www-interface to the NetBSD gnats database
to submit a PR concerning this.