summaryrefslogtreecommitdiffstats
path: root/cpukit/ftpd
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-09 08:12:46 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-09 13:26:46 +0200
commit84a5921d33a5190779285017675e99e6b4aaf32f (patch)
tree373750ba8968f9bfa992872832f81d294e28137f /cpukit/ftpd
parentleon: do not use -mfix-{device} with Clang (diff)
downloadrtems-84a5921d33a5190779285017675e99e6b4aaf32f.tar.bz2
ftpd: Restructure chroot() handling.
Remove superfluous setting of errno = 0. Update #3530.
Diffstat (limited to 'cpukit/ftpd')
-rw-r--r--cpukit/ftpd/ftpd.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/cpukit/ftpd/ftpd.c b/cpukit/ftpd/ftpd.c
index 580e55cb42..9c84ff5c43 100644
--- a/cpukit/ftpd/ftpd.c
+++ b/cpukit/ftpd/ftpd.c
@@ -1872,7 +1872,6 @@ session(rtems_task_argument arg)
while (1)
{
rtems_event_set set;
- int rv;
rtems_event_receive(FTPD_RTEMS_EVENT, RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT,
&set);
@@ -1882,14 +1881,11 @@ session(rtems_task_argument arg)
&& chroot(ftpd_root) == 0);
/*
- * The chdir() must immediatly follow the chroot(), otherwise static
+ * The chdir() must immediately follow the chroot(), otherwise static
* analysis tools may complain about a security issue.
- */
- rv = chroot_made ? chdir("/") : -1;
-
- errno = 0;
+ */
- if (rv == 0)
+ if (chroot_made && chdir("/") == 0)
{
send_reply(info, 220, FTPD_SERVER_MESSAGE);