s3: smbd: Currently if getwd() fails after a chdir(), we panic.
commit0a99c01fcfa0789d80058074fe98bdfbe22a1787
authorJeremy Allison <jra@samba.org>
Wed, 4 Oct 2017 19:43:22 +0000 (4 12:43 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 25 Oct 2017 06:43:03 +0000 (25 08:43 +0200)
tree1c22c192f61e735bf8b133ca859dbb7976c71cfa
parentdf225fecc78e6e54cdc59d1cf8562afb5c5db2c6
s3: smbd: Currently if getwd() fails after a chdir(), we panic.

Change this to return to the previous $cwd, and return -1 for the chdir().

If the return to the previous $cwd fails, still panic as we
can't return an unknown state.

Also do early return from failing SMB_VFS_CHDIR, reducing indentation level

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13027

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit 272f1c9febdf51dd6ec7b862d33d2010621e840a)
source3/smbd/vfs.c