forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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("/");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user