diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-29 16:11:46 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-29 16:18:44 +0200 |
commit | 4da3fef4553dd294bdaa0994e9bd5b99ff48e2e1 (patch) | |
tree | 6279853bca4b4773f10619f9ff2e3cd9366b43bd /cpukit | |
parent | 847ad441cda2466680107b0b7607a8ceca3b17d4 (diff) |
ftpd: Set current directory after session close
The chroot() is an implicit chdir("/"). Set the current directory to
"/" after session close. This helps to avoid references to mounted file
systems in dynamic media.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ftpd/ftpd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/ftpd/ftpd.c b/cpukit/ftpd/ftpd.c index 2668c295eb..905f40c2d8 100644 --- a/cpukit/ftpd/ftpd.c +++ b/cpukit/ftpd/ftpd.c @@ -1890,7 +1890,6 @@ session(rtems_task_argument arg) &set); chroot_made = chroot_made || chroot(ftpd_root) == 0; - chdir("/"); errno = 0; @@ -1926,6 +1925,8 @@ session(rtems_task_argument arg) free(info->user); free(info->pass); task_pool_release(info); + + chdir("/"); } } |