Subject: CVS commit: src/libexec/ftpd
To: None <source-changes@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: source-changes
Date: 01/08/2003 20:07:32
Module Name:	src
Committed By:	manu
Date:		Wed Jan  8 18:07:31 UTC 2003

Modified Files:
	src/libexec/ftpd: cmds.c

Log Message:
ftpd was unable to service the pwd request once you entered a directory
without search permission. This confused some ftp clients.

We fix this problem by maitaining a cached path when getcwd() does not work.
The symbolic links and ../ are resolved in the cached path, and it is finnally
checked for accuracy by comparing ./ and the cached path with stat (device
and inode comparison). If the comparison fails, pwd fails as it did before,
and if the comparison succeeds, the cached path is displayed.

If paths are too long, we should just compare ./ with a truncated path and
fail, thus making pwd displaying an error as it did before.


To generate a diff of this commit:
cvs rdiff -r1.19 -r1.20 src/libexec/ftpd/cmds.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.