fix tar -xzvf symbol link (#8034)
This commit is contained in:
parent
3e3cf91b77
commit
12592458b9
@ -1283,7 +1283,7 @@ int dfs_file_symlink(const char *target, const char *linkpath)
|
||||
{
|
||||
if (dentry->mnt->fs_ops->symlink)
|
||||
{
|
||||
char *path = dfs_normalize_path(NULL, target);
|
||||
char *path = dfs_normalize_path(parent, target);
|
||||
if (path)
|
||||
{
|
||||
char *tmp = dfs_nolink_path(&mnt, path, 0);
|
||||
@ -1297,8 +1297,6 @@ int dfs_file_symlink(const char *target, const char *linkpath)
|
||||
tmp = path;
|
||||
}
|
||||
|
||||
if (dfs_file_access(path, O_RDONLY) == 0)
|
||||
{
|
||||
ret = rt_strncmp(parent, path, strlen(parent));
|
||||
if (ret == 0)
|
||||
{
|
||||
@ -1313,11 +1311,6 @@ int dfs_file_symlink(const char *target, const char *linkpath)
|
||||
{
|
||||
ret = mnt->fs_ops->symlink(dentry, tmp, index + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENOENT;
|
||||
}
|
||||
|
||||
rt_free(path);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user