libc, vfs: rename improvements

Perform POSIX rename checks at the libc VFS plugin.
Clarify rename at VFS fs, ram, single, and tar file systems.

Issue #1900
Fixes #1782
This commit is contained in:
Emery Hemingway
2016-03-02 14:32:43 +01:00
committed by Christian Helmuth
parent d0735b1734
commit 23c1d4c66d
6 changed files with 61 additions and 24 deletions

View File

@ -387,6 +387,9 @@ class Vfs::Fs_file_system : public File_system
Rename_result rename(char const *from_path, char const *to_path) override
{
if ((strcmp(from_path, to_path) == 0) && leaf_path(from_path))
return RENAME_OK;
Absolute_path from_dir_path(from_path);
from_dir_path.strip_last_element();
from_dir_path.remove_trailing('/');