Skip to content

Commit

Permalink
utils: drop check for invalid path
Browse files Browse the repository at this point in the history
it has already caused an issue in the past and it doesn't add any
value, since each component in the path is validated again later on.

Closes: #842

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jan 10, 2022
1 parent 9fc58ec commit 71e7af7
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/libcrun/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,6 @@ crun_safe_ensure_at (bool do_open, bool dir, int dirfd, const char *dirpath,

npath = xstrdup (path);

it = npath + strlen (npath) - 1;
while (*it == '/' && it > npath && ((size_t) (it - npath)) > dirpath_len)
*it-- = '\0';
if (((size_t) (it - npath)) == dirpath_len)
return crun_make_error (err, 0, "invalid path `%s`", path);

cwd = dirfd;
cur = npath;
it = strchr (npath, '/');
Expand Down

0 comments on commit 71e7af7

Please sign in to comment.