From 956455631cc48e19327b53f79cbd43f02ec2cfa8 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Mon, 22 May 1995 11:03:55 +0000 Subject: Make last change a little more robust by checking for failure of getcwd(). --- libexec/ftpd/ftpd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libexec/ftpd') diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 79c20f163fe7..885166cfbc05 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $Id$ */ #ifndef lint @@ -632,7 +634,8 @@ pass(passwd) /* * Set home directory so that use of ~ (tilde) works correctly. */ - setenv("HOME", getcwd(homedir, MAXPATHLEN), 1); + if (getcwd(homedir, MAXPATHLEN) != NULL) + setenv("HOME", homedir, 1); /* * Display a login message, if it exists. -- cgit v1.3