summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/ftpd')
-rw-r--r--libexec/ftpd/ftpd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 79c20f1..885166c 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.
OpenPOWER on IntegriCloud