Parent: ed7441b89d9d99497bc29a04c0003be8f70c3b4b
Author: Slawomir Bochenski <lkslawek@gmail.com>
Committer: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-12-04 23:48:41
Tree: 8f42b7311229ff37b5e0d13c956d0f7cd371a9d1
obexd: Simplify symbolic links support This patch changes the way the symbolic links are treated by FTP, making code a bit simpler and FTP more intuitive. Previously symlinks were supposed to be disallowed unless the -l option was used, and with that option, only symlinks present directly inside root folder were followed. This did not work for file links, as fstat() check on open()-ed won't result in S_IFLNK set, so symbolic links to files were followed regardless to options. Now links inside root folder are always allowed. Without -l (--symlinks) option, following them is only allowed when the resulting real path is still inside the given root directory. When -l is given, all symlinks are followed.
Diffstat
| M | obexd/plugins/filesystem.c | | | 66 | ++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| M | obexd/plugins/filesystem.h | | | 1 | + |
| M | obexd/plugins/ftp.c | | | 13 | +++++++- - - - - - |
| M | obexd/src/main.c | | | 3 | ++- |
4 files changed, 48 insertions(+), 35 deletions(-)