diff options
author | dg <dg@FreeBSD.org> | 1995-05-22 11:03:55 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-22 11:03:55 +0000 |
commit | ac00cc595d1f401bd000d18837307e0ed056acf3 (patch) | |
tree | e0bce3ddcb38be3778778bd21f29bdd84a440f60 /libexec/ftpd | |
parent | d860120023b66d0f3e3da63e89b177fc0651cc3d (diff) | |
download | FreeBSD-src-ac00cc595d1f401bd000d18837307e0ed056acf3.zip FreeBSD-src-ac00cc595d1f401bd000d18837307e0ed056acf3.tar.gz |
Make last change a little more robust by checking for failure of getcwd().
Diffstat (limited to 'libexec/ftpd')
-rw-r--r-- | libexec/ftpd/ftpd.c | 5 |
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. |