ftpd: escape chroot prior to re-executing ls helper
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 27 Jun 2014 10:24:39 +0000 (12:24 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 27 Jun 2014 10:24:39 +0000 (12:24 +0200)
commita6ae999b3b30ad522272325bac4c69b153150108
tree0af61697af6661c9d45c28025f2404c522436278
parent5f8daefb835687e428215f90d26fdf1f0206149d
ftpd: escape chroot prior to re-executing ls helper

When we merely chdir to saved "real" root fd,
exec("proc/self/exe") works for static executables but not
for dynamic ones (they can't find their interpreter).

With this patch, we also *chroot* to real root.
As a bonus, this gives us proper usernames, timezone conversion
etc.

function                                             old     new   delta
popen_ls                                             203     259     +56
ftpd_main                                           2362    2366      +4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/ftpd.c