aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2014-07-12 03:05:49 +0100
committerPhillip Lougher <phillip@squashfs.org.uk>2014-07-12 03:05:49 +0100
commit726c23d51ab00cf56787a1a4f52d15d08eb2f364 (patch)
treec2102d8856ba2433183fd588a806bf202916faaf
parent4e93eb605a2ab05d173a571f17ba125de4849f45 (diff)
downloadsquashfs-tools-726c23d51ab00cf56787a1a4f52d15d08eb2f364.tar.gz
actions: contained() should check for nonstandard_pathname
If nonstandard_pathname is set, then we have a symlink entered on the command line, this by definition is a dangling symlink. Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
-rw-r--r--squashfs-tools/action.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
index d22017e..e65cc33 100644
--- a/squashfs-tools/action.c
+++ b/squashfs-tools/action.c
@@ -2331,6 +2331,11 @@ static int contained_fn(struct atom *atom, struct action_data *action_data)
if (!file_type_match(action_data->buf->st_mode, ACTION_LNK))
return 1;
+ /* if nonstandard_pathname is set, then this is a symlink entered on the
+ * command line, this by definition is a dangling symlink */
+ if(action_data->dir_ent->nonstandard_pathname)
+ return 0;
+
bytes = readlink(action_data->pathname, s, 65536);
if(bytes < 1 || bytes == 65536)
/* reading symlink failed or (unlikely) the symlink was longer