summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.c
diff options
context:
space:
mode:
authorRenaud Barbier <renaud.barbier@ge.com>2016-12-08 14:14:28 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-09 13:41:12 +0100
commitad43a6de3d47065aa3cd54eb31e37aa03681351f (patch)
tree13a7b62e020dff30c8e0e3daf53b1b8be188110e /fs/ubifs/ubifs.c
parent2079d3866698bec202fdf50a60e96b65b0b42ad9 (diff)
downloadbarebox-ad43a6de3d47065aa3cd54eb31e37aa03681351f.tar.gz
barebox-ad43a6de3d47065aa3cd54eb31e37aa03681351f.tar.xz
ubifs: restore symlink support
In commit a63059d7 of the latest u-boot port, the function that returns the inode number also resolves symlink. This prevents the readlink entry point from doing its job and breaks the user command readlink and the display of symlink with the ls command. Remove the code following the link to restore original functionality. Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/ubifs/ubifs.c')
-rw-r--r--fs/ubifs/ubifs.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 7935688ad1..0bb1c26d7d 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -496,12 +496,9 @@ static unsigned long ubifs_findfile(struct super_block *sb, const char *filename
int ret;
char *next;
char fpath[128];
- char symlinkpath[128];
char *name = fpath;
unsigned long root_inum = 1;
unsigned long inum;
- int symlink_count = 0; /* Don't allow symlink recursion */
- char link_name[64];
strcpy(fpath, filename);
@@ -537,32 +534,6 @@ static unsigned long ubifs_findfile(struct super_block *sb, const char *filename
return 0;
ui = ubifs_inode(inode);
- if ((inode->i_mode & S_IFMT) == S_IFLNK) {
- char buf[128];
-
- /* We have some sort of symlink recursion, bail out */
- if (symlink_count++ > 8) {
- printf("Symlink recursion, aborting\n");
- return 0;
- }
- memcpy(link_name, ui->data, ui->data_len);
- link_name[ui->data_len] = '\0';
-
- if (link_name[0] == '/') {
- /* Absolute path, redo everything without
- * the leading slash */
- next = name = link_name + 1;
- root_inum = 1;
- continue;
- }
- /* Relative to cur dir */
- sprintf(buf, "%s/%s",
- link_name, next == NULL ? "" : next);
- memcpy(symlinkpath, buf, sizeof(buf));
- next = name = symlinkpath;
- continue;
- }
-
/*
* Check if directory with this name exists
*/